Documentation
¶
Index ¶
- func FileDecode(encoded string) []byte
- func FileEncode(content []byte) string
- type AuthProvider
- type Choice
- type ChoiceFieldSchema
- type CompleteChoice
- type Connector
- type Entity
- type EntityBinding
- type EntityFieldValidator
- type EntityList
- type EntityManager
- type EntityManagerSetter
- type EntitySchema
- type Field
- type FieldAuthorizer
- type FieldAuthorizerKeyType
- type FieldBinding
- type FieldOperator
- type FieldOperatorSetter
- type FieldQuery
- type FieldReader
- type FieldSchema
- type FieldWriter
- type IndirectionResolver
- type LimitedStore
- type ModifiableEntityManager
- type ModifiableFieldOperator
- type ModifiableNotificationConsumer
- type ModifiableNotificationPublisher
- type ModifiableSchemaManager
- type ModifiableSnapshotManager
- type MultiBinding
- type Notification
- type NotificationCallback
- type NotificationConfig
- type NotificationConsumer
- type NotificationConsumerSetter
- type NotificationPublisher
- type NotificationPublisherSetter
- type NotificationToken
- type Query
- type Request
- type SchemaManager
- type SchemaManagerSetter
- type Snapshot
- type SnapshotManager
- type SnapshotManagerSetter
- 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 AuthProvider ¶ added in v0.1.15
type ChoiceFieldSchema ¶ added in v0.1.5
type ChoiceFieldSchema interface { FieldSchema GetChoices() []string SetChoices([]string) ChoiceFieldSchema }
type CompleteChoice ¶ added in v0.1.5
type EntityBinding ¶
type EntityBinding interface { Entity DoMulti(context.Context, func(EntityBinding)) 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 EntityList ¶ added in v0.1.5
type EntityList interface { // GetEntities returns all entity IDs in the list GetEntities() []string // SetEntities updates all entity IDs in the list SetEntities(entities []string) EntityList // Add adds an entity ID to the list if not already present // Returns true if added, false if already exists Add(entity string) bool // Remove removes an entity ID from the list // Returns true if removed, false if not found Remove(entity string) bool // Contains checks if an entity ID is in the list Contains(entity string) bool // Count returns the number of entities in the list Count() int // Clear removes all entities from the list Clear() EntityList }
EntityList represents a collection of entity references
type EntityManager ¶ added in v0.1.0
type EntityManager interface { CreateEntity(ctx context.Context, entityType, parentId, name string) string GetEntity(ctx context.Context, entityId string) 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 }
type EntityManagerSetter ¶ added in v0.1.0
type EntityManagerSetter interface {
SetEntityManager(EntityManager)
}
type EntitySchema ¶
type EntitySchema interface { GetType() string GetFields() []FieldSchema GetFieldNames() []string GetField(string) FieldSchema SetType(string) SetFields([]FieldSchema) SetField(string, FieldSchema) }
type FieldAuthorizer ¶ added in v0.1.5
type FieldAuthorizerKeyType ¶ added in v0.1.17
type FieldAuthorizerKeyType string
const FieldAuthorizerKey FieldAuthorizerKeyType = "Authorizer"
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 IsChoice() bool IsEntityList() bool GetValue() Value GetInt() int64 GetFloat() float64 GetString() string GetBool() bool GetBinaryFile() string GetEntityReference() string GetTimestamp() time.Time GetChoice() Choice GetCompleteChoice(context.Context) CompleteChoice GetEntityList() EntityList 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 WriteChoice(context.Context, ...interface{}) FieldBinding WriteEntityList(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 ReadChoice(context.Context) CompleteChoice ReadEntityList(context.Context) EntityList }
type FieldOperator ¶ added in v0.1.0
type FieldOperator interface { FieldReader FieldWriter }
type FieldOperatorSetter ¶ added in v0.1.0
type FieldOperatorSetter interface {
SetFieldOperator(FieldOperator)
}
type FieldQuery ¶
type FieldReader ¶ added in v0.1.0
type FieldSchema ¶
type FieldSchema interface { GetFieldName() string GetFieldType() string IsInt() bool IsFloat() bool IsString() bool IsBool() bool IsBinaryFile() bool IsEntityReference() bool IsTimestamp() bool IsChoice() bool IsEntityList() bool GetReadPermissions() []string GetWritePermissions() []string AsChoiceFieldSchema() ChoiceFieldSchema }
type FieldWriter ¶ added in v0.1.0
type IndirectionResolver ¶ added in v0.1.2
type LimitedStore ¶ added in v0.1.13
type LimitedStore struct { Connector EntityManager FieldOperator NotificationConsumer NotificationPublisher SchemaManager AuthProvider SnapshotManager }
type ModifiableEntityManager ¶ added in v0.1.0
type ModifiableEntityManager interface { SchemaManagerSetter FieldOperatorSetter EntityManager }
type ModifiableFieldOperator ¶ added in v0.1.0
type ModifiableFieldOperator interface { SchemaManagerSetter EntityManagerSetter NotificationPublisherSetter FieldOperator }
type ModifiableNotificationConsumer ¶ added in v0.1.0
type ModifiableNotificationConsumer interface { NotificationConsumer }
type ModifiableNotificationPublisher ¶ added in v0.1.0
type ModifiableNotificationPublisher interface { EntityManagerSetter FieldOperatorSetter NotificationPublisher }
type ModifiableSchemaManager ¶ added in v0.1.0
type ModifiableSchemaManager interface { EntityManagerSetter FieldOperatorSetter SchemaManager }
type ModifiableSnapshotManager ¶ added in v0.1.0
type ModifiableSnapshotManager interface { SchemaManagerSetter EntityManagerSetter FieldOperatorSetter SnapshotManager }
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 GetToken() string IsDistributed() bool SetEntityId(string) NotificationConfig SetEntityType(string) NotificationConfig SetFieldName(string) NotificationConfig SetContextFields(...string) NotificationConfig SetNotifyOnChange(bool) NotificationConfig SetServiceId(string) NotificationConfig SetDistributed(bool) NotificationConfig }
type NotificationConsumer ¶ added in v0.1.0
type NotificationConsumer interface { Notify(ctx context.Context, config NotificationConfig, callback NotificationCallback) NotificationToken Unnotify(ctx context.Context, subscriptionId string) UnnotifyCallback(ctx context.Context, subscriptionId string, callback NotificationCallback) Consumed() signalslots.Signal }
type NotificationConsumerSetter ¶ added in v0.1.0
type NotificationConsumerSetter interface {
SetNotificationConsumer(NotificationConsumer)
}
type NotificationPublisher ¶ added in v0.1.0
type NotificationPublisherSetter ¶ added in v0.1.0
type NotificationPublisherSetter interface {
SetNotificationPublisher(NotificationPublisher)
}
type NotificationToken ¶
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 Clone() Request }
type SchemaManager ¶ added in v0.1.0
type SchemaManager interface { FieldExists(ctx context.Context, fieldName, entityType string) bool GetEntitySchema(ctx context.Context, entityType string) EntitySchema SetEntitySchema(context.Context, EntitySchema) GetFieldSchema(ctx context.Context, fieldName, entityType string) FieldSchema SetFieldSchema(ctx context.Context, entityType, fieldName string, schema FieldSchema) }
type SchemaManagerSetter ¶ added in v0.1.0
type SchemaManagerSetter interface {
SetSchemaManager(SchemaManager)
}
type Snapshot ¶
type Snapshot interface { GetEntities() []Entity GetFields() []Field GetSchemas() []EntitySchema SetEntities([]Entity) SetFields([]Field) SetSchemas([]EntitySchema) AppendEntity(Entity) AppendField(Field) AppendSchema(EntitySchema) }
type SnapshotManager ¶ added in v0.1.0
type SnapshotManagerSetter ¶ added in v0.1.0
type SnapshotManagerSetter interface {
SetSnapshotManager(SnapshotManager)
}
type Store ¶
type Store interface { Connector EntityManager FieldOperator NotificationConsumer NotificationPublisher SchemaManager AuthProvider SnapshotManager }
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 IsChoice() bool IsEntityList() bool GetType() string GetInt() int64 GetFloat() float64 GetString() string GetBool() bool GetBinaryFile() string GetEntityReference() string GetTimestamp() time.Time GetChoice() Choice GetEntityList() EntityList SetInt(interface{}) Value SetFloat(interface{}) Value SetString(interface{}) Value SetBool(interface{}) Value SetBinaryFile(interface{}) Value SetEntityReference(interface{}) Value SetTimestamp(interface{}) Value SetChoice(interface{}) Value SetEntityList(interface{}) Value }
Source Files
¶
Click to show internal directories.
Click to hide internal directories.