contexts

package
v0.0.0-...-7b16d43 Latest Latest
Warning

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

Go to latest
Published: Feb 1, 2021 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const LoggerKey = "$$logger"

Variables

This section is empty.

Functions

This section is empty.

Types

type DefaultContext

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

func Background

func Background() *DefaultContext

func WithValue

func WithValue(parent *DefaultContext, key, val interface{}) *DefaultContext

func (*DefaultContext) Deadline

func (c *DefaultContext) Deadline() (deadline time.Time, ok bool)

Implement context interface

func (*DefaultContext) DeleteState

func (c *DefaultContext) DeleteState(key string) error

func (*DefaultContext) Done

func (c *DefaultContext) Done() <-chan struct{}

func (*DefaultContext) Err

func (c *DefaultContext) Err() error

func (*DefaultContext) GetContext

func (c *DefaultContext) GetContext() context.Context

Stream metas

func (*DefaultContext) GetCounter

func (c *DefaultContext) GetCounter(key string) (int, error)

func (*DefaultContext) GetInstanceId

func (c *DefaultContext) GetInstanceId() int

func (*DefaultContext) GetLogger

func (c *DefaultContext) GetLogger() api.Logger

func (*DefaultContext) GetOpId

func (c *DefaultContext) GetOpId() string

func (*DefaultContext) GetRuleId

func (c *DefaultContext) GetRuleId() string

func (*DefaultContext) GetState

func (c *DefaultContext) GetState(key string) (interface{}, error)

func (*DefaultContext) IncrCounter

func (c *DefaultContext) IncrCounter(key string, amount int) error

func (*DefaultContext) PutState

func (c *DefaultContext) PutState(key string, value interface{}) error

func (*DefaultContext) SaveState

func (c *DefaultContext) SaveState(checkpointId int64) error

func (*DefaultContext) SetError

func (c *DefaultContext) SetError(err error)

func (*DefaultContext) Snapshot

func (c *DefaultContext) Snapshot() error

func (*DefaultContext) Value

func (c *DefaultContext) Value(key interface{}) interface{}

func (*DefaultContext) WithCancel

func (c *DefaultContext) WithCancel() (api.StreamContext, context.CancelFunc)

func (*DefaultContext) WithInstance

func (c *DefaultContext) WithInstance(instanceId int) api.StreamContext

func (*DefaultContext) WithMeta

func (c *DefaultContext) WithMeta(ruleId string, opId string, store api.Store) api.StreamContext

type DefaultFuncContext

type DefaultFuncContext struct {
	api.StreamContext
	// contains filtered or unexported fields
}

func NewDefaultFuncContext

func NewDefaultFuncContext(ctx api.StreamContext, id int) *DefaultFuncContext

func (*DefaultFuncContext) DeleteState

func (c *DefaultFuncContext) DeleteState(key string) error

func (*DefaultFuncContext) GetCounter

func (c *DefaultFuncContext) GetCounter(key string) (int, error)

func (*DefaultFuncContext) GetFuncId

func (c *DefaultFuncContext) GetFuncId() int

func (*DefaultFuncContext) GetState

func (c *DefaultFuncContext) GetState(key string) (interface{}, error)

func (*DefaultFuncContext) IncrCounter

func (c *DefaultFuncContext) IncrCounter(key string, amount int) error

func (*DefaultFuncContext) PutState

func (c *DefaultFuncContext) PutState(key string, value interface{}) error

Jump to

Keyboard shortcuts

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