Documentation ¶
Index ¶
- Constants
- Variables
- func Apply(strategies map[Type][]Strategy)
- func ClearVariables(phones []string, template t.Name)
- func FindVariables(phone string, template t.Name) (map[string]string, bool)
- func ProcessChain(phoneArray []string, template t.Name) []string
- func StoreVariables(phones []string, template t.Name, variables map[string]string)
- type Chain
- type Exp
- type Filter
- type PostponeFilter
- type PostponeStrategy
- type RateLimitFilter
- type RateLimitStrategy
- type Strategy
- type Type
- type UnsubscribeFilter
Constants ¶
View Source
const ( DateLayout = "2006-01-02" TimeLayout = "15:04:05" DateAndTimeLayout = "2006-01-02 15:04:05" )
View Source
const (
Check = `` /* 145-byte string literal not displayed */
)
Variables ¶
View Source
var ErrResolveFailed = errors.New("failed to resolve expression")
Functions ¶
func ClearVariables ¶
Types ¶
type PostponeFilter ¶
type PostponeFilter struct { Type Type `bson:"type" json:"type"` Strategies map[t.Name]PostponeStrategy `bson:"strategies" json:"strategies"` }
func NewPostponeFilter ¶
func NewPostponeFilter() *PostponeFilter
func (*PostponeFilter) Apply ¶
func (f *PostponeFilter) Apply(strategies []Strategy)
func (*PostponeFilter) Resolve ¶
func (f *PostponeFilter) Resolve(expression string) (interface{}, error)
func (*PostponeFilter) WhichType ¶
func (f *PostponeFilter) WhichType() Type
type RateLimitFilter ¶
type RateLimitFilter struct { Type Type `bson:"type" json:"type"` Strategies map[t.Name]RateLimitStrategy `bson:"strategies" json:"strategies"` }
func NewRateLimitFilter ¶
func NewRateLimitFilter() *RateLimitFilter
func (*RateLimitFilter) Apply ¶
func (f *RateLimitFilter) Apply(strategies []Strategy)
func (*RateLimitFilter) Resolve ¶
func (f *RateLimitFilter) Resolve(expression string) (interface{}, error)
func (*RateLimitFilter) WhichType ¶
func (f *RateLimitFilter) WhichType() Type
type RateLimitStrategy ¶
type RateLimitStrategy struct { Duration time.Duration `json:"duration"` Count uint32 `json:"count"` }
for further extention, RateLimitStrategy can hold bare script
type UnsubscribeFilter ¶
type UnsubscribeFilter struct {
Type Type `bson:"type" json:"type"`
}
func NewUnsubscribeFilter ¶
func NewUnsubscribeFilter() *UnsubscribeFilter
func (*UnsubscribeFilter) Allow ¶
func (f *UnsubscribeFilter) Allow(phone string, template t.Name) bool
func (*UnsubscribeFilter) Apply ¶
func (f *UnsubscribeFilter) Apply(strategies []Strategy)
func (*UnsubscribeFilter) Resolve ¶
func (f *UnsubscribeFilter) Resolve(expression string) (interface{}, error)
func (*UnsubscribeFilter) WhichType ¶
func (f *UnsubscribeFilter) WhichType() Type
Click to show internal directories.
Click to hide internal directories.