uik

package
v0.33.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ActionError

type ActionError struct {
	Index int
	Err   error
}

ActionError is an error that occurred while processing an action.

func (*ActionError) Error

func (a *ActionError) Error() string

type CompiledAction

type CompiledAction struct {
	gadb.UIKActionV1
	Params map[string]*vm.Program
}

CompiledAction is a compiled version of a UIKActionV1.

func NewCompiledAction

func NewCompiledAction(a gadb.UIKActionV1) (*CompiledAction, error)

NewCompiledAction will compile a UIKActionV1 into a CompiledAction.

func (*CompiledAction) Run

func (a *CompiledAction) Run(vm *vm.VM, env any) (result gadb.UIKActionV1, err error)

Run will execute the compiled action against the provided VM and environment.

type CompiledConfig

type CompiledConfig struct {
	gadb.UIKConfigV1
	CompiledRules  []CompiledRule
	DefaultActions []CompiledAction
}

CompiledConfig is a compiled version of a UIKConfigV1.

func NewCompiledConfig

func NewCompiledConfig(cfg gadb.UIKConfigV1) (*CompiledConfig, error)

NewCompiledConfig will compile a UIKConfigV1 into a CompiledConfig.

func (*CompiledConfig) Run

func (c *CompiledConfig) Run(vm *vm.VM, env any) (actions []gadb.UIKActionV1, err error)

Run will execute the compiled config against the provided VM and environment.

type CompiledRule

type CompiledRule struct {
	gadb.UIKRuleV1
	Condition *vm.Program
	Actions   []CompiledAction
}

CompiledRule is a compiled version of a UIKRuleV1.

func NewCompiledRule

func NewCompiledRule(r gadb.UIKRuleV1) (*CompiledRule, error)

NewCompiledRule will compile a UIKRuleV1 into a CompiledRule.

func (*CompiledRule) Run

func (r *CompiledRule) Run(vm *vm.VM, env any) (actions []gadb.UIKActionV1, matched bool, err error)

Run will execute the compiled rule against the provided VM and environment.

type ConditionError

type ConditionError struct {
	Err error
}

ConditionError is an error that occurred while processing a condition.

func (*ConditionError) Error

func (c *ConditionError) Error() string

type Handler

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

func NewHandler

func NewHandler(db TxAble, intStore *integrationkey.Store, aStore *alert.Store, r *river.Client[pgx.Tx]) *Handler

func (*Handler) ServeHTTP

func (h *Handler) ServeHTTP(w http.ResponseWriter, req *http.Request)

type ParamError

type ParamError struct {
	ParamID string
	Err     error
}

ParamError is an error that occurred while processing a param.

func (*ParamError) Error

func (p *ParamError) Error() string

type RuleError

type RuleError struct {
	Index int
	Name  string
	Err   error
}

RuleError is an error that occurred while processing a rule.

func (*RuleError) Error

func (r *RuleError) Error() string

type TxAble

type TxAble interface {
	gadb.DBTX
	BeginTx(ctx context.Context, opts *sql.TxOptions) (*sql.Tx, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳