alertcontext

package
v1.5.6-rc12 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2024 License: MIT Imports: 17 Imported by: 1 module, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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