store

package
v0.0.13 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2024 License: MIT Imports: 23 Imported by: 8

Documentation

Index

Constants

View Source
const (
	MaxStreamLength = 50
)

Variables

This section is empty.

Functions

func NewRedis

func NewRedis(config RedisConfig) data.Store

func NewWeb added in v0.0.9

func NewWeb(config WebConfig) 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

type Web added in v0.0.9

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

func (*Web) Connect added in v0.0.9

func (s *Web) Connect()

func (*Web) CreateEntity added in v0.0.9

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

func (*Web) CreateSnapshot added in v0.0.9

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

func (*Web) DeleteEntity added in v0.0.9

func (s *Web) DeleteEntity(entityId string)

func (*Web) Disconnect added in v0.0.9

func (s *Web) Disconnect()

func (*Web) EntityExists added in v0.0.9

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

func (*Web) FieldExists added in v0.0.9

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

func (*Web) FindEntities added in v0.0.9

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

func (*Web) GetEntity added in v0.0.9

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

func (*Web) GetEntitySchema added in v0.0.9

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

func (*Web) GetEntityTypes added in v0.0.9

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

func (*Web) IsConnected added in v0.0.9

func (s *Web) IsConnected() bool

func (*Web) Notify added in v0.0.9

func (*Web) ProcessNotifications added in v0.0.9

func (s *Web) ProcessNotifications()

func (*Web) Read added in v0.0.9

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

func (*Web) RestoreSnapshot added in v0.0.9

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

func (*Web) SetEntity added in v0.0.9

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

func (*Web) SetEntitySchema added in v0.0.9

func (s *Web) SetEntitySchema(schema data.EntitySchema)

func (*Web) SortedSetAdd added in v0.0.9

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

func (*Web) SortedSetRangeByScoreWithScores added in v0.0.9

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

func (*Web) SortedSetRemove added in v0.0.9

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

func (*Web) SortedSetRemoveRangeByRank added in v0.0.9

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

func (*Web) TempDel added in v0.0.9

func (s *Web) TempDel(key string)

func (*Web) TempExpire added in v0.0.9

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

func (*Web) TempGet added in v0.0.9

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

func (*Web) TempSet added in v0.0.9

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

Implement remaining data.Store interface methods for temp storage and sorted sets

func (*Web) Unnotify added in v0.0.9

func (s *Web) Unnotify(token string)

func (*Web) UnnotifyCallback added in v0.0.9

func (s *Web) UnnotifyCallback(token string, cb data.NotificationCallback)

func (*Web) Write added in v0.0.9

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

type WebConfig added in v0.0.9

type WebConfig struct {
	Address string
}

Jump to

Keyboard shortcuts

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