resource

package
v0.13.0 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2024 License: MIT-0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action string
const Create Action = "create"
const Delete Action = "delete"
const Get Action = "get"
const Update Action = "update"

type CommonOptions

type CommonOptions struct {
	Name                   string
	ClusterFlagDisabled    bool
	ClusterFlagOptional    bool
	DeleteArgumentOptional bool
	GetArgumentRequired    bool
	KubeContext            string
	NamespaceFlag          bool

	Account           string
	Cluster           *types.Cluster
	ClusterName       string
	DryRun            bool
	Id                string
	KubernetesVersion string
	Namespace         string
	Partition         string
	Region            string
	ServiceAccount    string
}

func (*CommonOptions) AddCreateFlags

func (o *CommonOptions) AddCreateFlags(cobraCmd *cobra.Command, flags cmd.Flags) cmd.Flags

func (*CommonOptions) AddDeleteFlags

func (o *CommonOptions) AddDeleteFlags(cobraCmd *cobra.Command, flags cmd.Flags) cmd.Flags

func (*CommonOptions) AddGetFlags

func (o *CommonOptions) AddGetFlags(cobraCmd *cobra.Command, flags cmd.Flags) cmd.Flags

func (*CommonOptions) AddUpdateFlags

func (o *CommonOptions) AddUpdateFlags(cobraCmd *cobra.Command, flags cmd.Flags) cmd.Flags

func (*CommonOptions) Common

func (o *CommonOptions) Common() *CommonOptions

func (*CommonOptions) NewClusterFlag

func (o *CommonOptions) NewClusterFlag(action Action, required bool) *cmd.StringFlag

func (*CommonOptions) NewDryRunFlag

func (o *CommonOptions) NewDryRunFlag() *cmd.BoolFlag

func (*CommonOptions) NewNamespaceFlag

func (o *CommonOptions) NewNamespaceFlag(action Action) *cmd.StringFlag

func (*CommonOptions) PostCreate

func (o *CommonOptions) PostCreate() error

func (*CommonOptions) PreCreate

func (o *CommonOptions) PreCreate() error

func (*CommonOptions) PreDelete

func (o *CommonOptions) PreDelete() error

func (*CommonOptions) SetName

func (o *CommonOptions) SetName(name string)

func (*CommonOptions) TruncateUnique

func (o *CommonOptions) TruncateUnique(max int, name string) string

func (*CommonOptions) Validate

func (o *CommonOptions) Validate(args []string) error

type EmptyInit

type EmptyInit struct{}

func (*EmptyInit) Init

func (i *EmptyInit) Init()

type Getter

type Getter interface {
	Get(string, printer.Output, Options) error
	Init()
}

type Manager

type Manager interface {
	Create(options Options) error
	Delete(options Options) error
	Init()
	SetDryRun()
	Update(options Options, cmd *cobra.Command) error
}

type NotFoundByIDError added in v0.10.0

type NotFoundByIDError struct {
	Type string
	ID   string
}

func (*NotFoundByIDError) Error added in v0.10.0

func (e *NotFoundByIDError) Error() string

type NotFoundByNameError added in v0.10.0

type NotFoundByNameError struct {
	Type string
	Name string
}

func (*NotFoundByNameError) Error added in v0.10.0

func (e *NotFoundByNameError) Error() string

type NotFoundError

type NotFoundError string

func (NotFoundError) Error

func (e NotFoundError) Error() string

type Options

type Options interface {
	AddCreateFlags(*cobra.Command, cmd.Flags) cmd.Flags
	AddDeleteFlags(*cobra.Command, cmd.Flags) cmd.Flags
	AddGetFlags(*cobra.Command, cmd.Flags) cmd.Flags
	AddUpdateFlags(*cobra.Command, cmd.Flags) cmd.Flags
	Common() *CommonOptions
	PostCreate() error
	PreCreate() error
	PreDelete() error
	SetName(string)
	Validate(args []string) error
}

type Resource

type Resource struct {
	cmd.Command
	Options

	CreateFlags cmd.Flags
	DeleteFlags cmd.Flags
	GetFlags    cmd.Flags
	UpdateFlags cmd.Flags

	Getter
	Manager
}

func (*Resource) Create

func (r *Resource) Create() error

func (*Resource) Delete

func (r *Resource) Delete() error

func (*Resource) NewCreateCmd

func (r *Resource) NewCreateCmd() *cobra.Command

func (*Resource) NewDeleteCmd

func (r *Resource) NewDeleteCmd() *cobra.Command

func (*Resource) NewGetCmd

func (r *Resource) NewGetCmd() *cobra.Command

func (*Resource) NewUpdateCmd

func (r *Resource) NewUpdateCmd() *cobra.Command

func (*Resource) Update

func (r *Resource) Update(cmd *cobra.Command) error

Jump to

Keyboard shortcuts

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