k8sutil

package
v0.7.2-nightly.d18b283 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 2021 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNotImplemented = errors.New("k8sutil: The method is not implemented")

ErrNotImplemented this is returned when a CB method is not supported yet

Functions

func Configure

func Configure(ctx context.Context, file string, namespace string) error

Configure applies file to k8s cluster and ensure that thr resource is configured

func Create

func Create(ctx context.Context, file string, namespace string) error

Create applies file to k8s cluster and ensure that thr resource is created

func CreateNS

func CreateNS(ctx context.Context, namespace string) error

func Delete

func Delete(ctx context.Context, file string, namespace string) error

Delete applies file to k8s cluster and ensure that thr resource is deleted

func DeleteNS

func DeleteNS(ctx context.Context, namespace string) error

func Do

func Do(r *http.Request) (*http.Response, error)

func Init

func Init(ns, env string) (func() error, error)

Types

type CB

type CB struct {
	InitFN      func(ns string) (func() error, error)
	CreateFn    func(ctx context.Context, file string, namespace string) error
	DeleteFn    func(ctx context.Context, file string, namespace string) error
	ConfigureFn func(ctx context.Context, file string, namespace string) error
	CreateNSFn  func(ctx context.Context, ns string) error
	DeleteNSFn  func(ctx context.Context, ns string) error
}

CB is a helper struct satisfying CMD interface. Use the fields to provide callbacks for respective CMD method call.

func (CB) Configure

func (fn CB) Configure(ctx context.Context, file string, namespace string) error

func (CB) Create

func (fn CB) Create(ctx context.Context, file string, namespace string) error

func (CB) CreateNS

func (fn CB) CreateNS(ctx context.Context, namespace string) error

func (CB) Delete

func (fn CB) Delete(ctx context.Context, file string, namespace string) error

func (CB) DeleteNS

func (fn CB) DeleteNS(ctx context.Context, namespace string) error

func (CB) Init

func (fn CB) Init(ns string) (func() error, error)

type CMD

type CMD interface {
	Init(ns string) (cancel func() error, err error)
	CreateNS(ctx context.Context, ns string) error
	DeleteNS(ctx context.Context, ns string) error
	Create(ctx context.Context, file string, namespace string) error
	Configure(ctx context.Context, file string, namespace string) error
	Delete(ctx context.Context, file string, namespace string) error
}

type OpExpect

type OpExpect uint

OpExpect expected outcome from k8s operation

const (
	Created OpExpect = iota + 1
	Configured
	Deleted
)

expected k8s op outcome for resources

func (OpExpect) String

func (o OpExpect) String() string

type TykAPI

type TykAPI struct {
	Namespace, Pod, Container string
}

func (TykAPI) Do

func (t TykAPI) Do(r *http.Request) (*http.Response, error)

Jump to

Keyboard shortcuts

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