repo

package
v0.2.20 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2024 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	STREAM_NAME  = "rules"
	RULE_SUBJECT = "rule.>"
)
View Source
const (
	RULE_PREFIX = "rules" // => rules:id {..}
)

Variables

View Source
var STREAM_SUBJECTS = []string{
	RULE_SUBJECT,
}

Functions

func CompareRules added in v0.1.2

func CompareRules(old *rules.Rule, new *rules.Rule) []string

func FmtSubjectKey added in v0.1.2

func FmtSubjectKey(id string, fmtSubject string) (string, error)

func RedisFmtKey added in v0.1.2

func RedisFmtKey(id string, prefix string) (string, error)

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
	Close()
}

func NewDiskRuleRepo

func NewDiskRuleRepo(root string) RuleRepo

func NewInMemoryRuleRepo

func NewInMemoryRuleRepo() RuleRepo

func NewJetstreamRuleRepo

func NewJetstreamRuleRepo(natsURL string) (RuleRepo, error)

func NewPostgresRuleRepo

func NewPostgresRuleRepo(connectionString string) (RuleRepo, error)

func NewRedisRuleRepo

func NewRedisRuleRepo(redisStoreURL string) (RuleRepo, error)

Jump to

Keyboard shortcuts

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