module

package
v0.0.0-...-fe6dcde Latest Latest
Warning

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

Go to latest
Published: Feb 9, 2020 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Constructor

type Constructor func(*Wrap) (Module, error)

type Controller

type Controller struct {
	FactoryRepo *FactoryRepo
	Repo        *Repo
	ErrChan     chan error
}

func NewController

func NewController() (*Controller, error)

func (*Controller) GetModulesErrChan

func (c *Controller) GetModulesErrChan() chan error

func (*Controller) GetRepo

func (c *Controller) GetRepo() *Repo

func (*Controller) HandleWrapErrors

func (c *Controller) HandleWrapErrors(w *Wrap)

func (*Controller) RegisterManifest

func (c *Controller) RegisterManifest(man *Manifest) error

func (*Controller) RegisterModule

func (c *Controller) RegisterModule(wconf WrapConfigurer) error

func (*Controller) StartModules

func (c *Controller) StartModules()

func (*Controller) StopModules

func (c *Controller) StopModules() *sync.WaitGroup

type Factory

type Factory func(configuration map[string]interface{}, wrap *Wrap) (Module, error)

type FactoryRepo

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

func NewFactoryRepo

func NewFactoryRepo() (fr *FactoryRepo, err error)

NewFactoryRepo will create a new FactoryRepo

func (*FactoryRepo) GetManifest

func (fr *FactoryRepo) GetManifest(mtype string) (*Manifest, error)

func (*FactoryRepo) Register

func (fr *FactoryRepo) Register(m *Manifest) error

type Manifest

type Manifest struct {
	Name      string
	NewModule Constructor
}

func NewManifest

func NewManifest(name string, cons Constructor) *Manifest

type Module

type Module interface {
	Start()
	Stop()
	GetIsRunning() bool
	GetErrChan() chan error
	GetIsRunningChan() chan interface{}
}

type Repo

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

func NewRepo

func NewRepo() (r *Repo, err error)

New will create a new factory

func (*Repo) GetWraps

func (r *Repo) GetWraps() map[string]*Wrap

func (*Repo) Register

func (r *Repo) Register(w *Wrap) error

func (*Repo) ResolveWrap

func (r *Repo) ResolveWrap(id string) (res chan *Wrap)

type Wrap

type Wrap struct {
	*Controller
	// contains filtered or unexported fields
}

func NewWrap

func NewWrap(cont *Controller, id string, man *Manifest, mconf map[string]interface{}) (*Wrap, error)

func (*Wrap) GetController

func (w *Wrap) GetController() *Controller

func (*Wrap) GetErrChan

func (w *Wrap) GetErrChan() chan error

func (*Wrap) GetId

func (w *Wrap) GetId() string

func (*Wrap) GetIsRunningChan

func (w *Wrap) GetIsRunningChan() chan interface{}

func (*Wrap) GetModule

func (w *Wrap) GetModule() Module

func (*Wrap) MapModuleConfigurer

func (w *Wrap) MapModuleConfigurer(conf interface{}) error

func (*Wrap) Running

func (w *Wrap) Running() bool

func (*Wrap) Start

func (w *Wrap) Start()

func (*Wrap) Stop

func (w *Wrap) Stop()

type WrapConfig

type WrapConfig struct {
	Type   string
	Config map[string]interface{}
	Id     string
}

func (WrapConfig) GetConfig

func (wc WrapConfig) GetConfig() map[string]interface{}

func (WrapConfig) GetId

func (wc WrapConfig) GetId() string

func (WrapConfig) GetType

func (wc WrapConfig) GetType() string

type WrapConfigurer

type WrapConfigurer interface {
	GetType() string
	GetConfig() map[string]interface{}
	GetId() string
}

type Wrapper

type Wrapper interface {
}

Jump to

Keyboard shortcuts

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