repo

package
v0.2.21 Latest Latest
Warning

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

Go to latest
Published: May 6, 2025 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

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