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() 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(Value) FieldBinding WriteInt(...interface{}) FieldBinding WriteFloat(...interface{}) FieldBinding WriteString(...interface{}) FieldBinding WriteBool(...interface{}) FieldBinding WriteBinaryFile(...interface{}) FieldBinding WriteEntityReference(...interface{}) FieldBinding WriteTimestamp(...interface{}) FieldBinding WriteTransformation(...interface{}) FieldBinding ReadValue() Value ReadInt() int64 ReadFloat() float64 ReadString() string ReadBool() bool ReadBinaryFile() string ReadEntityReference() string ReadTimestamp() time.Time ReadTransformation() string }
type FieldQuery ¶
type FieldSchema ¶
type MultiBinding ¶ added in v0.0.9
type MultiBinding interface { Store GetEntityById(string) EntityBinding Commit() }
type Notification ¶
type NotificationCallback ¶
type NotificationCallback interface { Fn(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 NotificationToken interface { Id() string Unbind() }
type Query ¶
type Query interface { ForType(string) Query Where(string) FieldQuery Execute() []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() Disconnect() IsConnected() bool CreateSnapshot() Snapshot RestoreSnapshot(s Snapshot) CreateEntity(entityType, parentId, name string) GetEntity(entityId string) Entity SetEntity(value Entity) DeleteEntity(entityId string) FindEntities(entityType string) []string GetEntityTypes() []string EntityExists(entityId string) bool FieldExists(fieldName, entityType string) bool GetEntitySchema(entityType string) EntitySchema SetEntitySchema(EntitySchema) Read(...Request) Write(...Request) Notify(config NotificationConfig, callback NotificationCallback) NotificationToken Unnotify(subscriptionId string) UnnotifyCallback(subscriptionId string, callback NotificationCallback) ProcessNotifications() TempSet(key string, value string, expiration time.Duration) bool TempGet(key string) string TempExpire(key string, expiration time.Duration) TempDel(key string) SortedSetAdd(key string, member string, score float64) int64 SortedSetRemove(key string, member string) int64 SortedSetRemoveRangeByRank(key string, start, stop int64) int64 SortedSetRangeByScoreWithScores(key string, min, max string) []SortedSetMember }
type Transformer ¶
Transformer calls scripts to transform field values of type Transformation
type Value ¶
type Value interface { 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.