Documentation
¶
Index ¶
- Constants
- Variables
- func CheckWithMessage(err error, message string)
- func ContextSelector(context ConfigContext) string
- func DefaultClient() *openapi_client.APIClient
- func Exit(code int)
- func GetAPIToken() string
- func GetAPIURL() string
- func GetOutputFormat() string
- func NewAPIClient(config *ClientConfig) *openapi_client.APIClient
- func NewCurrentContext(context ConfigContext) core.ConfigContext
- func SaveContexts(contexts []ConfigContext) error
- func WriteConfig() error
- type ClientConfig
- type ConfigContext
- type ConnectCommand
- type ContextsCommand
- type CurrentContext
Constants ¶
View Source
const ( DefaultAPIURL = "http://localhost:8000" ConfigKeyOutput = "output" ConfigKeyContexts = "contexts" ConfigKeyCurrentContext = "currentContext" )
Variables ¶
View Source
var OutputFormat string
View Source
var RootCmd = &cobra.Command{ Use: "superplane", Short: "SuperPlane command line interface", Long: `SuperPlane CLI - Command line interface for the SuperPlane API`, PersistentPreRun: func(cmd *cobra.Command, args []string) { if !Verbose { log.SetOutput(io.Discard) } }, }
View Source
var Verbose bool
Functions ¶
func CheckWithMessage ¶
Checks if an error is present.
If it is present, it displays the provided message and exits with status 1.
func ContextSelector ¶ added in v0.9.0
func ContextSelector(context ConfigContext) string
func DefaultClient ¶
func DefaultClient() *openapi_client.APIClient
func GetAPIToken ¶
func GetAPIToken() string
func GetOutputFormat ¶
func GetOutputFormat() string
func NewAPIClient ¶
func NewAPIClient(config *ClientConfig) *openapi_client.APIClient
func NewCurrentContext ¶ added in v0.9.0
func NewCurrentContext(context ConfigContext) core.ConfigContext
func SaveContexts ¶ added in v0.9.0
func SaveContexts(contexts []ConfigContext) error
func WriteConfig ¶ added in v0.9.0
func WriteConfig() error
Types ¶
type ClientConfig ¶
func NewClientConfig ¶
func NewClientConfig() *ClientConfig
type ConfigContext ¶ added in v0.9.0
type ConfigContext struct {
URL string `json:"url" yaml:"url"`
Organization string `json:"organization" yaml:"organization"`
APIToken string `json:"apiToken" yaml:"apiToken"`
Canvas *string `json:"canvas,omitempty" yaml:"canvas,omitempty"`
}
func GetContexts ¶ added in v0.9.0
func GetContexts() []ConfigContext
func GetCurrentContext ¶ added in v0.9.0
func GetCurrentContext() (ConfigContext, bool)
func SaveCurrentContextBySelector ¶ added in v0.9.0
func SaveCurrentContextBySelector(selector string) (*ConfigContext, error)
func UpsertContext ¶ added in v0.9.0
func UpsertContext(context ConfigContext) (ConfigContext, error)
type ConnectCommand ¶ added in v0.9.0
type ConnectCommand struct{}
func (*ConnectCommand) Execute ¶ added in v0.9.0
func (c *ConnectCommand) Execute(ctx core.CommandContext) error
type ContextsCommand ¶ added in v0.9.0
type ContextsCommand struct{}
func (*ContextsCommand) Execute ¶ added in v0.9.0
func (c *ContextsCommand) Execute(ctx core.CommandContext) error
type CurrentContext ¶ added in v0.9.0
type CurrentContext struct {
// contains filtered or unexported fields
}
* Implementation of the core.ConfigContext interface, * which uses the current context as the source for operations..
func (*CurrentContext) GetActiveCanvas ¶ added in v0.9.0
func (c *CurrentContext) GetActiveCanvas() string
func (*CurrentContext) SetActiveCanvas ¶ added in v0.9.0
func (c *CurrentContext) SetActiveCanvas(canvasID string) error
Click to show internal directories.
Click to hide internal directories.