context

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Apr 8, 2023 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Dummy = &dummyContext{
	namespace: "test",
}

Dummy is the default dummy context.

View Source
var Fake = &FakeContext{
	namespace: "test",
}

Functions

This section is empty.

Types

type BasicOptions

type BasicOptions struct {
	Name      string
	Namespace string
	genericclioptions.IOStreams
}

func NewBasicOptions

func NewBasicOptions(streams genericclioptions.IOStreams) *BasicOptions

func (*BasicOptions) Complete

func (o *BasicOptions) Complete(ctx Context, cmd *cobra.Command, args []string) error

Complete the fields of the basic option.

func (*BasicOptions) GetRWInstance

func (o *BasicOptions) GetRWInstance(ctx context.Context, rwCtx Context) (*v1alpha1.RisingWave, error)

func (*BasicOptions) Validate

func (o *BasicOptions) Validate(ctx Context, cmd *cobra.Command, args []string) error

Validate for simple commands, we don't need validation.

type Context

type Context interface {
	Scheme() *runtime.Scheme

	Namespace() string

	Builder() *resource.Builder

	Client() client.Client

	Applier() *helper.Applier
}

type FakeContext

type FakeContext struct {
	// contains filtered or unexported fields
}

func (*FakeContext) Applier

func (f *FakeContext) Applier() *helper.Applier

func (*FakeContext) Builder

func (f *FakeContext) Builder() *resource.Builder

func (*FakeContext) Client

func (f *FakeContext) Client() client.Client

func (*FakeContext) Namespace

func (f *FakeContext) Namespace() string

func (*FakeContext) Scheme

func (f *FakeContext) Scheme() *runtime.Scheme

func (*FakeContext) SetClient

func (f *FakeContext) SetClient(c client.Client)

func (*FakeContext) SetNamespace

func (f *FakeContext) SetNamespace(ns string)

type Options

type Options interface {
	BasicOptions
	Complete() error
	Validate() error
	Run() error
}

type RWContext

type RWContext struct {
	*genericclioptions.ConfigFlags
	// contains filtered or unexported fields
}

RWContext wraps the configuration and credential for risingwave cluster accessing.

func (*RWContext) Applier

func (o *RWContext) Applier() *helper.Applier

func (*RWContext) Builder

func (o *RWContext) Builder() *resource.Builder

func (*RWContext) Client

func (o *RWContext) Client() client.Client

func (*RWContext) Namespace

func (o *RWContext) Namespace() string

func (*RWContext) Scheme

func (o *RWContext) Scheme() *runtime.Scheme

Jump to

Keyboard shortcuts

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