microkernel

package
v0.0.0-...-0f2a12c Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Waiting = iota
	Running
)

Variables

View Source
var WrongStateError = errors.New("can not take the operation in the current state")

Functions

This section is empty.

Types

type Agent

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

func NewAgent

func NewAgent(sizeEvtBuf int) *Agent

func (*Agent) Destory

func (agt *Agent) Destory() error

func (*Agent) EventProcessGroutine

func (agt *Agent) EventProcessGroutine()

func (*Agent) OnEvent

func (agt *Agent) OnEvent(evt Event)

func (*Agent) RegisterCollector

func (agt *Agent) RegisterCollector(name string, collector Collector) error

func (*Agent) Start

func (agt *Agent) Start() error

func (*Agent) Stop

func (agt *Agent) Stop() error

type Collector

type Collector interface {
	Init(evtReceiver EventReceiver) error
	Start(agtCtx context.Context) error
	Stop() error
	Destory() error
}

type CollectorsError

type CollectorsError struct {
	CollectorErrors []error
}

func (CollectorsError) Error

func (ce CollectorsError) Error() string

type Event

type Event struct {
	Source  string
	Content string
}

type EventReceiver

type EventReceiver interface {
	OnEvent(evt Event)
}

Jump to

Keyboard shortcuts

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