event

package
v1.2.2 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SystemKeyPrefix  = "system"
	PrivateKeyPrefix = "@private"

	SystemPipelineKey    = SystemKeyPrefix + "PipelineName"
	SystemSourceKey      = SystemKeyPrefix + "SourceName"
	SystemProductTimeKey = SystemKeyPrefix + "ProductTime"

	Body = "body"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultEvent

type DefaultEvent struct {
	H map[string]interface{} `json:"header"`
	B []byte                 `json:"body"`
	M api.Meta               `json:"meta"`
}

func NewEvent

func NewEvent(header map[string]interface{}, body []byte) *DefaultEvent

func (*DefaultEvent) Body

func (de *DefaultEvent) Body() []byte

func (*DefaultEvent) Fill

func (de *DefaultEvent) Fill(meta api.Meta, header map[string]interface{}, body []byte)

func (*DefaultEvent) Header

func (de *DefaultEvent) Header() map[string]interface{}

func (*DefaultEvent) Meta

func (de *DefaultEvent) Meta() api.Meta

func (*DefaultEvent) Release

func (de *DefaultEvent) Release()

func (*DefaultEvent) String

func (de *DefaultEvent) String() string

type DefaultMeta

type DefaultMeta struct {
	Properties map[string]interface{} `json:"properties"`
}

func NewDefaultMeta

func NewDefaultMeta() *DefaultMeta

func (*DefaultMeta) Get

func (dm *DefaultMeta) Get(key string) (value interface{}, exist bool)

func (*DefaultMeta) GetAll

func (dm *DefaultMeta) GetAll() map[string]interface{}

func (*DefaultMeta) Set

func (dm *DefaultMeta) Set(key string, value interface{})

func (*DefaultMeta) Source

func (dm *DefaultMeta) Source() string

func (*DefaultMeta) String

func (dm *DefaultMeta) String() string

type Factory

type Factory func() api.Event

type Pool

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

func NewDefaultPool

func NewDefaultPool(capacity int) *Pool

func NewPool

func NewPool(capacity int, factory Factory) *Pool

func (*Pool) Get

func (p *Pool) Get() api.Event

func (*Pool) GetN

func (p *Pool) GetN(n int) []api.Event

func (*Pool) Put

func (p *Pool) Put(event api.Event)

func (*Pool) PutAll

func (p *Pool) PutAll(events []api.Event)

Jump to

Keyboard shortcuts

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