Documentation
¶
Index ¶
- Constants
- func AutoComplete(loader LoadLister, args, env []string) ([]string, bool)
- func EnableLogging(writer io.Writer)
- func JSONFormatReader(content []byte) (*builder.APISet, error)
- func Main(loader LoadLister, args []string, sources ...builder.SourceFn) error
- type ConfigLoader
- type FileReader
- type FormatReader
- type LoadLister
- type PrintableHeader
- type PrintableResponse
- type PrintableResponseBody
Constants ¶
View Source
const (
JSONFileExtension = ".capi.json"
)
Variables ¶
This section is empty.
Functions ¶
func AutoComplete ¶
func AutoComplete(loader LoadLister, args, env []string) ([]string, bool)
AutoComplete entry point
func EnableLogging ¶
Types ¶
type ConfigLoader ¶
type ConfigLoader struct {
// contains filtered or unexported fields
}
ConfigLoader find a config and load it
func NewConfigLoader ¶
func NewConfigLoader(home string, reader FileReader) ConfigLoader
NewConfigLoader
func (ConfigLoader) List ¶
func (loader ConfigLoader) List(search string) []string
func (ConfigLoader) Load ¶
func (loader ConfigLoader) Load(filename string) (*builder.APISet, error)
func (ConfigLoader) LoadRaw ¶
func (loader ConfigLoader) LoadRaw(filename string) (*rawConfig, error)
LoadRaw using filename, with extn json|xml|yaml or blank if blank, then look for file called apiset with the same file extns
func (ConfigLoader) RegisterFileExtension ¶
func (loader ConfigLoader) RegisterFileExtension(extn string, reader FormatReader)
type FileReader ¶
FileReader interface to arbitrary file reader
type FormatReader ¶
FormatReader can convert bytes to an APISet
type LoadLister ¶
type PrintableHeader ¶
type PrintableHeader map[string]builder.StringOrList
func (PrintableHeader) MarshalJSON ¶
func (ph PrintableHeader) MarshalJSON() ([]byte, error)
type PrintableResponse ¶
type PrintableResponse struct {
Status string `json:"status"`
StatusCode int `json:"statusCode"`
Proto string `json:"proto"`
ProtoMajor int `json:"protoMajor"`
ProtoMinor int `json:"protoMinor"`
Header PrintableHeader `json:"header"`
Body *PrintableResponseBody `json:"body,omitempty"`
}
func Collate ¶
func Collate(response *http.Response) PrintableResponse
type PrintableResponseBody ¶
type PrintableResponseBody json.RawMessage
func (*PrintableResponseBody) MarshalJSON ¶
func (p *PrintableResponseBody) MarshalJSON() ([]byte, error)
Click to show internal directories.
Click to hide internal directories.