handlers

package
v0.0.0-...-ef81ca8 Latest Latest
Warning

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

Go to latest
Published: Sep 4, 2020 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Register

func Register(name string, factory HandlerFactory)

Register registers a handler to the HandlerFactory

func UnmarshalHandlerConfig

func UnmarshalHandlerConfig(handlerConfigIn, handlerConfigOut interface{}) error

UnmarshalHandlerConfig unmarshals handler configs

Types

type Baremetal

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

Baremetal handler struct

func (*Baremetal) Run

func (c *Baremetal) Run(a *api.API, wg *sync.WaitGroup) error

Run imlements the handler interface

type Handler

type Handler interface {
	Run(a *api.API, wg *sync.WaitGroup) error
}

Handler interface for handlers to implement

func NewBaremetalHandler

func NewBaremetalHandler(ctx context.Context, handlerConfig interface{}) (Handler, error)

NewBaremetalHandler create a baremetal handler instance

type HandlerFactory

type HandlerFactory func(ctx context.Context, config interface{}) (Handler, error)

HandlerFactory function to create handlers

type Manager

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

Manager struct

func New

func New(ctx context.Context, cfg config.Options) *Manager

New creates new manager object

func (Manager) CreateHandler

func (m Manager) CreateHandler(name string, handler interface{}) (Handler, error)

CreateHandler creates handler with name and handler config interface

func (Manager) Start

func (m Manager) Start(wg *sync.WaitGroup, cfg config.Config)

Start starts the manager and its handlers

Jump to

Keyboard shortcuts

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