lib

package
v0.19.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PaginationQuit  = -1
	PaginationOther = -2

	ShowOtherMinPages = 4
)

Variables

View Source
var ErrGeneric = errors.New("oops! Something went wrong")
View Source
var ErrNotStylish = errors.New("only stylish format is supported")

Functions

func DownloadEnvironmentKubeConfig added in v0.8.2

func DownloadEnvironmentKubeConfig(kubeConfigPath, environmentID 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{}, resp *http.Response, err error) error

func GetAPI

func GetAPI() *sdk.APIClient

func GetAPIFromProfile added in v0.10.0

func GetAPIFromProfile(profile config.Profile) *sdk.APIClient

func GetContext

func GetContext() (context.Context, context.CancelFunc)

func GetContextFromProfile

func GetContextFromProfile(profile config.Profile) (context.Context, context.CancelFunc)

func GetProfile

func GetProfile() config.Profile

func OnlyStylish added in v0.11.0

func OnlyStylish(cmd *cobra.Command, args []string) error

func ProcessPagination added in v0.9.0

func ProcessPagination(cmd *cobra.Command, m ModelWithPagination) (int32, error)

func ShowCollection added in v0.9.0

func ShowCollection(cmd *cobra.Command, options Options, generator CollectionGenerator) error

Types

type CollectionGenerator added in v0.9.0

type CollectionGenerator func() (ModelWithPagination, error)

type ModelWithPagination added in v0.9.0

type ModelWithPagination interface {
	GetPage() int32

	GetItemsPerPage() int32

	GetTotalItems() int32
}

type Options added in v0.11.0

type Options interface {
	SetPage(int32)
}

Jump to

Keyboard shortcuts

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