Versions in this module Expand all Collapse all v0 v0.7.4 Apr 20, 2021 v0.7.3 Apr 20, 2021 Changes in this version + var Cache *viper.Viper + var GlobalFlags *pflag.FlagSet + var ReadableLexer = lexers.Register(chroma.MustNewLexer(&chroma.Config{ ... }, chroma.Rules{ ... })) + var Root *cobra.Command + var SchemaLexer = lexers.Register(chroma.MustNewLexer(&chroma.Config{ ... }, chroma.Rules{ ... })) + var Stderr io.Writer = os.Stderr + var Stdout io.Writer = os.Stdout + func AddAuth(name string, h AuthHandler) + func AddContentType(name string, q float32, ct ContentType) + func AddEncoding(name string, encoding ContentEncoding) + func AddGlobalFlag(name, short, description string, defaultValue interface{}, multi bool) + func AddLinkParser(parser LinkParser) + func AddLoader(loader Loader) + func BestEffortSystemCertPool() *x509.CertPool + func CachedTransport() *httpcache.Transport + func DecodeResponse(resp *http.Response) error + func DeepAssign(target, source map[string]interface{}) + func Defaults() + func GetBody(mediaType string, args []string) (string, error) + func Highlight(lexer string, data []byte) ([]byte, error) + func Init(name string, version string) + func InvalidateCachedTransport() http.RoundTripper + func LogDebug(format string, values ...interface{}) + func LogDebugRequest(req *http.Request) + func LogDebugResponse(start time.Time, resp *http.Response) + func LogError(format string, values ...interface{}) + func LogInfo(format string, values ...interface{}) + func LogWarning(format string, values ...interface{}) + func MakeRequest(req *http.Request, options ...requestOption) (*http.Response, error) + func MakeRequestAndFormat(req *http.Request) + func Marshal(contentType string, value interface{}) ([]byte, error) + func MarshalReadable(v interface{}) ([]byte, error) + func MinCachedTransport(min time.Duration) *httpcache.Transport + func ParseLinks(base *url.URL, resp *Response) error + func Run() + func Unmarshal(contentType string, data []byte, value interface{}) error + func WithClient(c *http.Client) requestOption + func WithoutLog() requestOption + type API struct + Auth []APIAuth + AutoConfig AutoConfig + Long string + Operations []Operation + Short string + func Load(entrypoint string, root *cobra.Command) (API, error) + func (a *API) Merge(other API) + type APIAuth struct + Name string + Params map[string]string + type APIConfig struct + Base string + Profiles map[string]*APIProfile + SpecFiles []string + TLS *TLSConfig + func (a APIConfig) Save() error + type APIProfile struct + Auth *APIAuth + Headers map[string]string + Query map[string]string + type AuthHandler interface + OnRequest func(req *http.Request, key string, params map[string]string) error + Parameters func() []AuthParam + type AuthParam struct + Help string + Name string + Required bool + type AutoConfig struct + Auth APIAuth + Headers map[string]string + Prompt map[string]AutoConfigVar + type AutoConfigVar struct + Default interface{} + Description string + Enum []interface{} + Example string + Exclude bool + type BasicAuth struct + func (a *BasicAuth) OnRequest(req *http.Request, key string, params map[string]string) error + func (a *BasicAuth) Parameters() []AuthParam + type BrotliEncoding struct + func (b BrotliEncoding) Reader(stream io.Reader) (io.Reader, error) + type CBOR struct + func (c CBOR) Detect(contentType string) bool + func (c CBOR) Marshal(value interface{}) ([]byte, error) + func (c CBOR) Unmarshal(data []byte, value interface{}) error + type ContentEncoding interface + Reader func(stream io.Reader) (io.Reader, error) + type ContentType interface + Detect func(contentType string) bool + Marshal func(value interface{}) ([]byte, error) + Unmarshal func(data []byte, value interface{}) error + type DefaultFormatter struct + func NewDefaultFormatter(tty bool) *DefaultFormatter + func (f *DefaultFormatter) Format(resp Response) error + type GzipEncoding struct + func (g GzipEncoding) Reader(stream io.Reader) (io.Reader, error) + type HALParser struct + func (h HALParser) ParseLinks(resp *Response) error + type Ion struct + func (i Ion) Detect(contentType string) bool + func (i Ion) Marshal(value interface{}) ([]byte, error) + func (i Ion) Unmarshal(data []byte, value interface{}) error + type JSON struct + func (j JSON) Detect(contentType string) bool + func (j JSON) Marshal(value interface{}) ([]byte, error) + func (j JSON) Unmarshal(data []byte, value interface{}) error + type JSONAPIParser struct + func (j JSONAPIParser) ParseLinks(resp *Response) error + type Link struct + Rel string + URI string + type LinkHeaderParser struct + func (l LinkHeaderParser) ParseLinks(resp *Response) error + type LinkParser interface + ParseLinks func(resp *Response) error + type Links map[string][]*Link + type Loader interface + Detect func(resp *http.Response) bool + Load func(entrypoint, spec url.URL, resp *http.Response) (API, error) + LocationHints func() []string + type MsgPack struct + func (m MsgPack) Detect(contentType string) bool + func (m MsgPack) Marshal(value interface{}) ([]byte, error) + func (m MsgPack) Unmarshal(data []byte, value interface{}) error + type Operation struct + Aliases []string + BodyMediaType string + Examples []string + HeaderParams []*Param + Hidden bool + Long string + Method string + Name string + PathParams []*Param + QueryParams []*Param + Short string + URITemplate string + type Param struct + Default interface{} + Description string + DisplayName string + Example interface{} + Explode bool + Name string + Style Style + Type string + func (p Param) AddFlag(flags *pflag.FlagSet) interface{} + func (p Param) Parse(value string) (interface{}, error) + func (p Param) Serialize(value interface{}) []string + type Response struct + Body interface{} + Headers map[string]string + Links Links + Proto string + Status int + func GetParsedResponse(req *http.Request) (Response, error) + func ParseResponse(resp *http.Response) (Response, error) + func (r Response) Map() map[string]interface{} + type ResponseFormatter interface + Format func(Response) error + var Formatter ResponseFormatter + type SirenParser struct + func (s SirenParser) ParseLinks(resp *Response) error + type Style int + const StyleForm + const StyleSimple + type TLSConfig struct + CACert string + Cert string + InsecureSkipVerify bool + Key string + type TerrificallySimpleJSONParser struct + func (t TerrificallySimpleJSONParser) ParseLinks(resp *Response) error + type Text struct + func (t Text) Detect(contentType string) bool + func (t Text) Marshal(value interface{}) ([]byte, error) + func (t Text) Unmarshal(data []byte, value interface{}) error + type YAML struct + func (y YAML) Detect(contentType string) bool + func (y YAML) Marshal(value interface{}) ([]byte, error) + func (y YAML) Unmarshal(data []byte, value interface{}) error