clicontext

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 12, 2019 License: Apache-2.0 Imports: 45 Imported by: 34

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoConfig = errors.New("Can not find rio info resource inside your cluster. Have you installed Rio?(run `rio install --help`)")

Functions

func DefaultAction

func DefaultAction(action interface{}) interface{}

func Wrap

func Wrap(f func(*CLIContext) error) func(context2 *cli.Context) error

Types

type CLIContext

type CLIContext struct {
	*Config
	Ctx context.Context
	CLI *cli.Context
}

func Lookup

func Lookup(data map[string]interface{}) *CLIContext

func (*CLIContext) ByID

func (c *CLIContext) ByID(namespace, name string, typeName string) (types.Resource, error)

func (*CLIContext) Create

func (c *CLIContext) Create(obj runtime.Object) (err error)

func (*CLIContext) DeleteResource

func (c *CLIContext) DeleteResource(r types.Resource) (err error)

func (*CLIContext) Format

func (c *CLIContext) Format() string

func (*CLIContext) GetDefaultNamespace

func (c *CLIContext) GetDefaultNamespace() string

func (*CLIContext) GetSetNamespace

func (c *CLIContext) GetSetNamespace() string

func (*CLIContext) GetSystemNamespace

func (c *CLIContext) GetSystemNamespace() string

func (*CLIContext) IDs

func (c *CLIContext) IDs() bool

func (*CLIContext) List

func (c *CLIContext) List(typeName string) (ret []runtime.Object, err error)

func (*CLIContext) MultiCreate

func (c *CLIContext) MultiCreate(objs ...runtime.Object) error

func (*CLIContext) Quiet

func (c *CLIContext) Quiet() bool

func (*CLIContext) Store

func (c *CLIContext) Store(data map[string]interface{})

func (*CLIContext) Update

func (c *CLIContext) Update(name, typeName string, updater func(obj runtime.Object) error) error

func (*CLIContext) UpdateObject

func (c *CLIContext) UpdateObject(obj runtime.Object) (err error)

func (*CLIContext) UpdateResource

func (c *CLIContext) UpdateResource(r types.Resource, updater func(obj runtime.Object) error) error

func (*CLIContext) Writer

func (c *CLIContext) Writer() io.Writer

type Config

type Config struct {
	ShowSystem       bool
	SystemNamespace  string
	DefaultNamespace string
	Kubeconfig       string
	Debug            bool
	Wait             bool
	WaitTimeout      int
	WaitState        string

	Apply      apply.Apply
	RestConfig *rest.Config
	K8s        *kubernetes.Clientset

	Core      corev1.CoreV1Interface
	Build     tektonv1alpha1.TektonV1alpha1Interface
	Rio       riov1.RioV1Interface
	Project   projectv1.AdminV1Interface
	Autoscale autoscalev1.AutoscaleV1Interface

	NoPrompt bool
}

func (*Config) Domain

func (c *Config) Domain() (string, error)

func (*Config) Kubectl

func (c *Config) Kubectl(namespace, command string, args ...string) error

func (*Config) Validate

func (c *Config) Validate() error

Jump to

Keyboard shortcuts

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