Documentation ¶
Index ¶
- Constants
- Variables
- func AddProfile(profile Profile, name string) error
- func DownloadEnvironmentKubeConfig(kubeConfigPath, environmentID 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{}, resp *http.Response, err error) error
- func GetAPI() *sdk.APIClient
- func GetApiFromProfile(profile Profile) *sdk.APIClient
- func GetComponent(componentID string) (*bunnysdk.ComponentItem, *http.Response, error)
- func GetComponentResources(componentID string) ([]bunnysdk.ComponentResourceItem, *http.Response, error)
- func GetComponents(environment, operationStatus string) (*bunnysdk.PaginatedComponentCollection, *http.Response, error)
- func GetContext() (context.Context, context.CancelFunc)
- func GetContextFromProfile(profile Profile) (context.Context, context.CancelFunc)
- func GetEnvironment(environmentID string) (*bunnysdk.EnvironmentItem, *http.Response, error)
- func GetEnvironments(projectID string) (*bunnysdk.PaginatedEnvironmentCollection, *http.Response, error)
- func GetOrganization(organizationID string) (*bunnysdk.OrganizationItem, *http.Response, error)
- func GetOrganizations() (*bunnysdk.PaginatedOrganizationCollection, *http.Response, error)
- func GetProject(projectID string) (*bunnysdk.ProjectItem, *http.Response, error)
- func GetProjects(organization string) (*bunnysdk.PaginatedProjectCollection, *http.Response, error)
- func LoadViperConfigIntoContext()
- func MakeDefaultContext()
- func ProcessPagination(cmd *cobra.Command, m ModelWithPagination) (int32, error)
- func RemoveProfile(name string) error
- func SetDefaultProfile(name string) error
- func ShowCollection(cmd *cobra.Command, page int32, generator CollectionGenerator) error
- type CLI
- type CollectionGenerator
- type Config
- type Context
- type ModelWithPagination
- type NamedProfiles
- type Profile
Constants ¶
View Source
const ( PAGINATION_QUIT = -1 PAGINATION_OTHER = -2 )
Variables ¶
View Source
var CLIContext = CLI{}
Functions ¶
func AddProfile ¶
func DownloadEnvironmentKubeConfig ¶ added in v0.8.2
func FormatCommandData ¶
func FormatRequestResult ¶
func GetApiFromProfile ¶
func GetComponent ¶ added in v0.7.0
func GetComponentResources ¶ added in v0.7.0
func GetComponents ¶ added in v0.7.0
func GetContext ¶
func GetContext() (context.Context, context.CancelFunc)
func GetContextFromProfile ¶
func GetContextFromProfile(profile Profile) (context.Context, context.CancelFunc)
func GetEnvironment ¶ added in v0.7.0
func GetEnvironments ¶ added in v0.7.0
func GetOrganization ¶ added in v0.7.0
func GetOrganizations ¶ added in v0.7.0
func GetOrganizations() (*bunnysdk.PaginatedOrganizationCollection, *http.Response, error)
func GetProject ¶ added in v0.7.0
func GetProjects ¶ added in v0.7.0
func LoadViperConfigIntoContext ¶
func LoadViperConfigIntoContext()
func MakeDefaultContext ¶
func MakeDefaultContext()
func ProcessPagination ¶ added in v0.9.0
func ProcessPagination(cmd *cobra.Command, m ModelWithPagination) (int32, error)
func RemoveProfile ¶
func SetDefaultProfile ¶
func ShowCollection ¶ added in v0.9.0
func ShowCollection(cmd *cobra.Command, page int32, generator CollectionGenerator) error
Types ¶
type CLI ¶
type CLI struct { Debug 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 CollectionGenerator ¶ added in v0.9.0
type CollectionGenerator func(page int32) (ModelWithPagination, *http.Response, error)
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 ModelWithPagination ¶ added in v0.9.0
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
Source Files ¶
Click to show internal directories.
Click to hide internal directories.