Documentation ¶
Index ¶
- func FileDecode(encoded string) []byte
- func FileEncode(content []byte) string
- type Entity
- type EntityBinding
- type EntityFieldValidator
- type EntitySchema
- type Field
- type FieldBinding
- type FieldQuery
- type FieldSchema
- type MultiBinding
- type Notification
- type NotificationCallback
- type NotificationConfig
- type NotificationToken
- type Query
- type Request
- type Snapshot
- type SortedSetMember
- type Store
- type Transformer
- type Value
- type WriteOpt
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FileDecode ¶
func FileEncode ¶
Types ¶
type EntityBinding ¶
type EntityBinding interface { Entity GetField(string) FieldBinding }
type EntityFieldValidator ¶
type EntityFieldValidator interface { // RegisterEntityFields registers required fields for an entity type RegisterEntityFields(entityType string, fields ...string) // ValidateFields checks if all registered entity fields exist in the schema ValidateFields(context.Context) error }
EntityFieldValidator ensures that entities and their fields exist in the schema
func NewEntityFieldValidator ¶
func NewEntityFieldValidator(store Store) EntityFieldValidator
type EntitySchema ¶
type EntitySchema interface { GetType() string GetFields() []FieldSchema GetFieldNames() []string GetField(string) FieldSchema SetType(string) SetFields([]FieldSchema) }
type FieldBinding ¶
type FieldBinding interface { GetEntityId() string GetFieldName() string GetWriteTime() time.Time GetWriter() string IsInt() bool IsFloat() bool IsString() bool IsBool() bool IsBinaryFile() bool IsEntityReference() bool IsTimestamp() bool IsTransformation() bool GetValue() Value GetInt() int64 GetFloat() float64 GetString() string GetBool() bool GetBinaryFile() string GetEntityReference() string GetTimestamp() time.Time GetTransformation() string SetValue(Value) FieldBinding WriteValue(context.Context, Value) FieldBinding WriteInt(context.Context, ...interface{}) FieldBinding WriteFloat(context.Context, ...interface{}) FieldBinding WriteString(context.Context, ...interface{}) FieldBinding WriteBool(context.Context, ...interface{}) FieldBinding WriteBinaryFile(context.Context, ...interface{}) FieldBinding WriteEntityReference(context.Context, ...interface{}) FieldBinding WriteTimestamp(context.Context, ...interface{}) FieldBinding WriteTransformation(context.Context, ...interface{}) FieldBinding ReadValue(context.Context) Value ReadInt(context.Context) int64 ReadFloat(context.Context) float64 ReadString(context.Context) string ReadBool(context.Context) bool ReadBinaryFile(context.Context) string ReadEntityReference(context.Context) string ReadTimestamp(context.Context) time.Time ReadTransformation(context.Context) string }
type FieldQuery ¶
type FieldSchema ¶
type MultiBinding ¶ added in v0.0.9
type Notification ¶
type NotificationCallback ¶
type NotificationCallback interface { Fn(context.Context, Notification) Id() string }
type NotificationConfig ¶
type NotificationConfig interface { GetEntityId() string GetEntityType() string GetFieldName() string GetContextFields() []string GetNotifyOnChange() bool GetServiceId() string SetEntityId(string) NotificationConfig SetEntityType(string) NotificationConfig SetFieldName(string) NotificationConfig SetContextFields(...string) NotificationConfig SetNotifyOnChange(bool) NotificationConfig SetServiceId(string) NotificationConfig }
type NotificationToken ¶
type Query ¶
type Query interface { ForType(string) Query Where(string) FieldQuery Execute(context.Context) []EntityBinding }
type Request ¶
type Request interface { GetEntityId() string GetFieldName() string GetWriteTime() *time.Time GetWriter() *string GetValue() Value IsSuccessful() bool SetEntityId(string) Request SetFieldName(string) Request SetWriteTime(*time.Time) Request SetWriter(*string) Request SetValue(Value) Request SetSuccessful(bool) Request GetWriteOpt() WriteOpt SetWriteOpt(WriteOpt) Request }
type Snapshot ¶
type Snapshot interface { GetEntities() []Entity GetFields() []Field GetSchemas() []EntitySchema SetEntities([]Entity) SetFields([]Field) SetSchemas([]EntitySchema) AppendEntity(Entity) AppendField(Field) AppendSchema(EntitySchema) }
type SortedSetMember ¶
type Store ¶
type Store interface { Connect(context.Context) Disconnect(context.Context) IsConnected(context.Context) bool CreateSnapshot(context.Context) Snapshot RestoreSnapshot(context.Context, Snapshot) CreateEntity(ctx context.Context, entityType, parentId, name string) GetEntity(ctx context.Context, entityId string) Entity SetEntity(ctx context.Context, value Entity) DeleteEntity(ctx context.Context, entityId string) FindEntities(ctx context.Context, entityType string) []string GetEntityTypes(ctx context.Context) []string EntityExists(ctx context.Context, entityId string) bool FieldExists(ctx context.Context, fieldName, entityType string) bool GetEntitySchema(ctx context.Context, entityType string) EntitySchema SetEntitySchema(context.Context, EntitySchema) Read(context.Context, ...Request) Write(context.Context, ...Request) Notify(ctx context.Context, config NotificationConfig, callback NotificationCallback) NotificationToken Unnotify(ctx context.Context, subscriptionId string) UnnotifyCallback(ctx context.Context, subscriptionId string, callback NotificationCallback) ProcessNotifications(context.Context) TempSet(ctx context.Context, key string, value string, expiration time.Duration) bool TempGet(ctx context.Context, key string) string TempExpire(ctx context.Context, key string, expiration time.Duration) TempDel(ctx context.Context, key string) SortedSetAdd(ctx context.Context, key string, member string, score float64) int64 SortedSetRemove(ctx context.Context, key string, member string) int64 SortedSetRemoveRangeByRank(ctx context.Context, key string, start, stop int64) int64 SortedSetRangeByScoreWithScores(ctx context.Context, key string, min, max string) []SortedSetMember }
type Transformer ¶
Transformer calls scripts to transform field values of type Transformation
type Value ¶
type Value interface { IsNil() bool IsInt() bool IsFloat() bool IsString() bool IsBool() bool IsBinaryFile() bool IsEntityReference() bool IsTimestamp() bool IsTransformation() bool GetType() string GetInt() int64 GetFloat() float64 GetString() string GetBool() bool GetBinaryFile() string GetEntityReference() string GetTimestamp() time.Time GetTransformation() string SetInt(interface{}) Value SetFloat(interface{}) Value SetString(interface{}) Value SetBool(interface{}) Value SetBinaryFile(interface{}) Value SetEntityReference(interface{}) Value SetTimestamp(interface{}) Value SetTransformation(interface{}) Value }
Source Files ¶
Click to show internal directories.
Click to hide internal directories.