alertcontext

package
v1.6.1 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoContextData = errors.New("no context to send")

Functions

func EventToContext

func EventToContext(events []types.Event) (models.Meta, []error)

func LoadConsoleContext added in v1.6.0

func LoadConsoleContext(c *csconfig.Config, hub *cwhub.Hub) error

LoadConsoleContext loads the context from the hub (if provided) and the file console_context_path.

func NewAlertContext

func NewAlertContext(contextToSend map[string][]string, valueLength int) error

func ValidateContextExpr

func ValidateContextExpr(key string, expressions []string) error

Types

type Context

type Context struct {
	ContextToSend         map[string][]string
	ContextValueLen       int
	ContextToSendCompiled map[string][]*vm.Program
	Log                   *log.Logger
}

type HubItemWrapper added in v1.6.0

type HubItemWrapper struct {
	Context map[string][]string `yaml:"context"`
}

HubItemWrapper is a wrapper around a hub item to unmarshal only the context part because there are other fields like name etc.

Jump to

Keyboard shortcuts

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