Documentation ¶
Index ¶
- Constants
- Variables
- func AddProfile(profile Profile, name string) error
- func FormatCommandData(cmd *cobra.Command, data interface{}) error
- func FormatCommandError(cmd *cobra.Command, err error) error
- func FormatRequestResult(cmd *cobra.Command, data interface{}, r *http.Response, err error) error
- func GetAPI() *sdk.APIClient
- func GetApiFromProfile(profile Profile) *sdk.APIClient
- func GetContext() (context.Context, context.CancelFunc)
- func GetContextFromProfile(profile Profile) (context.Context, context.CancelFunc)
- func LoadViperConfigIntoContext()
- func MakeDefaultContext()
- func RemoveProfile(name string) error
- func SetDefaultProfile(name string) error
- type CLI
- type Config
- type Context
- type NamedProfiles
- type Profile
Constants ¶
View Source
const ENV_PREFIX = "bunnyshell"
Variables ¶
View Source
var CLIContext = CLI{
OutputFormat: defaultFormat,
Timeout: defaultTimeout,
}
Functions ¶
func AddProfile ¶
func FormatCommandData ¶
func FormatRequestResult ¶
func GetApiFromProfile ¶
func GetContext ¶
func GetContext() (context.Context, context.CancelFunc)
func GetContextFromProfile ¶
func GetContextFromProfile(profile Profile) (context.Context, context.CancelFunc)
func LoadViperConfigIntoContext ¶
func LoadViperConfigIntoContext()
func MakeDefaultContext ¶
func MakeDefaultContext()
func RemoveProfile ¶
func SetDefaultProfile ¶
Types ¶
type CLI ¶
type CLI struct { Debug bool Feedback bool NoProgress bool ProfileName string Profile Profile OutputFormat string ConfigFile string Verbosity int Timeout time.Duration // contains filtered or unexported fields }
func (*CLI) RequireTokenOnCommand ¶
func (*CLI) SetGlobalFlags ¶
type Config ¶
type Config struct { Debug bool `json:"debug" yaml:"debug"` OutputFormat string `json:"outputFormat,omitempty" yaml:"outputFormat,omitempty" binding:"required"` DefaultProfile string `json:"defaultProfile" yaml:"defaultProfile" binding:"required"` Timeout time.Duration `json:",omitempty" yaml:",omitempty"` Profiles NamedProfiles `json:",omitempty" yaml:",omitempty"` }
type Context ¶
type Context struct { Organization string `json:"organization,omitempty" yaml:"organization,omitempty"` Project string `json:"project,omitempty" yaml:"project,omitempty"` Environment string `json:"environment,omitempty" yaml:"environment,omitempty"` ServiceComponent string `json:"serviceComponent,omitempty" yaml:"serviceComponent,omitempty"` }
type NamedProfiles ¶
type Profile ¶
type Profile struct { Host string `json:"host,omitempty" yaml:"host,omitempty"` Token string `json:"token,omitempty" yaml:"token,omitempty"` Context Context `json:"context,omitempty" yaml:"context,omitempty"` }
func GetProfile ¶
func NewProfile ¶
func NewProfile() *Profile
Click to show internal directories.
Click to hide internal directories.