Documentation ¶
Overview ¶
action
engine document
expression.go
notification.go
operators
rulejson.go
Index ¶
- Constants
- type Action
- type ActionData
- type ActionJSON
- type ActionType
- type Attribute
- type CondJSON
- type Condition
- type ContextElement
- type EmailAction
- type Engine
- type ErrorNotFound
- type Expression
- type HTTPAction
- type Notif
- type NotifyContextRequest
- type Op
- type Rule
- type RuleJSON
- type SMSAction
- type UpdateAction
Constants ¶
View Source
const ( SMS = ActionType(iota + 1) EMAIL UPDATE HTTP )
QUE TODO VAYA POR HTTP CON DIFERENTES PLANTILLAS INTERNAS?????
View Source
const ( EQ = Op(iota + 1) NE LT GT )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Action ¶
type Action interface { Do(n *Notif) error Data() *ActionData }
type ActionData ¶
type ActionData struct { Type ActionType TemplateText string Parameters map[string]string // contains filtered or unexported fields }
func (*ActionData) Data ¶
func (ad *ActionData) Data() *ActionData
type ActionJSON ¶
type ActionType ¶
type ActionType int
func ParseActionType ¶
func ParseActionType(s string) (at ActionType, err error)
func (ActionType) String ¶
func (t ActionType) String() string
type CondJSON ¶
type CondJSON struct { Type string `json:"type"` Expr [3]interface{} `json:"expr"` }
type Condition ¶
type Condition struct { Op Op Exp1 Expression Exp2 Expression IsNumber bool }
type ContextElement ¶
type EmailAction ¶
type EmailAction struct {
*ActionData
}
func (*EmailAction) Do ¶
func (a *EmailAction) Do(n *Notif) (err error)
type Engine ¶
type Engine struct { Rules map[string]*Rule //Too simple, better data structure/s is/are required. Only for starting sync.RWMutex }
func (*Engine) DeleteRule ¶
func (*Engine) GetAllRules ¶
type ErrorNotFound ¶
func (*ErrorNotFound) Error ¶
func (e *ErrorNotFound) Error() string
type Expression ¶
func (Expression) ToRuleJSON ¶
func (e Expression) ToRuleJSON() interface{}
type HTTPAction ¶
type HTTPAction struct {
*ActionData
}
func (*HTTPAction) Do ¶
func (a *HTTPAction) Do(n *Notif) error
type NotifyContextRequest ¶
type NotifyContextRequest struct { SubscriptionId string Originator string ContextResponses []struct{ ContextElement ContextElement } }
type RuleJSON ¶
type RuleJSON struct { ID string `json:"id,omitempty"` And []CondJSON `json:"and"` Action ActionJSON `json:"axn"` }
func ParseRuleJSON ¶
type SMSAction ¶
type SMSAction struct {
*ActionData
}
type UpdateAction ¶
type UpdateAction struct {
*ActionData
}
func (*UpdateAction) Do ¶
func (a *UpdateAction) Do(n *Notif) error
Click to show internal directories.
Click to hide internal directories.