run

package
v0.0.0-...-f8d3b81 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 10, 2019 License: MIT Imports: 15 Imported by: 0

Documentation

Index

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

func EnableLogging(writer io.Writer)

func JSONFormatReader

func JSONFormatReader(content []byte) (*builder.APISet, error)

func Main

func Main(loader LoadLister, args []string, sources ...builder.SourceFn) error

Main entry point

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

type FileReader func(filename string) ([]byte, error)

FileReader interface to arbitrary file reader

type FormatReader

type FormatReader func(content []byte) (*builder.APISet, error)

FormatReader can convert bytes to an APISet

type LoadLister

type LoadLister interface {
	List(search string) []string
	Load(filename string) (*builder.APISet, error)
}

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)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL