Help us shape the future of Go! Take the 2026 Go Developer Survey

extension

package
v0.2.0 Latest Latest
Warning

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

Go to latest
Published: Jun 15, 2020 License: Apache-2.0, MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Order

func Order(m interface{}) ([]string, map[string][]string, error)

func RegisterExtension

func RegisterExtension(e ExtensionType)

Types

type ClusterResourceKey

type ClusterResourceKey interface {
	GroupKind() schema.GroupKind
	ClusterId() string
	String() string
}

ClusterResourceKey implementations are used as key and MUST therefore be value types

func NewClusterResourceKey

func NewClusterResourceKey(clusterid, group, kind string) ClusterResourceKey

type ControllerManager

type ControllerManager interface {
	GetName() string
	GetMaintainer() string
	GetNamespace() string

	GetConfig() *areacfg.Config
	GetDefaultScheme() *runtime.Scheme
	NewContext(key, value string) logger.LogContext
	GetContext() context.Context

	GetCluster(name string) cluster.Interface
	GetClusters() cluster.Clusters
	ClusterDefinitions() cluster.Definitions

	GetExtension(name string) Extension
}

type DefaultOptionDefinition

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

func (*DefaultOptionDefinition) Default

func (this *DefaultOptionDefinition) Default() interface{}

func (*DefaultOptionDefinition) Description

func (this *DefaultOptionDefinition) Description() string

func (*DefaultOptionDefinition) GetName

func (this *DefaultOptionDefinition) GetName() string

func (*DefaultOptionDefinition) Type

type DefaultOptionSourceSefinition

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

func (*DefaultOptionSourceSefinition) Create

func (*DefaultOptionSourceSefinition) GetName

func (this *DefaultOptionSourceSefinition) GetName() string

type Definition

type Definition interface {
	OrderedElem

	Names() utils.StringSet
	Size() int
	Description() string
	Validate() error
	ExtendConfig(*areacfg.Config)
	CreateExtension(cm ControllerManager) (Extension, error)
}

type ElementBase

type ElementBase interface {
	logger.LogContext

	GetType() string
	GetName() string

	GetContext() context.Context

	GetOptionSource(name string) (config.OptionSource, error)
	GetOption(name string) (*config.ArbitraryOption, error)
	GetBoolOption(name string) (bool, error)
	GetStringOption(name string) (string, error)
	GetStringArrayOption(name string) ([]string, error)
	GetIntOption(name string) (int, error)
	GetDurationOption(name string) (time.Duration, error)
}

func NewElementBase

func NewElementBase(ctx context.Context, valueType ctxutil.ValueKey, element interface{}, name string, set config.OptionGroup) ElementBase

type Environment

type Environment interface {
	logger.LogContext
	ControllerManager() ControllerManager
	Name() string
	Namespace() string
	GetContext() context.Context
	GetCluster(name string) cluster.Interface
	GetClusters() cluster.Clusters
	GetDefaultScheme() *runtime.Scheme
	ClusterDefinitions() cluster.Definitions
}

func NewDefaultEnvironment

func NewDefaultEnvironment(ctx context.Context, name string, manager ControllerManager) Environment

type Extension

type Extension interface {
	Name() string
	//Definition() Definition
	RequiredClusters() (utils.StringSet, error)
	Setup(ctx context.Context) error
	Start(ctx context.Context) error
}

type ExtensionDefinitionBase

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

func NewExtensionDefinitionBase

func NewExtensionDefinitionBase(name string, orders ...[]string) ExtensionDefinitionBase

func (*ExtensionDefinitionBase) After

func (this *ExtensionDefinitionBase) After() []string

func (*ExtensionDefinitionBase) Before

func (this *ExtensionDefinitionBase) Before() []string

func (*ExtensionDefinitionBase) Name

func (this *ExtensionDefinitionBase) Name() string

type ExtensionDefinitions

type ExtensionDefinitions map[string]Definition

type ExtensionRegistry

type ExtensionRegistry interface {
	RegisterExtension(e ExtensionType) error
	MustRegisterExtension(e ExtensionType)
	GetExtensionTypes() ExtensionTypes
	GetDefinitions() ExtensionDefinitions
}

func DefaultRegistry

func DefaultRegistry() ExtensionRegistry

func NewExtensionRegistry

func NewExtensionRegistry() ExtensionRegistry

type ExtensionType

type ExtensionType interface {
	Name() string
	Definition() Definition
}

type ExtensionTypes

type ExtensionTypes map[string]ExtensionType

type Extensions

type Extensions map[string]Extension

type OptionDefinition

type OptionDefinition interface {
	GetName() string
	Type() config.OptionType
	Default() interface{}
	Description() string
}

func NewOptionDefinition

func NewOptionDefinition(name string, gotype config.OptionType, def interface{}, desc string) OptionDefinition

type OptionDefinitions

type OptionDefinitions map[string]OptionDefinition

type OptionSourceCreator

type OptionSourceCreator func() config.OptionSource

func OptionSourceCreatorByExample

func OptionSourceCreatorByExample(proto config.OptionSource) OptionSourceCreator

type OptionSourceDefinition

type OptionSourceDefinition interface {
	GetName() string
	Create() config.OptionSource
}

func NewOptionSourceDefinition

func NewOptionSourceDefinition(name string, creator OptionSourceCreator) OptionSourceDefinition

type OptionSourceDefinitions

type OptionSourceDefinitions map[string]OptionSourceDefinition

type OrderedElem

type OrderedElem interface {
	Name() string
	Before() []string
	After() []string
}

type ResourceKey

type ResourceKey interface {
	GroupKind() schema.GroupKind
	String() string
}

ResourceKey implementations are used as key and MUST therefore be value types

func GetClusterResourceKey

func GetClusterResourceKey(objspec interface{}) ResourceKey

func GetResourceKey

func GetResourceKey(objspec interface{}) ResourceKey

func NewResourceKey

func NewResourceKey(group, kind string) ResourceKey

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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