Versions in this module Expand all Collapse all v0 v0.2.0 Apr 13, 2026 Changes in this version + func AddBodyFieldFlags(cmd *cobra.Command, fields []BodyField) + func AddBodyFlags(cmd *cobra.Command) + func ApplyBodyFlags(cmd *cobra.Command, params *viper.Viper, mediaType string, body string, ...) (string, error) + func RunAuthSetup(profileName string, preferredType string) error + type BodyField struct + Description string + FlagName string + Name string + Type string v0.1.0 Apr 12, 2026 Changes in this version + var AuthHandlers = make(map[string]AuthHandler) + var Cache *viper.Viper + var Client *gentleman.Client + var ErrCannotUnmarshal = errors.New("Unable to unmarshal response") + var PreRun func(cmd *cobra.Command, args []string) error + var Root *cobra.Command + var Stderr io.Writer = os.Stderr + var Stdout io.Writer = os.Stdout + func AddFlag(path, name, short, description string, defaultValue interface{}) + func AddGlobalFlag(name, short, description string, defaultValue interface{}) + func DeepAssign(target, source map[string]interface{}) + func GetAuthStatus() map[string]interface + func GetBody(mediaType string, args []string) (string, error) + func GetMatchValue(ctx *context.Context, selector string, reqParams map[string]interface{}, ...) (interface{}, error) + func GetProfile() map[string]string + func GetServers() []map[string]string + func HandleAfter(path string, params *viper.Viper, resp *gentleman.Response, data interface{}) interface + func HandleBefore(path string, params *viper.Viper, r *gentleman.Request) + func Init(config *Config) + func InitCredentials(options ...func(*CredentialsFile) error) + func InitCredentialsFile() + func LogMiddleware(useColor bool) + func Markdown(content string) string + func Match(test string, expected json.RawMessage, actual interface{}) (bool, error) + func ProfileKeys(keys ...string) func(*CredentialsFile) error + func ProfileListKeys(keys ...string) func(*CredentialsFile) error + func RegisterAfter(path string, handler AfterHandlerFunc) + func RegisterBefore(path string, handler BeforeHandlerFunc) + func RegisterServers(servers []map[string]string) + func ResolveServer() string + func SetCustomFlags(cmd *cobra.Command) + func UnmarshalRequest(ctx *context.Context, s interface{}) error + func UnmarshalResponse(resp *gentleman.Response, s interface{}) error + func UseAuth(typeName string, handler AuthHandler) + func UserAgentMiddleware() + type AfterHandlerFunc func(string, *viper.Viper, *gentleman.Response, interface{}) interface + type AuthHandler interface + OnRequest func(log *zerolog.Logger, request *http.Request) error + ProfileKeys func() []string + type AuthStatusHandler interface + AuthStatus func(profile map[string]string) map[string]interface{} + type BeforeHandlerFunc func(string, *viper.Viper, *gentleman.Request) + type Config struct + APIKeyEnvVar string + AppName string + DefaultOutputFormat string + EnvPrefix string + Version string + type ConsoleWriter struct + NoColor bool + Out io.Writer + func (w ConsoleWriter) Write(p []byte) (n int, err error) + type CredentialsFile struct + var Creds *CredentialsFile + type DefaultFormatter struct + func NewDefaultFormatter(tty bool) *DefaultFormatter + func (f *DefaultFormatter) Format(data interface{}) error + type ResponseFormatter interface + Format func(interface{}) error + var Formatter ResponseFormatter