roles

package
v0.18.2 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrRoleNotConfigured = errors.New("role: Not configured")

Functions

func Register added in v0.17.1

func Register(name string, constructor RoleConstructor)

Types

type Event

type Event struct {
	Context context.Context

	Payload EventPayload
	// contains filtered or unexported fields
}

func NewEvent

func NewEvent(ctx context.Context, data map[string]interface{}) *Event

func (*Event) String

func (ev *Event) String() string

func (*Event) WithTopic

func (ev *Event) WithTopic(topic string) *Event

type EventHandler

type EventHandler func(ev *Event)

type EventPayload

type EventPayload struct {
	Data                 map[string]interface{}
	RelatedObjectKey     *storage.Key
	RelatedObjectOptions []clientv3.OpOption
}

type HookOptions added in v0.10.0

type HookOptions struct {
	Method string
	Source string
	Env    map[string]interface{}
}

type Instance

type Instance interface {
	KV() *storage.Client
	Log() *zap.Logger
	DispatchEvent(topic string, ev *Event)
	AddEventListener(topic string, handler EventHandler)
	Context() context.Context
	ExecuteHook(HookOptions, ...interface{})
	Migrator() RoleMigrator
}

type MigratableRole added in v0.16.0

type MigratableRole interface {
	Role
	RegisterMigrations()
}

type Migration added in v0.16.0

type Migration interface {
	Check(clusterVersion *semver.Version, ctx context.Context) (bool, error)
	Hook(context.Context) (*storage.Client, error)
	Cleanup(context.Context) error
	Name() string
}

type Role

type Role interface {
	Start(ctx context.Context, config []byte) error
	Stop()
}

type RoleConstructor added in v0.17.1

type RoleConstructor func(Instance) Role

func GetRole added in v0.17.1

func GetRole(name string) RoleConstructor

type RoleMigrator added in v0.16.0

type RoleMigrator interface {
	AddMigration(Migration)
	Run(ctx context.Context) (*storage.Client, error)
}

Directories

Path Synopsis
api
oui
Updated version of https://github.com/dutchcoders/go-ouitools Package go-oui provides functions to work with MAC and OUI's
Updated version of https://github.com/dutchcoders/go-ouitools Package go-oui provides functions to work with MAC and OUI's
dns

Jump to

Keyboard shortcuts

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