storage

package
v0.0.0-...-d841f61 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2021 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func EncodeGroup

func EncodeGroup(decodedGroup AlarmGroup) []string

Types

type AlarmGroup

type AlarmGroup struct {
	OpenTime types.CpsTime
	Group    map[string]types.CpsTime
}

func DecodeGroup

func DecodeGroup(encodedGroup []string) (AlarmGroup, error)

func (AlarmGroup) GetAlarmIds

func (g AlarmGroup) GetAlarmIds() []string

type GroupingStorage

type GroupingStorage interface {
	Push(context.Context, *redis.Tx, metaalarm.Rule, types.Alarm, string) error
	CleanPush(context.Context, *redis.Tx, metaalarm.Rule, types.Alarm, string) error
	Clean(context.Context, *redis.Tx, string) error
	Get(context.Context, *redis.Tx, string) (AlarmGroup, error)
	GetGroupLen(context.Context, *redis.Tx, string) (int64, error)
}

type RedisGroupingStorage

type RedisGroupingStorage struct{}

func NewRedisGroupingStorage

func NewRedisGroupingStorage() *RedisGroupingStorage

func (*RedisGroupingStorage) Clean

func (s *RedisGroupingStorage) Clean(ctx context.Context, tx *redis.Tx, ruleID string) error

func (*RedisGroupingStorage) CleanPush

func (s *RedisGroupingStorage) CleanPush(ctx context.Context, tx *redis.Tx, rule metaalarm.Rule, newAlarm types.Alarm, key string) error

func (*RedisGroupingStorage) Get

func (s *RedisGroupingStorage) Get(ctx context.Context, tx *redis.Tx, ruleID string) (AlarmGroup, error)

func (*RedisGroupingStorage) GetGroupLen

func (s *RedisGroupingStorage) GetGroupLen(ctx context.Context, tx *redis.Tx, ruleID string) (int64, error)

func (*RedisGroupingStorage) Push

func (s *RedisGroupingStorage) Push(ctx context.Context, tx *redis.Tx, rule metaalarm.Rule, newAlarm types.Alarm, key string) error

Jump to

Keyboard shortcuts

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