cli

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2026 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConfigKeyAPIURL   = "api_url"
	ConfigKeyAPIToken = "api_token"
	ConfigKeyFormat   = "output_format"
)

Configuration keys

View Source
const (
	APIVersion = "v1"
)
View Source
const (
	DefaultAPIURL = "http://localhost:8000"
)

Variables

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 Check

func Check(err error)

Checks if an error is present.

If it is present, it displays the error and exits with status 1.

If you want to display a custom message use CheckWithMessage.

func CheckWithMessage

func CheckWithMessage(err error, message string)

Checks if an error is present.

If it is present, it displays the provided message and exits with status 1.

func DefaultClient

func DefaultClient() *openapi_client.APIClient

func Exit

func Exit(code int)

func Fail

func Fail(message string)

func GetAPIToken

func GetAPIToken() string

func GetAPIURL

func GetAPIURL() string

func GetOutputFormat

func GetOutputFormat() string

func NewAPIClient

func NewAPIClient(config *ClientConfig) *openapi_client.APIClient

func ParseYamlResourceHeaders

func ParseYamlResourceHeaders(raw []byte) (string, string, error)

returns tuple (apiVersion, kind, error)

Types

type ClientConfig

type ClientConfig struct {
	BaseURL    string
	APIToken   string
	HTTPClient *http.Client
}

func NewClientConfig

func NewClientConfig() *ClientConfig

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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