depends

package
v0.0.0-...-b556d9d Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2024 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DataContainer

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

func NewDataContainer

func NewDataContainer() *DataContainer

func (*DataContainer) Get

func (dc *DataContainer) Get(key string) (value interface{})

func (*DataContainer) Set

func (dc *DataContainer) Set(key string, value interface{})

type Depends

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

func NewDepends

func NewDepends(timeout time.Duration) *Depends

func (*Depends) AddDepend

func (me *Depends) AddDepend(service IService, serviceDepends []IService) error

添加依赖关系

func (*Depends) Execute

func (me *Depends) Execute(ctx context.Context)

执行

func (*Depends) Register

func (me *Depends) Register(service IService) error

注册服务

type IService

type IService interface {
	Name() string
	Run(ctx context.Context, dc *DataContainer) error
	Decode(receiver interface{}) error
}

type ServiceA

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

func NewServiceA

func NewServiceA() *ServiceA

func (*ServiceA) Decode

func (s *ServiceA) Decode(receiver interface{}) error

func (*ServiceA) Name

func (s *ServiceA) Name() string

func (*ServiceA) Run

func (s *ServiceA) Run(ctx context.Context, dc *DataContainer) error

type ServiceAData

type ServiceAData struct {
	Message string
	Query   string
}

type ServiceB

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

func NewServiceB

func NewServiceB() *ServiceB

func (*ServiceB) Decode

func (s *ServiceB) Decode(receiver interface{}) error

func (*ServiceB) Name

func (s *ServiceB) Name() string

func (*ServiceB) Run

func (s *ServiceB) Run(ctx context.Context, dc *DataContainer) error

type ServiceBData

type ServiceBData struct {
	Message string
	Query   string
}

type ServiceC

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

func NewServiceC

func NewServiceC() *ServiceC

func (*ServiceC) Decode

func (s *ServiceC) Decode(receiver interface{}) error

func (*ServiceC) Name

func (s *ServiceC) Name() string

func (*ServiceC) Run

func (s *ServiceC) Run(ctx context.Context, dc *DataContainer) error

type ServiceCData

type ServiceCData struct {
	Message string
	Query   string
}

Jump to

Keyboard shortcuts

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