features

package
v0.6.0-alpha.5 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2019 License: Apache-2.0 Imports: 5 Imported by: 11

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(feature Feature)

Types

type ControllerRegister

type ControllerRegister func(ctx context.Context, rContext *types.Context) error

type Feature

type Feature interface {
	Start(ctx context.Context) error
	Stop() error
	Spec() FeatureSpec
	Name() string
}

func GetFeature

func GetFeature(name string) Feature

func GetFeatures

func GetFeatures() []Feature

type FeatureController

type FeatureController struct {
	FeatureName  string
	System       bool
	FeatureSpec  FeatureSpec
	Controllers  []ControllerRegister
	OnStop       func() error
	OnStart      func() error
	SystemStacks []*stack.SystemStack
	FixedAnswers map[string]string
	// contains filtered or unexported fields
}

func (*FeatureController) IsSystem

func (f *FeatureController) IsSystem() bool

func (*FeatureController) Name

func (f *FeatureController) Name() string

func (*FeatureController) Register

func (f *FeatureController) Register() error

func (*FeatureController) Spec

func (f *FeatureController) Spec() FeatureSpec

func (*FeatureController) Start

func (f *FeatureController) Start(ctx context.Context) error

func (*FeatureController) Stop

func (f *FeatureController) Stop() error

type FeatureSpec added in v0.6.0

type FeatureSpec struct {
	Enabled     bool              `json:"enabled,omitempty"`
	Description string            `json:"description,omitempty"`
	Questions   []riov1.Question  `json:"questions,omitempty"`
	Answers     map[string]string `json:"answers,omitempty"`
	Requires    []string          `json:"features,omitempty"`
}

Jump to

Keyboard shortcuts

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