component

package
v0.0.0-...-9fc37f3 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2022 License: GPL-3.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 Component

type Component interface {
	service.LifeCycle

	Route(msg message.Message) (interface{}, error)
}

Component Component

type Describe

type Describe struct {
	Name         string
	RegisterFunc string
	Component    Component
	Started      bool
}

Describe description of component

type Handler

type Handler func(message.Message) (interface{}, error)

Handler handles the message function

type Manager

type Manager interface {
	RegisterComponentFunc(service *service.Service, fn NewComponentFunc) error
	RegisterComponent(s *service.Service, cpt Component) error
	ListComponents() []Describe
	NewComponent(s *service.Service, opts ...Option) (Component, error)
	GetComponent(*service.Service) (Component, error)
}

Manager local router

type Middleware

type Middleware func(Handler) Handler

Middleware middlewares for next handler

type NewComponentFunc

type NewComponentFunc func(opts ...Option) (Component, error)

NewComponentFunc 服务对象生成函数申明

type Option

type Option func(*Options)

Option 处理参数函数

func Caller

func Caller(c message.Caller) Option

Caller remote service

func Config

func Config(c config.Config) Option

Config 注入配置

func Logger

func Logger(l logger.Logger) Option

Logger 日志记录

type Options

type Options struct {
	Logger logger.Logger
	Config config.Config
	Caller message.Caller
}

Options 参数对象

Jump to

Keyboard shortcuts

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