manager

package
v0.0.0-...-683a7b2 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ConfigPrefix = "manager"

ConfigPrefix define configuration prefix

Functions

This section is empty.

Types

type Component

type Component interface {
	Start(ctx context.Context) error
	Stop() error
}

Component represents a component

type Manager

type Manager interface {
	Options() *Options

	Run() error
	Stop() error
}

Manager represents the manager interface

func New

func New(opts ...Option) (Manager, error)

New creates a new manager instance

type Option

type Option func(*Options)

Option func

func AddComponent

func AddComponent(v Component) Option

AddComponent option

func Context

func Context(v context.Context) Option

Context option

func Logger

func Logger(v logger.Logger) Option

Logger option

type Options

type Options struct {
	Logger  logger.Logger   `ignored:"true" json:"-"`
	Context context.Context `ignored:"true" json:"-"`

	Components []Component `ignored:"true" json:"-"`
}

Options represents the list of options

Jump to

Keyboard shortcuts

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