store

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 20 Imported by: 9

Documentation

Index

Constants

View Source
const (
	MaxStreamLength = 50
)

Variables

This section is empty.

Functions

func NewRedis

func NewRedis(config RedisConfig) data.Store

Types

type Redis

type Redis struct {
	// contains filtered or unexported fields
}

func (*Redis) Connect

func (s *Redis) Connect()

func (*Redis) CreateEntity

func (s *Redis) CreateEntity(entityType, parentId, name string)

func (*Redis) CreateSnapshot

func (s *Redis) CreateSnapshot() data.Snapshot

func (*Redis) DeleteEntity

func (s *Redis) DeleteEntity(entityId string)

func (*Redis) Disconnect

func (s *Redis) Disconnect()

func (*Redis) EntityExists

func (s *Redis) EntityExists(entityId string) bool

func (*Redis) FieldExists

func (s *Redis) FieldExists(fieldName, entityType string) bool

func (*Redis) FindEntities

func (s *Redis) FindEntities(entityType string) []string

func (*Redis) GetEntity

func (s *Redis) GetEntity(entityId string) data.Entity

func (*Redis) GetEntitySchema

func (s *Redis) GetEntitySchema(entityType string) data.EntitySchema

func (*Redis) GetEntityTypes

func (s *Redis) GetEntityTypes() []string

func (*Redis) GetFieldSchema

func (s *Redis) GetFieldSchema(entityType, fieldName string) data.FieldSchema

func (*Redis) IsConnected

func (s *Redis) IsConnected() bool

func (*Redis) ProcessNotifications

func (s *Redis) ProcessNotifications()

func (*Redis) Read

func (s *Redis) Read(requests ...data.Request)

func (*Redis) ResolveIndirection

func (s *Redis) ResolveIndirection(indirectField, entityId string) (string, string)

func (*Redis) RestoreSnapshot

func (s *Redis) RestoreSnapshot(ss data.Snapshot)

func (*Redis) SetEntity

func (s *Redis) SetEntity(e data.Entity)

func (*Redis) SetEntitySchema

func (s *Redis) SetEntitySchema(newSchema data.EntitySchema)

func (*Redis) SetFieldSchema

func (s *Redis) SetFieldSchema(entityType, fieldName string, value data.FieldSchema)

func (*Redis) SortedSetAdd

func (s *Redis) SortedSetAdd(key string, member string, score float64) int64

func (*Redis) SortedSetRangeByScoreWithScores

func (s *Redis) SortedSetRangeByScoreWithScores(key string, min, max string) []data.SortedSetMember

func (*Redis) SortedSetRemove

func (s *Redis) SortedSetRemove(key string, member string) int64

func (*Redis) SortedSetRemoveRangeByRank

func (s *Redis) SortedSetRemoveRangeByRank(key string, start, stop int64) int64

func (*Redis) TempDel

func (s *Redis) TempDel(key string)

func (*Redis) TempExpire

func (s *Redis) TempExpire(key string, expiration time.Duration)

func (*Redis) TempGet

func (s *Redis) TempGet(key string) string

func (*Redis) TempSet

func (s *Redis) TempSet(key, value string, expiration time.Duration) bool

func (*Redis) Unnotify

func (s *Redis) Unnotify(e string)

func (*Redis) UnnotifyCallback

func (s *Redis) UnnotifyCallback(e string, c data.NotificationCallback)

func (*Redis) Write

func (s *Redis) Write(requests ...data.Request)

type RedisConfig

type RedisConfig struct {
	Address  string
	Password string
}

type RedisKeyGenerator

type RedisKeyGenerator struct{}

schema:entity:<type> -> DatabaseEntitySchema schema:field:<name> -> DatabaseFieldSchema instance:entity:<entityId> -> DatabaseEntity instance:field:<name>:<entityId> -> DatabaseField instance:type:<entityType> -> []string{entityId...} instance:notification-config:<entityId>:<fieldName> -> []string{subscriptionId...} instance:notification-config:<entityType>:<fieldName> -> []string{subscriptionId...}

func (*RedisKeyGenerator) GetEntityIdNotificationConfigKey

func (g *RedisKeyGenerator) GetEntityIdNotificationConfigKey(entityId, fieldName string) string

func (*RedisKeyGenerator) GetEntityKey

func (g *RedisKeyGenerator) GetEntityKey(entityId string) string

func (*RedisKeyGenerator) GetEntitySchemaKey

func (g *RedisKeyGenerator) GetEntitySchemaKey(entityType string) string

func (*RedisKeyGenerator) GetEntityTypeKey

func (g *RedisKeyGenerator) GetEntityTypeKey(entityType string) string

func (*RedisKeyGenerator) GetEntityTypeNotificationConfigKey

func (g *RedisKeyGenerator) GetEntityTypeNotificationConfigKey(entityType, fieldName string) string

func (*RedisKeyGenerator) GetFieldKey

func (g *RedisKeyGenerator) GetFieldKey(fieldName, entityId string) string

func (*RedisKeyGenerator) GetNotificationChannelKey

func (g *RedisKeyGenerator) GetNotificationChannelKey(serviceId string) string

Jump to

Keyboard shortcuts

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