lib

package
v0.7.0-RC4 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 17, 2022 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const ENV_PREFIX = "bunnyshell"

Variables

View Source
var CLIContext = CLI{}

Functions

func AddProfile

func AddProfile(profile Profile, name string) error

func FormatCommandData

func FormatCommandData(cmd *cobra.Command, data interface{}) error

func FormatCommandError

func FormatCommandError(cmd *cobra.Command, err error) error

func FormatRequestResult

func FormatRequestResult(cmd *cobra.Command, data interface{}, r *http.Response, err error) error

func GetAPI

func GetAPI() *sdk.APIClient

func GetApiFromProfile

func GetApiFromProfile(profile Profile) *sdk.APIClient

func GetComponent added in v0.7.0

func GetComponent(componentId string) (*bunnysdk.ComponentItem, *http.Response, error)

func GetComponentResources added in v0.7.0

func GetComponentResources(componentId string) ([]bunnysdk.ComponentResourceItem, *http.Response, error)

func GetComponents added in v0.7.0

func GetComponents(environment, operationStatus string) (*bunnysdk.PaginatedComponentCollection, *http.Response, error)

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 GetEnvironment(environmentID string) (*bunnysdk.EnvironmentItem, *http.Response, error)

func GetEnvironments added in v0.7.0

func GetEnvironments(projectID string) (*bunnysdk.PaginatedEnvironmentCollection, *http.Response, error)

func GetOrganization added in v0.7.0

func GetOrganization(organizationID string) (*bunnysdk.OrganizationItem, *http.Response, error)

func GetOrganizations added in v0.7.0

func GetProject added in v0.7.0

func GetProject(projectID string) (*bunnysdk.ProjectItem, *http.Response, error)

func GetProjects added in v0.7.0

func GetProjects(organization string) (*bunnysdk.PaginatedProjectCollection, *http.Response, error)

func LoadViperConfigIntoContext

func LoadViperConfigIntoContext()

func MakeDefaultContext

func MakeDefaultContext()

func RemoveProfile

func RemoveProfile(name string) error

func SetDefaultProfile

func SetDefaultProfile(name string) error

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) Load

func (c *CLI) Load(config Config) error

func (*CLI) RequireTokenOnCommand

func (c *CLI) RequireTokenOnCommand(cmd *cobra.Command)

func (*CLI) SetGlobalFlags

func (c *CLI) SetGlobalFlags(cmd *cobra.Command)

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"`
}

func GetConfig

func GetConfig() (*Config, error)

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 NamedProfiles map[string]Profile

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 GetProfile(name string) (*Profile, error)

func NewProfile

func NewProfile() *Profile

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL