component

package
v0.0.0-...-608e6a2 Latest Latest
Warning

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

Go to latest
Published: Aug 24, 2022 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewComponent

func NewComponent(c *Config) error

func RegisterComponent

func RegisterComponent(s *service.Service, comp Component)

func RegisterNewComponentFunc

func RegisterNewComponentFunc(s *service.Service, newFunc NewComponentFunc)

func StopComponents

func StopComponents() error

Types

type Component

type Component interface {
	lifecycle.LifeCycle

	Route(topic string, payload *message.Payload) (interface{}, error)
}

func GetComponent

func GetComponent(s *service.Service) Component

type Config

type Config struct {
	Service *service.Service `yaml:"service" json:"service"`
	Options config.Options   `yaml:"options" json:"options"`

	Caller clients.Caller `yaml:"-" json:"-"`
	Logger logger.Logger  `yaml:"-" json:"-"`
}

type Configs

type Configs []*Config

type Manager

type Manager interface {
	RegisterNewComponentFunc(s *service.Service, newFunc NewComponentFunc) error
	RegisterComponent(s *service.Service, component Component) error
	NewComponent(c *Config) error
	GetComponent(*service.Service) Component
	StopComponents() error
}

type NewComponentFunc

type NewComponentFunc func(*Config) (Component, error)

Jump to

Keyboard shortcuts

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