Documentation
¶
Index ¶
- Constants
- Variables
- type RuleRepo
- func NewDiskRuleRepo(root string) RuleRepo
- func NewInMemoryRuleRepo() RuleRepo
- func NewJetstreamRuleRepo(natsURL string) (RuleRepo, error)
- func NewPostgresRuleRepo(connectionString string) (RuleRepo, error)
- func NewRedisRuleRepo(redisStoreURL string) (RuleRepo, error)
- func NewRulesRepo(repoBackendType, repoBackendURL string) (RuleRepo, error)
Constants ¶
View Source
const ( STREAM_NAME = "rules" RULE_SUBJECT = "rule.>" )
View Source
const ( RULE_PREFIX = "rules" // => rules:id {..} FORMULA_PREFIX = "formulas" // => formulas:id {..} CAPSULE_PREFIX = "capsules" // => capsules:id {..} )
Variables ¶
View Source
var STREAM_SUBJECTS = []string{ RULE_SUBJECT, }
Functions ¶
This section is empty.
Types ¶
type RuleRepo ¶
type RuleRepo interface {
Name() string
Get(id string) (*rules.Rule, error)
Save(rule *rules.Rule) error
Expire(id string, ttl int64) error
Remove(id string) error
RemoveAll() error
Each(skip int, limit int, fn func(rule *rules.Rule)) error
Count() int
Active() int
}
func NewDiskRuleRepo ¶
func NewInMemoryRuleRepo ¶
func NewInMemoryRuleRepo() RuleRepo
func NewJetstreamRuleRepo ¶
func NewPostgresRuleRepo ¶
func NewRedisRuleRepo ¶
func NewRulesRepo ¶
Click to show internal directories.
Click to hide internal directories.