plugin

package
v0.0.0-...-ecc5721 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 19 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrInvalidLengthGrpc        = fmt.Errorf("proto: negative length found during unmarshaling")
	ErrIntOverflowGrpc          = fmt.Errorf("proto: integer overflow")
	ErrUnexpectedEndOfGroupGrpc = fmt.Errorf("proto: unexpected end of group")
)
View Source
var (
	ErrDuplicatePlugin = errors.New("multiple load the same plugin")
)

Functions

func Startup

func Startup(ctx context.Context, wg *sync.WaitGroup)

func Sync

func Sync(cfgs map[string]*proto.Config) (err error)

Types

type Plugin

type Plugin struct {
	Config proto.Config

	*zap.SugaredLogger
	// contains filtered or unexported fields
}

func Get

func Get(name string) (*Plugin, bool)

func GetAll

func GetAll() (plgs []*Plugin)

func Load

func Load(ctx context.Context, config proto.Config) (plg *Plugin, err error)

func (*Plugin) GetState

func (p *Plugin) GetState() (RxSpeed, TxSpeed, RxTPS, TxTPS float64)

func (*Plugin) GetWorkingDirectory

func (p *Plugin) GetWorkingDirectory() string

func (*Plugin) IsExited

func (p *Plugin) IsExited() bool

func (*Plugin) Name

func (p *Plugin) Name() string

func (*Plugin) Pid

func (p *Plugin) Pid() int

func (*Plugin) ReceiveData

func (p *Plugin) ReceiveData() (rec *proto.EncodedRecord, err error)

func (*Plugin) SendTask

func (p *Plugin) SendTask(task proto.Task) (err error)

func (*Plugin) Shutdown

func (p *Plugin) Shutdown()

func (*Plugin) Version

func (p *Plugin) Version() string

Jump to

Keyboard shortcuts

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