Versions in this module Expand all Collapse all v0 v0.20.2 Apr 5, 2024 Changes in this version + const IndentLevel1 + const IndentLevel2 + const IndentLevel3 + var Cache *viper.Viper + var DisplayRanges = []*unicode.RangeTable + var GlobalFlags *pflag.FlagSet + var MarkdownStyle = ansi.StyleConfig + var ReadableLexer = lexers.Register(chroma.MustNewLazyLexer(&chroma.Config{ ... }, func() chroma.Rules { ... })) + var Root *cobra.Command + var SchemaLexer = lexers.Register(chroma.MustNewLazyLexer(&chroma.Config{ ... }, func() chroma.Rules { ... })) + var Stderr io.Writer = os.Stderr + var Stdin interface{ ... } = os.Stdin + var Stdout io.Writer = os.Stdout + func AddAuth(name string, h AuthHandler) + func AddContentType(short, 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 Defaults() + func FixAddress(addr string) string + func GetBody(mediaType string, args []string) (string, error) + func GetExitCode() int + func GetLastStatus() int + func Highlight(lexer string, data []byte) ([]byte, error) + func IgnoreCLIParams() requestOption + func IgnoreStatus() requestOption + 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 MarshalShort(name string, pretty bool, value any) ([]byte, error) + func MinCachedTransport(min time.Duration) *httpcache.Transport + func ParseLinks(base *url.URL, resp *Response) error + func Run() (returnErr error) + 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 + RestishVersion string + 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 + OperationBase string + Profiles map[string]*APIProfile + SpecFiles []string + TLS *TLSConfig + func (a APIConfig) GetPrettyDisplay(outFormat string) ([]byte, error) + func (a APIConfig) Save() error + type APIProfile struct + Auth *APIAuth + Base string + 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, color bool) *DefaultFormatter + func (f *DefaultFormatter) Format(resp Response) error + type DeflateEncoding struct + func (g DeflateEncoding) Reader(stream io.Reader) (io.Reader, error) + type ExternalToolAuth struct + func (a *ExternalToolAuth) OnRequest(req *http.Request, key string, params map[string]string) error + func (a *ExternalToolAuth) Parameters() []AuthParam + type Gron struct + func (t Gron) Detect(contentType string) bool + func (t Gron) Marshal(value interface{}) ([]byte, error) + func (t Gron) Unmarshal(data []byte, value interface{}) error + type GzipEncoding struct + func (g GzipEncoding) Reader(stream io.Reader) (io.Reader, error) + type HALParser struct + func (h HALParser) ParseLinks(base *url.URL, resp *Response) error + type Ion struct + func (i Ion) Detect(contentType string) bool + func (i Ion) Marshal(value interface{}) ([]byte, error) + func (i Ion) MarshalPretty(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) MarshalPretty(value interface{}) ([]byte, error) + func (j JSON) Unmarshal(data []byte, value interface{}) error + type JSONAPIParser struct + func (j JSONAPIParser) ParseLinks(base *url.URL, resp *Response) error + type Link struct + Rel string + URI string + type LinkHeaderParser struct + func (l LinkHeaderParser) ParseLinks(base *url.URL, resp *Response) error + type LinkParser interface + ParseLinks func(base *url.URL, 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 + Deprecated string + Examples []string + Group 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) OptionName() string + func (p Param) Parse(value string) (interface{}, error) + func (p Param) Serialize(value interface{}) []string + type PathBuffer struct + func NewPathBuffer(parts [][]byte) *PathBuffer + func (b *PathBuffer) Bytes() []byte + func (b *PathBuffer) Pop() + func (b *PathBuffer) Push(s string) + type PrettyMarshaller interface + MarshalPretty func(value any) ([]byte, error) + type Readable struct + func (i Readable) Unmarshal(data []byte, value interface{}) error + func (r Readable) Detect(contentType string) bool + func (r Readable) Marshal(value interface{}) ([]byte, error) + type Request struct + Body string + Header http.Header + Method string + URI string + type Response struct + Body interface{} + Headers map[string]string + Links Links + Proto string + Status int + func GetParsedResponse(req *http.Request, options ...requestOption) (Response, error) + func ParseResponse(resp *http.Response) (Response, error) + func (r Response) Map() map[string]any + type ResponseFormatter interface + Format func(Response) error + var Formatter ResponseFormatter + type SirenParser struct + func (s SirenParser) ParseLinks(base *url.URL, resp *Response) error + type Style int + const StyleForm + const StyleSimple + type TLSConfig struct + CACert string + Cert string + InsecureSkipVerify bool + Key string + type Table struct + func (t Table) Detect(contentType string) bool + func (t Table) Marshal(value interface{}) ([]byte, error) + func (t Table) Unmarshal(data []byte, value interface{}) error + type TerrificallySimpleJSONParser struct + func (t TerrificallySimpleJSONParser) ParseLinks(base *url.URL, 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