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