Documentation ¶
Index ¶
- Constants
- func NewRedis(config RedisConfig) data.Store
- func NewWeb(config WebConfig) data.Store
- type Redis
- func (s *Redis) Connect(ctx context.Context)
- func (s *Redis) CreateEntity(ctx context.Context, entityType, parentId, name string)
- func (s *Redis) CreateSnapshot(ctx context.Context) data.Snapshot
- func (s *Redis) DeleteEntity(ctx context.Context, entityId string)
- func (s *Redis) Disconnect(ctx context.Context)
- func (s *Redis) EntityExists(ctx context.Context, entityId string) bool
- func (s *Redis) FieldExists(ctx context.Context, fieldName, entityType string) bool
- func (s *Redis) FindEntities(ctx context.Context, entityType string) []string
- func (s *Redis) GetEntity(ctx context.Context, entityId string) data.Entity
- func (s *Redis) GetEntitySchema(ctx context.Context, entityType string) data.EntitySchema
- func (s *Redis) GetEntityTypes(ctx context.Context) []string
- func (s *Redis) GetFieldSchema(ctx context.Context, entityType, fieldName string) data.FieldSchema
- func (s *Redis) IsConnected(ctx context.Context) bool
- func (s *Redis) Notify(ctx context.Context, nc data.NotificationConfig, cb data.NotificationCallback) data.NotificationToken
- func (s *Redis) ProcessNotifications(ctx context.Context)
- func (s *Redis) Read(ctx context.Context, requests ...data.Request)
- func (s *Redis) ResolveIndirection(ctx context.Context, indirectField, entityId string) (string, string)
- func (s *Redis) RestoreSnapshot(ctx context.Context, ss data.Snapshot)
- func (s *Redis) SetEntity(ctx context.Context, e data.Entity)
- func (s *Redis) SetEntitySchema(ctx context.Context, newSchema data.EntitySchema)
- func (s *Redis) SetFieldSchema(ctx context.Context, entityType, fieldName string, value data.FieldSchema)
- func (s *Redis) SortedSetAdd(ctx context.Context, key string, member string, score float64) int64
- func (s *Redis) SortedSetRangeByScoreWithScores(ctx context.Context, key string, min, max string) []data.SortedSetMember
- func (s *Redis) SortedSetRemove(ctx context.Context, key string, member string) int64
- func (s *Redis) SortedSetRemoveRangeByRank(ctx context.Context, key string, start, stop int64) int64
- func (s *Redis) TempDel(ctx context.Context, key string)
- func (s *Redis) TempExpire(ctx context.Context, key string, expiration time.Duration)
- func (s *Redis) TempGet(ctx context.Context, key string) string
- func (s *Redis) TempSet(ctx context.Context, key, value string, expiration time.Duration) bool
- func (s *Redis) Unnotify(ctx context.Context, e string)
- func (s *Redis) UnnotifyCallback(ctx context.Context, e string, c data.NotificationCallback)
- func (s *Redis) Write(ctx context.Context, requests ...data.Request)
- type RedisConfig
- type RedisKeyGenerator
- func (g *RedisKeyGenerator) GetEntityIdNotificationConfigKey(entityId, fieldName string) string
- func (g *RedisKeyGenerator) GetEntityKey(entityId string) string
- func (g *RedisKeyGenerator) GetEntitySchemaKey(entityType string) string
- func (g *RedisKeyGenerator) GetEntityTypeKey(entityType string) string
- func (g *RedisKeyGenerator) GetEntityTypeNotificationConfigKey(entityType, fieldName string) string
- func (g *RedisKeyGenerator) GetFieldKey(fieldName, entityId string) string
- func (g *RedisKeyGenerator) GetNotificationChannelKey(serviceId string) string
- type Web
- func (s *Web) Connect(ctx context.Context)
- func (s *Web) CreateEntity(ctx context.Context, entityType, parentId, name string)
- func (s *Web) CreateSnapshot(ctx context.Context) data.Snapshot
- func (s *Web) DeleteEntity(ctx context.Context, entityId string)
- func (s *Web) Disconnect(ctx context.Context)
- func (s *Web) EntityExists(ctx context.Context, entityId string) bool
- func (s *Web) FieldExists(ctx context.Context, fieldName, entityType string) bool
- func (s *Web) FindEntities(ctx context.Context, entityType string) []string
- func (s *Web) GetEntity(ctx context.Context, entityId string) data.Entity
- func (s *Web) GetEntitySchema(ctx context.Context, entityType string) data.EntitySchema
- func (s *Web) GetEntityTypes(ctx context.Context) []string
- func (s *Web) IsConnected(ctx context.Context) bool
- func (s *Web) Notify(ctx context.Context, config data.NotificationConfig, ...) data.NotificationToken
- func (s *Web) ProcessNotifications(ctx context.Context)
- func (s *Web) Read(ctx context.Context, requests ...data.Request)
- func (s *Web) RestoreSnapshot(ctx context.Context, ss data.Snapshot)
- func (s *Web) SetEntity(ctx context.Context, e data.Entity)
- func (s *Web) SetEntitySchema(ctx context.Context, schema data.EntitySchema)
- func (s *Web) SortedSetAdd(ctx context.Context, key string, member string, score float64) int64
- func (s *Web) SortedSetRangeByScoreWithScores(ctx context.Context, key string, min, max string) []data.SortedSetMember
- func (s *Web) SortedSetRemove(ctx context.Context, key string, member string) int64
- func (s *Web) SortedSetRemoveRangeByRank(ctx context.Context, key string, start, stop int64) int64
- func (s *Web) TempDel(ctx context.Context, key string)
- func (s *Web) TempExpire(ctx context.Context, key string, expiration time.Duration)
- func (s *Web) TempGet(ctx context.Context, key string) string
- func (s *Web) TempSet(ctx context.Context, key, value string, expiration time.Duration) bool
- func (s *Web) Unnotify(ctx context.Context, token string)
- func (s *Web) UnnotifyCallback(ctx context.Context, token string, cb data.NotificationCallback)
- func (s *Web) Write(ctx context.Context, requests ...data.Request)
- type WebConfig
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) CreateEntity ¶
func (*Redis) Disconnect ¶
func (*Redis) EntityExists ¶
func (*Redis) FieldExists ¶
func (*Redis) FindEntities ¶
func (*Redis) GetEntitySchema ¶
func (*Redis) GetFieldSchema ¶
func (*Redis) Notify ¶
func (s *Redis) Notify(ctx context.Context, nc data.NotificationConfig, cb data.NotificationCallback) data.NotificationToken
func (*Redis) ProcessNotifications ¶
func (*Redis) ResolveIndirection ¶
func (*Redis) RestoreSnapshot ¶
func (*Redis) SetEntitySchema ¶
func (s *Redis) SetEntitySchema(ctx context.Context, newSchema data.EntitySchema)
func (*Redis) SetFieldSchema ¶
func (*Redis) SortedSetAdd ¶
func (*Redis) SortedSetRangeByScoreWithScores ¶
func (*Redis) SortedSetRemove ¶
func (*Redis) SortedSetRemoveRangeByRank ¶
func (*Redis) TempExpire ¶
func (*Redis) UnnotifyCallback ¶
type RedisConfig ¶
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) CreateEntity ¶ added in v0.0.9
func (*Web) CreateSnapshot ¶ added in v0.0.9
func (*Web) DeleteEntity ¶ added in v0.0.9
func (*Web) Disconnect ¶ added in v0.0.9
func (*Web) EntityExists ¶ added in v0.0.9
func (*Web) FieldExists ¶ added in v0.0.9
func (*Web) FindEntities ¶ added in v0.0.9
func (*Web) GetEntitySchema ¶ added in v0.0.9
func (*Web) GetEntityTypes ¶ added in v0.0.9
func (*Web) Notify ¶ added in v0.0.9
func (s *Web) Notify(ctx context.Context, config data.NotificationConfig, cb data.NotificationCallback) data.NotificationToken
func (*Web) ProcessNotifications ¶ added in v0.0.9
func (*Web) RestoreSnapshot ¶ added in v0.0.9
func (*Web) SetEntitySchema ¶ added in v0.0.9
func (s *Web) SetEntitySchema(ctx context.Context, schema data.EntitySchema)
func (*Web) SortedSetAdd ¶ added in v0.0.9
func (*Web) SortedSetRangeByScoreWithScores ¶ added in v0.0.9
func (*Web) SortedSetRemove ¶ added in v0.0.9
func (*Web) SortedSetRemoveRangeByRank ¶ added in v0.0.9
func (*Web) TempExpire ¶ added in v0.0.9
func (*Web) TempSet ¶ added in v0.0.9
Implement remaining data.Store interface methods for temp storage and sorted sets
func (*Web) UnnotifyCallback ¶ added in v0.0.9
Click to show internal directories.
Click to hide internal directories.