runtime

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: May 9, 2023 License: Apache-2.0 Imports: 19 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetInClusterOrKubeConfig

func GetInClusterOrKubeConfig(kubeconfig string) (config *rest.Config, rerr error)

try list authprovider kubeconfig serviceAccount

func GetKubeConfigFromEnv

func GetKubeConfigFromEnv() string

Types

type Config

type Config struct {
	KubeConfigFile     string
	KubeRestConfig     *rest.Config
	KubeFactoryClient  kubernetes.Interface
	VanusFactoryClient clientset.Interface
}

Config is the controller conf

func NewConfig

func NewConfig() (*Config, error)

ParseFlags parses cmd args then init kubeclient and conf TODO: validate configuration

type ConnectorEventHandler

type ConnectorEventHandler interface {
	OnAdd(connectorID, config string) error
	OnUpdate(connectorID, config string) error
	OnDelete(connectorID string) error
}

type ConnectorEventHandlerFuncs

type ConnectorEventHandlerFuncs struct {
	AddFunc    func(connectorID, config string) error
	UpdateFunc func(connectorID, config string) error
	DeleteFunc func(connectorID string) error
}

func (ConnectorEventHandlerFuncs) OnAdd

func (r ConnectorEventHandlerFuncs) OnAdd(connectorID, config string) error

OnAdd calls AddFunc if it's not nil.

func (ConnectorEventHandlerFuncs) OnDelete

func (r ConnectorEventHandlerFuncs) OnDelete(connectorID string) error

OnDelete calls DeleteFunc if it's not nil.

func (ConnectorEventHandlerFuncs) OnUpdate

func (r ConnectorEventHandlerFuncs) OnUpdate(connectorID, config string) error

OnUpdate calls UpdateFunc if it's not nil.

type ConnectorOption

type ConnectorOption func(opt *connectorOptions)

func WithEventHandler

func WithEventHandler(handler ConnectorEventHandler) ConnectorOption

func WithFilter

func WithFilter(filter string) ConnectorOption

type FilterConnector

type FilterConnector struct {
	Kind string
	Type string
}

type Runtime

type Runtime interface {
	Run(ctx context.Context)
	Lister() vanuslister.ConnectorLister
}

func New

func New(opts ...ConnectorOption) (Runtime, error)

New creates a new connect runtime

Jump to

Keyboard shortcuts

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