component

package
v0.6.2 Latest Latest
Warning

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

Go to latest
Published: Nov 1, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Manager

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

Manager provide methods to manage components lifecycle

func (*Manager) Register

func (m *Manager) Register(components ...interface{})

Register components in Manager and inject required dependencies Register can inject interfaces only, tag public struct fields with `inject:""`

func (*Manager) Start

func (m *Manager) Start(ctx context.Context) error

Start invokes Start method of all components which implements Starter interface

func (*Manager) Stop

func (m *Manager) Stop(ctx context.Context) error

Stop invokes Stop method of all components which implements Starter interface

type Starter

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

Starter interface provide method to start component

type Stopper

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

Stopper interface provide method to stop component

Jump to

Keyboard shortcuts

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