plugin

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Jun 28, 2023 License: Apache-2.0 Imports: 29 Imported by: 10

Documentation

Index

Constants

View Source
const (
	PLUGIN_SERVER_ADDRESS = "VCLUSTER_PLUGIN_ADDRESS"
	PLUGIN_NAME           = "VCLUSTER_PLUGIN_NAME"
)

Variables

View Source
var (
	Scheme = runtime.NewScheme()
)

Functions

func Init

func InitWithOptions

func InitWithOptions(opts Options) (*synccontext.RegisterContext, error)

func MustInit

func MustInit() *synccontext.RegisterContext

func MustRegister

func MustRegister(syncer syncer.Base)

func MustStart

func MustStart()

func Register

func Register(syncer syncer.Base) error

func Start

func Start() error

Types

type ApiVersionKindType added in v0.2.0

type ApiVersionKindType struct {
	ApiVersion string
	Kind       string
	Type       string
}

type LeaderElectionHook added in v0.2.0

type LeaderElectionHook func(ctx context.Context) error

type Manager

type Manager interface {
	// Init creates a new plugin context and will block until the
	// vcluster container instance could be contacted.
	Init() (*synccontext.RegisterContext, error)

	// InitWithOptions creates a new plugin context and will block until the
	// vcluster container instance could be contacted.
	InitWithOptions(opts Options) (*synccontext.RegisterContext, error)

	// Register makes sure the syncer will be executed as soon as start
	// is run.
	Register(syncer syncer.Base) error

	// Start runs all the registered syncers and will block. It only executes
	// the functionality if the current vcluster pod is the current leader and
	// will stop if the pod will lose leader election.
	Start() error
}

type Options

type Options struct {
	// ListenAddress is optional and the address where to contact
	// the vcluster plugin server at. Defaults to localhost:10099
	ListenAddress string

	// NewClient is the func that creates the client to be used by the manager.
	// If not set this will create the default DelegatingClient that will
	// use the cache for reads and the client for writes.
	NewClient cluster.NewClientFunc

	// NewCache is the function that will create the cache to be used
	// by the manager. If not set this will use the default new cache function.
	NewCache cache.NewCacheFunc
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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