rules

package
v0.0.0-...-fe81f67 Latest Latest
Warning

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

Go to latest
Published: Feb 4, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PublicRule

type PublicRule struct {
	Title             string   `json:"title"`
	ID                string   `json:"id"`
	ScriptID          string   `json:"script_id"`           // javascript script which is called before hookEndPoint is called.
	HookEndpoint      string   `json:"hook_endpoint"`       // endpoint which accepts a POST json objects
	HookRetry         int      `json:"hook_retry"`          // number of retries while attempting to post
	EventTypePatterns []string `json:"event_type_patterns"` // a list of event types to look for. wildcards are allowed.
	Dwell             uint64   `json:"dwell"`               // dwell duration in milliseconds for events to arrive
	DwellDeadline     uint64   `json:"dwell_deadline"`      // dwell duration threshold after which arriving events expand the dwell window
	MaxDwell          uint64   `json:"max_dwell"`           // maximum dwell duration including expansion
	Disabled          bool     `json:"disabled,omitempty"`  // if the rule is disabled
}

PublicRule is used to create, update a request and is returned as a response

func NewFromPrivate

func NewFromPrivate(r *Rule) *PublicRule

NewFromPrivate creates public rule from a private rule

func (*PublicRule) DecodeMsg

func (z *PublicRule) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*PublicRule) EncodeMsg

func (z *PublicRule) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*PublicRule) MarshalMsg

func (z *PublicRule) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*PublicRule) Msgsize

func (z *PublicRule) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*PublicRule) UnmarshalMsg

func (z *PublicRule) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

type Rule

type Rule struct {
	Title             string   `json:"title"`
	ID                string   `json:"id"`
	ScriptID          string   `json:"script_id"`           // javascript script which is called before hookEndPoint is called.
	HookEndpoint      string   `json:"hook_endpoint"`       // endpoint which accepts a POST json objects
	HookRetry         int      `json:"hook_retry"`          // number of retries while attempting to post
	EventTypePatterns []string `json:"event_type_patterns"` // a list of event types to look for. wildcards are allowed.
	Dwell             uint64   `json:"dwell"`               // dwell duration in milliseconds for events to arrive
	DwellDeadline     uint64   `json:"dwell_deadline"`      // dwell duration threshold after which arriving events expand the dwell window
	MaxDwell          uint64   `json:"max_dwell"`           // maximum dwell duration including expansion
	Regexes           []string `json:"regexes,omitempty"`   // generated regex string array from event types
	Disabled          bool     `json:"disabled,omitempty"`  // if the rule is disabled
}

Rule is the array of related service events

func NewFromPublic

func NewFromPublic(r *PublicRule) *Rule

NewFromPublic creates a rule from a public rule

func (*Rule) DecodeMsg

func (z *Rule) DecodeMsg(dc *msgp.Reader) (err error)

DecodeMsg implements msgp.Decodable

func (*Rule) EncodeMsg

func (z *Rule) EncodeMsg(en *msgp.Writer) (err error)

EncodeMsg implements msgp.Encodable

func (*Rule) HasMatching

func (r *Rule) HasMatching(eventType string) bool

HasMatching checks whether the rule has a matching event type pattern

func (*Rule) MarshalMsg

func (z *Rule) MarshalMsg(b []byte) (o []byte, err error)

MarshalMsg implements msgp.Marshaler

func (*Rule) Msgsize

func (z *Rule) Msgsize() (s int)

Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message

func (*Rule) UnmarshalMsg

func (z *Rule) UnmarshalMsg(bts []byte) (o []byte, err error)

UnmarshalMsg implements msgp.Unmarshaler

func (*Rule) Validate

func (r *Rule) Validate() error

Validate rule data

Jump to

Keyboard shortcuts

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