roles

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Dec 23, 2022 License: GPL-3.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Functions

This section is empty.

Types

type Event

type Event struct {
	Payload EventPayload
	Context context.Context
	// 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 Instance

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

type Role

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

Directories

Path Synopsis
api
dns

Jump to

Keyboard shortcuts

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