rules

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jul 21, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Aggregate

type Aggregate struct {
	Rule      Rule
	Endpoints []Endpoint
}

type CreateRule

type CreateRule struct {
	Internal   bool
	InternalID string
	Name       string
	Expression string
}

type Endpoint

type Endpoint struct {
	ID     int64
	Name   string
	Enable bool
}

type ParsedRule

type ParsedRule struct {
	ID       int64
	Template *template.Template
}

func (ParsedRule) Match

func (pr ParsedRule) Match(env envelope.Envelope) (bool, error)

type Rule

type Rule struct {
	ID         int64 `bun:"id,pk,autoincrement"`
	Internal   bool
	InternalID string
	Name       string
	Expression string
	Enable     bool
}

func New

func New(req CreateRule) (Rule, error)

func (Rule) Parse

func (r Rule) Parse() (ParsedRule, error)

Jump to

Keyboard shortcuts

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