Documentation ¶
Index ¶
- type PublicRule
- type Rule
- func (z *Rule) DecodeMsg(dc *msgp.Reader) (err error)
- func (z *Rule) EncodeMsg(en *msgp.Writer) (err error)
- func (r *Rule) HasMatching(eventType string) bool
- func (z *Rule) MarshalMsg(b []byte) (o []byte, err error)
- func (z *Rule) Msgsize() (s int)
- func (z *Rule) UnmarshalMsg(bts []byte) (o []byte, err error)
- func (r *Rule) Validate() error
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) HasMatching ¶
HasMatching checks whether the rule has a matching event type pattern
func (*Rule) MarshalMsg ¶
MarshalMsg implements msgp.Marshaler
func (*Rule) Msgsize ¶
Msgsize returns an upper bound estimate of the number of bytes occupied by the serialized message
func (*Rule) UnmarshalMsg ¶
UnmarshalMsg implements msgp.Unmarshaler