Documentation
¶
Index ¶
- Constants
- Variables
- func AccumulateErrors(errs ...error) error
- func CastEntityIdSliceToStringSlice(i []EntityId) []string
- func CastSlice[I any, O any](i []I, convert func(I) O) []O
- func CastToInterfaceSlice[T any](i []T) []any
- func CopySlice[I any](i []I) []I
- func FileDecode(encoded string) []byte
- func FileEncode(content []byte) string
- type AnyPbConverter
- type BinaryFileProvider
- type BinaryFileReceiver
- type BoolProvider
- type BoolReceiver
- type ChoiceProvider
- type ChoiceReceiver
- type ConnectedArgs
- type DisconnectedArgs
- type Entity
- func (me *Entity) ApplyOpts(opts ...EntityOpts) *Entity
- func (me *Entity) AsEntityPb() *qprotobufs.DatabaseEntity
- func (me *Entity) Clone() *Entity
- func (me *Entity) Field(fieldType FieldType, opts ...FieldOpts) *Field
- func (me *Entity) FromEntityPb(pb *qprotobufs.DatabaseEntity) *Entity
- func (me *Entity) Init(entityId EntityId, opts ...EntityOpts) *Entity
- type EntityFieldValidator
- type EntityId
- func (me *EntityId) AsEntityReferencePb() *qprotobufs.EntityReference
- func (me EntityId) AsInt() int64
- func (me EntityId) AsString() string
- func (me *EntityId) AsStringPb() *qprotobufs.String
- func (me *EntityId) FromString(s string) *EntityId
- func (me EntityId) GetEntityType() EntityType
- func (me *EntityId) IsEmpty() bool
- type EntityIdSlice
- type EntityListProvider
- type EntityListReceiver
- type EntityOpts
- type EntityReferenceProvider
- type EntityReferenceReceiver
- type EntitySchema
- func (me *EntitySchema) ApplyOpts(opts ...EntitySchemaOpts) *EntitySchema
- func (me *EntitySchema) AsBytes() ([]byte, error)
- func (me *EntitySchema) AsEntitySchemaPb() *qprotobufs.DatabaseEntitySchema
- func (me *EntitySchema) Clone() *EntitySchema
- func (me *EntitySchema) Field(fieldType FieldType, opts ...FieldSchemaOpts) *FieldSchema
- func (me *EntitySchema) FromBytes(data []byte) (*EntitySchema, error)
- func (me *EntitySchema) FromEntitySchemaPb(pb *qprotobufs.DatabaseEntitySchema) *EntitySchema
- func (me *EntitySchema) Init(entityType EntityType, opts ...EntitySchemaOpts) *EntitySchema
- type EntitySchemaOpts
- type EntityType
- type EntityTypeSlice
- type Field
- func (me *Field) ApplyOpts(opts ...FieldOpts) *Field
- func (me *Field) AsBytes() ([]byte, error)
- func (me *Field) AsFieldPb() *qprotobufs.DatabaseField
- func (me *Field) AsReadRequest(opts ...RequestOpts) *Request
- func (me *Field) AsWriteRequest(opts ...RequestOpts) *Request
- func (me *Field) Clone() *Field
- func (me *Field) FromBytes(data []byte) (*Field, error)
- func (me *Field) FromFieldPb(pb *qprotobufs.DatabaseField) *Field
- func (me *Field) Init(entityId EntityId, fieldType FieldType, opts ...FieldOpts) *Field
- type FieldOpts
- type FieldSchema
- func (me *FieldSchema) ApplyOpts(opts ...FieldSchemaOpts) *FieldSchema
- func (me *FieldSchema) AsFieldSchemaPb() *qprotobufs.DatabaseFieldSchema
- func (me *FieldSchema) Clone() *FieldSchema
- func (me *FieldSchema) FromFieldSchemaPb(entityType EntityType, pb *qprotobufs.DatabaseFieldSchema) *FieldSchema
- func (me *FieldSchema) Init(entityType EntityType, fieldType FieldType, valueType ValueType, ...) *FieldSchema
- type FieldSchemaOpts
- func FSOChoices(choices ...string) FieldSchemaOpts
- func FSOEntityType(et EntityType) FieldSchemaOpts
- func FSOFieldType(ft FieldType) FieldSchemaOpts
- func FSORank(rank int) FieldSchemaOpts
- func FSOReadPermissions(permissions []EntityId) FieldSchemaOpts
- func FSOValueType(vt ValueType) FieldSchemaOpts
- func FSOWritePermissions(permissions []EntityId) FieldSchemaOpts
- type FieldType
- type FieldTypeSlice
- type FloatProvider
- type FloatReceiver
- type IndirectionResolver
- type IntProvider
- type IntReceiver
- type Notification
- type NotificationCallback
- type NotificationConfig
- type NotificationToken
- type PageConfig
- type PageOpts
- type PageResult
- type ParsedQuery
- type PathResolver
- type PublishNotificationArgs
- type QueryColumn
- type QueryEngineType
- type QueryRow
- type QueryTable
- type RawProvider
- type RawReceiver
- type ReadEventArgs
- type Request
- func (me *Request) ApplyOpts(opts ...RequestOpts) *Request
- func (me *Request) AsField() *Field
- func (me *Request) AsRequestPb() *qprotobufs.DatabaseRequest
- func (me *Request) Clone() *Request
- func (me *Request) FromRequestPb(pb *qprotobufs.DatabaseRequest) *Request
- func (me *Request) Init(entityId EntityId, fieldType FieldType, opts ...RequestOpts) *Request
- type RequestOpts
- func ROEntityId(id EntityId) RequestOpts
- func ROFieldType(ft FieldType) RequestOpts
- func ROValue(v *Value) RequestOpts
- func ROValuePtr(v *Value) RequestOpts
- func ROWriteChanges() RequestOpts
- func ROWriteNormal() RequestOpts
- func ROWriteTime[T time.Time | WriteTime](t T) RequestOpts
- func ROWriteTimePtr(t *WriteTime) RequestOpts
- func ROWriterId(id EntityId) RequestOpts
- func ROWriterIdPtr(id *EntityId) RequestOpts
- type SQLiteBuilder
- type Snapshot
- func (me *Snapshot) ApplyOpts(opts ...SnapshotOpts) *Snapshot
- func (me *Snapshot) AsBytes() ([]byte, error)
- func (me *Snapshot) AsSnapshotPb() *qprotobufs.DatabaseSnapshot
- func (me *Snapshot) FromBytes(data []byte) (*Snapshot, error)
- func (me *Snapshot) FromSnapshotPb(pb *qprotobufs.DatabaseSnapshot) *Snapshot
- func (me *Snapshot) Init(opts ...SnapshotOpts) *Snapshot
- type SnapshotOpts
- type Store
- type StoreConnector
- type StoreInteractor
- type StoreNotifier
- type StoreOpts
- type StringConverter
- type StringProvider
- type StringReceiver
- type TimestampProvider
- type TimestampReceiver
- type TypeHintMap
- type TypeHintOpts
- type Value
- func NewBinaryFile(v ...string) *Value
- func NewBool(v ...bool) *Value
- func NewChoice(v ...int) *Value
- func NewEntityList(v ...[]EntityId) *Value
- func NewEntityReference(v ...EntityId) *Value
- func NewFloat(v ...float64) *Value
- func NewInt(v ...int) *Value
- func NewString(v ...string) *Value
- func NewTimestamp(v ...time.Time) *Value
- func (me *Value) Equals(o *Value) bool
- func (me *Value) FromAnyPb(a *anypb.Any) *Value
- func (me *Value) FromBinaryFile(v string) *Value
- func (me *Value) FromBool(v bool) *Value
- func (me *Value) FromChoice(v int) *Value
- func (me *Value) FromEntityList(v []EntityId) *Value
- func (me *Value) FromEntityReference(v EntityId) *Value
- func (me *Value) FromFloat(v float64) *Value
- func (me *Value) FromInt(v int) *Value
- func (me *Value) FromString(v string) *Value
- func (me *Value) FromTimestamp(v time.Time) *Value
- func (me *Value) FromValue(o *Value)
- func (me *Value) Init() *Value
- type ValueBinaryFile
- func (me *ValueBinaryFile) AsAnyPb() *anypb.Any
- func (me *ValueBinaryFile) AsString() string
- func (me *ValueBinaryFile) Clone() *Value
- func (me *ValueBinaryFile) GetBinaryFile() string
- func (me *ValueBinaryFile) GetRaw() any
- func (me *ValueBinaryFile) SetBinaryFile(value string)
- func (me *ValueBinaryFile) SetRaw(value any)
- type ValueBool
- type ValueChoice
- type ValueConstructor
- type ValueEntityList
- func (me *ValueEntityList) AsAnyPb() *anypb.Any
- func (me *ValueEntityList) AsString() string
- func (me *ValueEntityList) Clone() *Value
- func (me *ValueEntityList) GetEntityList() []EntityId
- func (me *ValueEntityList) GetRaw() any
- func (me *ValueEntityList) SetEntityList(value []EntityId)
- func (me *ValueEntityList) SetRaw(value any)
- type ValueEntityReference
- func (me *ValueEntityReference) AsAnyPb() *anypb.Any
- func (me *ValueEntityReference) AsString() string
- func (me *ValueEntityReference) Clone() *Value
- func (me *ValueEntityReference) GetEntityReference() EntityId
- func (me *ValueEntityReference) GetRaw() any
- func (me *ValueEntityReference) SetEntityReference(value EntityId)
- func (me *ValueEntityReference) SetRaw(value any)
- type ValueFloat
- type ValueInt
- type ValueString
- type ValueTimestamp
- func (me *ValueTimestamp) AsAnyPb() *anypb.Any
- func (me *ValueTimestamp) AsString() string
- func (me *ValueTimestamp) Clone() *Value
- func (me *ValueTimestamp) GetRaw() any
- func (me *ValueTimestamp) GetTimestamp() time.Time
- func (me *ValueTimestamp) SetRaw(value any)
- func (me *ValueTimestamp) SetTimestamp(value time.Time)
- type ValueType
- func (me *ValueType) As(o ValueType) *ValueType
- func (me ValueType) AsString() string
- func (me *ValueType) IsBinaryFile() bool
- func (me *ValueType) IsBool() bool
- func (me *ValueType) IsChoice() bool
- func (me *ValueType) IsEntityList() bool
- func (me *ValueType) IsEntityReference() bool
- func (me *ValueType) IsFloat() bool
- func (me *ValueType) IsInt() bool
- func (me *ValueType) IsNil() bool
- func (me *ValueType) IsString() bool
- func (me *ValueType) IsTimestamp() bool
- func (me ValueType) NewValue(args ...any) *Value
- func (me *ValueType) Type() ValueType
- type ValueTypeProvider
- type WriteEventArgs
- type WriteOpt
- type WriteTime
Constants ¶
View Source
const IndirectionDelimiter = "->"
Variables ¶
View Source
var ValueTypes = []ValueType{ VTInt, VTFloat, VTString, VTBool, VTBinaryFile, VTEntityReference, VTTimestamp, VTChoice, VTEntityList, }
Functions ¶
func AccumulateErrors ¶ added in v0.1.83
func CastEntityIdSliceToStringSlice ¶ added in v0.1.47
func CastToInterfaceSlice ¶ added in v0.1.47
func FileDecode ¶
func FileEncode ¶
Types ¶
type AnyPbConverter ¶ added in v0.1.47
type BinaryFileProvider ¶ added in v0.1.47
type BinaryFileProvider interface {
GetBinaryFile() string
}
type BinaryFileReceiver ¶ added in v0.1.47
type BinaryFileReceiver interface {
SetBinaryFile(value string)
}
type BoolProvider ¶ added in v0.1.47
type BoolProvider interface {
GetBool() bool
}
type BoolReceiver ¶ added in v0.1.47
type BoolReceiver interface {
SetBool(value bool)
}
type ChoiceProvider ¶ added in v0.1.47
type ChoiceProvider interface {
GetChoice() int
}
type ChoiceReceiver ¶ added in v0.1.47
type ChoiceReceiver interface {
SetChoice(value int)
}
type ConnectedArgs ¶ added in v0.1.47
type DisconnectedArgs ¶ added in v0.1.47
type Entity ¶
type Entity struct {
EntityId EntityId
EntityType EntityType
Fields map[FieldType]*Field
}
func (*Entity) ApplyOpts ¶ added in v0.1.47
func (me *Entity) ApplyOpts(opts ...EntityOpts) *Entity
func (*Entity) AsEntityPb ¶ added in v0.1.47
func (me *Entity) AsEntityPb() *qprotobufs.DatabaseEntity
func (*Entity) FromEntityPb ¶ added in v0.1.47
func (me *Entity) FromEntityPb(pb *qprotobufs.DatabaseEntity) *Entity
type EntityFieldValidator ¶
type EntityFieldValidator interface {
// RegisterEntityFields registers required fields for an entity type
RegisterEntityFields(entityType EntityType, fields ...FieldType)
// 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 EntityId ¶ added in v0.1.47
type EntityId string
func CastStringSliceToEntityIdSlice ¶ added in v0.1.47
func GenerateEntityId ¶ added in v0.1.83
func GenerateEntityId(entityType EntityType) EntityId
func (*EntityId) AsEntityReferencePb ¶ added in v0.1.47
func (me *EntityId) AsEntityReferencePb() *qprotobufs.EntityReference
func (*EntityId) AsStringPb ¶ added in v0.1.47
func (me *EntityId) AsStringPb() *qprotobufs.String
func (*EntityId) FromString ¶ added in v0.1.47
func (EntityId) GetEntityType ¶ added in v0.1.47
func (me EntityId) GetEntityType() EntityType
type EntityIdSlice ¶ added in v0.1.83
type EntityIdSlice []EntityId
func (EntityIdSlice) AsStringSlice ¶ added in v0.1.83
func (me EntityIdSlice) AsStringSlice() []string
func (EntityIdSlice) FromStringSlice ¶ added in v0.1.83
func (me EntityIdSlice) FromStringSlice(i []string) EntityIdSlice
type EntityListProvider ¶ added in v0.1.47
type EntityListProvider interface {
GetEntityList() []EntityId
}
type EntityListReceiver ¶ added in v0.1.47
type EntityListReceiver interface {
SetEntityList(value []EntityId)
}
type EntityOpts ¶ added in v0.1.47
type EntityOpts func(*Entity)
func EOEntityId ¶ added in v0.1.47
func EOEntityId(eid EntityId) EntityOpts
func EOEntityType ¶ added in v0.1.47
func EOEntityType(et EntityType) EntityOpts
func EOField ¶ added in v0.1.47
func EOField(fieldType FieldType, opts ...FieldOpts) EntityOpts
func EOFields ¶ added in v0.1.47
func EOFields(fields map[FieldType]*Field) EntityOpts
type EntityReferenceProvider ¶ added in v0.1.47
type EntityReferenceProvider interface {
GetEntityReference() EntityId
}
type EntityReferenceReceiver ¶ added in v0.1.47
type EntityReferenceReceiver interface {
SetEntityReference(value EntityId)
}
type EntitySchema ¶
type EntitySchema struct {
EntityType EntityType
Fields map[FieldType]*FieldSchema
}
func (*EntitySchema) ApplyOpts ¶ added in v0.1.47
func (me *EntitySchema) ApplyOpts(opts ...EntitySchemaOpts) *EntitySchema
func (*EntitySchema) AsBytes ¶ added in v0.1.83
func (me *EntitySchema) AsBytes() ([]byte, error)
func (*EntitySchema) AsEntitySchemaPb ¶ added in v0.1.47
func (me *EntitySchema) AsEntitySchemaPb() *qprotobufs.DatabaseEntitySchema
func (*EntitySchema) Clone ¶ added in v0.1.47
func (me *EntitySchema) Clone() *EntitySchema
func (*EntitySchema) Field ¶ added in v0.1.47
func (me *EntitySchema) Field(fieldType FieldType, opts ...FieldSchemaOpts) *FieldSchema
func (*EntitySchema) FromBytes ¶ added in v0.1.83
func (me *EntitySchema) FromBytes(data []byte) (*EntitySchema, error)
func (*EntitySchema) FromEntitySchemaPb ¶ added in v0.1.47
func (me *EntitySchema) FromEntitySchemaPb(pb *qprotobufs.DatabaseEntitySchema) *EntitySchema
func (*EntitySchema) Init ¶ added in v0.1.47
func (me *EntitySchema) Init(entityType EntityType, opts ...EntitySchemaOpts) *EntitySchema
type EntitySchemaOpts ¶ added in v0.1.47
type EntitySchemaOpts func(*EntitySchema)
func ESOEntityType ¶ added in v0.1.47
func ESOEntityType(et EntityType) EntitySchemaOpts
func ESOField ¶ added in v0.1.47
func ESOField(fieldType FieldType, opts ...FieldSchemaOpts) EntitySchemaOpts
func ESOFields ¶ added in v0.1.47
func ESOFields(fields map[FieldType]*FieldSchema) EntitySchemaOpts
type EntityType ¶ added in v0.1.47
type EntityType string
const ( ETRoot EntityType = "Root" ETFolder EntityType = "Folder" ETRole EntityType = "Role" ETUser EntityType = "User" ETClient EntityType = "Client" ETPermission EntityType = "Permission" ETAreaOfResponsibility EntityType = "AreaOfResponsibility" ETSessionController EntityType = "SessionController" )
func (EntityType) AsInt ¶ added in v0.1.121
func (me EntityType) AsInt() int64
func (EntityType) AsString ¶ added in v0.1.47
func (me EntityType) AsString() string
func (*EntityType) FromString ¶ added in v0.1.47
func (me *EntityType) FromString(s string) *EntityType
type EntityTypeSlice ¶ added in v0.1.83
type EntityTypeSlice []EntityType
func (EntityTypeSlice) AsStringSlice ¶ added in v0.1.83
func (me EntityTypeSlice) AsStringSlice() []string
func (EntityTypeSlice) FromStringSlice ¶ added in v0.1.83
func (me EntityTypeSlice) FromStringSlice(i []string) EntityTypeSlice
type Field ¶
type Field struct {
EntityId EntityId
FieldType FieldType
Value *Value
WriteTime WriteTime
WriterId EntityId
}
func (*Field) AsFieldPb ¶ added in v0.1.47
func (me *Field) AsFieldPb() *qprotobufs.DatabaseField
func (*Field) AsReadRequest ¶ added in v0.1.47
func (me *Field) AsReadRequest(opts ...RequestOpts) *Request
func (*Field) AsWriteRequest ¶ added in v0.1.47
func (me *Field) AsWriteRequest(opts ...RequestOpts) *Request
func (*Field) FromFieldPb ¶ added in v0.1.47
func (me *Field) FromFieldPb(pb *qprotobufs.DatabaseField) *Field
type FieldOpts ¶ added in v0.1.47
type FieldOpts func(*Field)
func FOEntityId ¶ added in v0.1.47
func FOFieldType ¶ added in v0.1.47
func FOWriterId ¶ added in v0.1.47
type FieldSchema ¶
type FieldSchema struct {
EntityType EntityType
FieldType FieldType
ValueType ValueType
Rank int
ReadPermissions EntityIdSlice
WritePermissions EntityIdSlice
Choices []string
}
func (*FieldSchema) ApplyOpts ¶ added in v0.1.47
func (me *FieldSchema) ApplyOpts(opts ...FieldSchemaOpts) *FieldSchema
func (*FieldSchema) AsFieldSchemaPb ¶ added in v0.1.47
func (me *FieldSchema) AsFieldSchemaPb() *qprotobufs.DatabaseFieldSchema
func (*FieldSchema) Clone ¶ added in v0.1.47
func (me *FieldSchema) Clone() *FieldSchema
func (*FieldSchema) FromFieldSchemaPb ¶ added in v0.1.47
func (me *FieldSchema) FromFieldSchemaPb(entityType EntityType, pb *qprotobufs.DatabaseFieldSchema) *FieldSchema
func (*FieldSchema) Init ¶ added in v0.1.47
func (me *FieldSchema) Init(entityType EntityType, fieldType FieldType, valueType ValueType, opts ...FieldSchemaOpts) *FieldSchema
type FieldSchemaOpts ¶ added in v0.1.47
type FieldSchemaOpts func(*FieldSchema)
func FSOChoices ¶ added in v0.1.47
func FSOChoices(choices ...string) FieldSchemaOpts
func FSOEntityType ¶ added in v0.1.47
func FSOEntityType(et EntityType) FieldSchemaOpts
func FSOFieldType ¶ added in v0.1.47
func FSOFieldType(ft FieldType) FieldSchemaOpts
func FSORank ¶ added in v0.1.51
func FSORank(rank int) FieldSchemaOpts
func FSOReadPermissions ¶ added in v0.1.47
func FSOReadPermissions(permissions []EntityId) FieldSchemaOpts
func FSOValueType ¶ added in v0.1.47
func FSOValueType(vt ValueType) FieldSchemaOpts
func FSOWritePermissions ¶ added in v0.1.47
func FSOWritePermissions(permissions []EntityId) FieldSchemaOpts
type FieldType ¶ added in v0.1.47
type FieldType string
const ( FTAreasOfResponsibilities FieldType = "AreasOfResponsibilities" FTChildren FieldType = "Children" FTDescription FieldType = "Description" FTEmail FieldType = "Email" FTEntityCreated FieldType = "EntityCreated" FTEntityDeleted FieldType = "EntityDeleted" FTFirstName FieldType = "FirstName" FTIdleMsPerSecond FieldType = "IdleMsPerSecond" FTIsEmailVerified FieldType = "IsEmailVerified" FTIsEnabled FieldType = "IsEnabled" FTJSON FieldType = "JSON" FTKeycloakId FieldType = "KeycloakId" FTLastEventTime FieldType = "LastEventTime" FTLastName FieldType = "LastName" FTLogLevel FieldType = "LogLevel" FTLogout FieldType = "Logout" FTName FieldType = "Name" FTParent FieldType = "Parent" FTPolicy FieldType = "Policy" FTQLibLogLevel FieldType = "QLibLogLevel" FTReadsPerSecond FieldType = "ReadsPerSecond" FTRoles FieldType = "Roles" FTSchemaChanged FieldType = "SchemaChanged" FTSourceOfTruth FieldType = "SourceOfTruth" FTWritesPerSecond FieldType = "WritesPerSecond" )
func (FieldType) AsIndirectionArray ¶ added in v0.1.47
func (FieldType) AsListIndex ¶ added in v0.1.47
func (*FieldType) FromString ¶ added in v0.1.47
func (FieldType) IsIndirection ¶ added in v0.1.47
func (FieldType) IsListIndex ¶ added in v0.1.47
type FieldTypeSlice ¶ added in v0.1.83
type FieldTypeSlice []FieldType
func (FieldTypeSlice) AsStringSlice ¶ added in v0.1.83
func (me FieldTypeSlice) AsStringSlice() []string
func (FieldTypeSlice) FromStringSlice ¶ added in v0.1.83
func (me FieldTypeSlice) FromStringSlice(i []string) FieldTypeSlice
type FloatProvider ¶ added in v0.1.47
type FloatProvider interface {
GetFloat() float64
}
type FloatReceiver ¶ added in v0.1.47
type FloatReceiver interface {
SetFloat(value float64)
}
type IndirectionResolver ¶
type IndirectionResolver interface {
Resolve(context.Context, EntityId, FieldType) (EntityId, FieldType, error)
}
func NewIndirectionResolver ¶ added in v0.1.47
func NewIndirectionResolver(store StoreInteractor) IndirectionResolver
type IntProvider ¶ added in v0.1.47
type IntProvider interface {
GetInt() int
}
type IntReceiver ¶ added in v0.1.47
type IntReceiver interface {
SetInt(value int)
}
type Notification ¶
type NotificationCallback ¶
type NotificationCallback interface {
Fn(context.Context, Notification)
Id() string
}
type NotificationConfig ¶
type NotificationConfig interface {
GetEntityId() EntityId
GetEntityType() EntityType
GetFieldType() FieldType
GetContextFields() []FieldType
GetNotifyOnChange() bool
GetServiceId() string
GetToken() string
IsDistributed() bool
SetEntityId(EntityId) NotificationConfig
SetEntityType(EntityType) NotificationConfig
SetFieldType(FieldType) NotificationConfig
SetContextFields(...FieldType) NotificationConfig
SetNotifyOnChange(bool) NotificationConfig
SetServiceId(string) NotificationConfig
SetDistributed(bool) NotificationConfig
}
type NotificationToken ¶
type PageConfig ¶ added in v0.1.47
func DefaultPageConfig ¶ added in v0.1.47
func DefaultPageConfig() *PageConfig
func (*PageConfig) ApplyOpts ¶ added in v0.1.47
func (me *PageConfig) ApplyOpts(opts ...PageOpts) *PageConfig
func (*PageConfig) IntoOpts ¶ added in v0.1.47
func (me *PageConfig) IntoOpts() []PageOpts
type PageOpts ¶ added in v0.1.47
type PageOpts func(*PageConfig)
func POCursorId ¶ added in v0.1.47
func POPageSize ¶ added in v0.1.47
type PageResult ¶ added in v0.1.47
type PageResult[T any] struct { Items []T CursorId int64 // Tracks the cursor ID for the next page. Negative means no more results. NextPage func(ctx context.Context) (*PageResult[T], error) Cleanup func() error // Optional cleanup function to be called when the page is done }
func (*PageResult[T]) Close ¶ added in v0.1.54
func (p *PageResult[T]) Close() error
func (*PageResult[T]) ForEach ¶ added in v0.1.48
func (p *PageResult[T]) ForEach(ctx context.Context, fn func(item T) bool)
func (*PageResult[T]) Get ¶ added in v0.1.47
func (p *PageResult[T]) Get() T
type ParsedQuery ¶ added in v0.1.47
type ParsedQuery struct {
Columns map[string]QueryColumn // Changed from slice to map keyed by FinalName
ColumnOrder []string
Tables map[string]QueryTable // Changed from slice to map keyed by FinalName
OriginalSQL string
From sqlparser.TableExprs
Where *sqlparser.Where
OrderBy sqlparser.OrderBy
GroupBy sqlparser.GroupBy
Having *sqlparser.Where
}
func ParseQuery ¶ added in v0.1.47
func ParseQuery(ctx context.Context, sql string, store StoreInteractor) (*ParsedQuery, error)
type PathResolver ¶ added in v0.1.48
func NewPathResolver ¶ added in v0.1.48
func NewPathResolver(store StoreInteractor) PathResolver
type PublishNotificationArgs ¶ added in v0.1.47
type QueryColumn ¶ added in v0.1.67
type QueryColumn struct {
ColumnName string
Alias string
Table QueryTable
SelectedName string
IsSelected bool
Order int // Add this field to track selection order
}
func (*QueryColumn) FieldType ¶ added in v0.1.67
func (me *QueryColumn) FieldType() FieldType
func (*QueryColumn) FinalName ¶ added in v0.1.67
func (me *QueryColumn) FinalName() string
func (*QueryColumn) QualifiedName ¶ added in v0.1.79
func (me *QueryColumn) QualifiedName() string
func (*QueryColumn) QualifiedNameWithQuotes ¶ added in v0.1.80
func (me *QueryColumn) QualifiedNameWithQuotes() string
type QueryEngineType ¶ added in v0.1.105
type QueryEngineType string
const (
QESqlite QueryEngineType = "sqlite"
)
type QueryRow ¶ added in v0.1.67
type QueryRow interface {
Get(column string) *Value
Set(column string, value *Value, selected bool)
Columns() []string
Selected() []string
SetOrder([]string)
IsSelected(column string) bool
AsQueryRowPb() *qprotobufs.QueryRow
FromQueryRowPb(row *qprotobufs.QueryRow)
AsEntity() *Entity
}
func NewQueryRow ¶ added in v0.1.67
func NewQueryRow() QueryRow
type QueryTable ¶ added in v0.1.47
func (*QueryTable) EntityType ¶ added in v0.1.47
func (me *QueryTable) EntityType() EntityType
func (*QueryTable) FinalName ¶ added in v0.1.67
func (me *QueryTable) FinalName() string
type RawProvider ¶ added in v0.1.47
type RawProvider interface {
GetRaw() any
}
type RawReceiver ¶ added in v0.1.47
type RawReceiver interface {
SetRaw(value any)
}
type ReadEventArgs ¶ added in v0.1.95
type Request ¶
type Request struct {
EntityId EntityId
FieldType FieldType
Value *Value
WriteOpt WriteOpt // optional
WriteTime *WriteTime // optional
WriterId *EntityId // optional
Success bool
Err error
}
func (*Request) ApplyOpts ¶ added in v0.1.47
func (me *Request) ApplyOpts(opts ...RequestOpts) *Request
func (*Request) AsRequestPb ¶ added in v0.1.47
func (me *Request) AsRequestPb() *qprotobufs.DatabaseRequest
func (*Request) FromRequestPb ¶ added in v0.1.48
func (me *Request) FromRequestPb(pb *qprotobufs.DatabaseRequest) *Request
type RequestOpts ¶ added in v0.1.47
type RequestOpts func(*Request)
func ROEntityId ¶ added in v0.1.47
func ROEntityId(id EntityId) RequestOpts
func ROFieldType ¶ added in v0.1.47
func ROFieldType(ft FieldType) RequestOpts
func ROValue ¶ added in v0.1.47
func ROValue(v *Value) RequestOpts
func ROValuePtr ¶ added in v0.1.58
func ROValuePtr(v *Value) RequestOpts
func ROWriteChanges ¶ added in v0.1.47
func ROWriteChanges() RequestOpts
func ROWriteNormal ¶ added in v0.1.47
func ROWriteNormal() RequestOpts
func ROWriteTime ¶ added in v0.1.47
func ROWriteTime[T time.Time | WriteTime](t T) RequestOpts
func ROWriteTimePtr ¶ added in v0.1.47
func ROWriteTimePtr(t *WriteTime) RequestOpts
func ROWriterId ¶ added in v0.1.47
func ROWriterId(id EntityId) RequestOpts
func ROWriterIdPtr ¶ added in v0.1.47
func ROWriterIdPtr(id *EntityId) RequestOpts
type SQLiteBuilder ¶ added in v0.1.47
type SQLiteBuilder struct {
// contains filtered or unexported fields
}
func NewSQLiteBuilder ¶ added in v0.1.47
func NewSQLiteBuilder(store StoreInteractor) (*SQLiteBuilder, error)
func (*SQLiteBuilder) Close ¶ added in v0.1.54
func (me *SQLiteBuilder) Close() error
Close releases resources used by the SQLiteBuilder
func (*SQLiteBuilder) QueryWithPagination ¶ added in v0.1.47
func (me *SQLiteBuilder) QueryWithPagination(ctx context.Context, query *ParsedQuery, pageSize int64, cursorId int64, opts ...TypeHintOpts) (*PageResult[QueryRow], error)
type Snapshot ¶
type Snapshot struct {
Entities []*Entity
Fields []*Field
Schemas []*EntitySchema
}
func (*Snapshot) ApplyOpts ¶ added in v0.1.47
func (me *Snapshot) ApplyOpts(opts ...SnapshotOpts) *Snapshot
func (*Snapshot) AsSnapshotPb ¶ added in v0.1.47
func (me *Snapshot) AsSnapshotPb() *qprotobufs.DatabaseSnapshot
func (*Snapshot) FromSnapshotPb ¶ added in v0.1.47
func (me *Snapshot) FromSnapshotPb(pb *qprotobufs.DatabaseSnapshot) *Snapshot
func (*Snapshot) Init ¶ added in v0.1.47
func (me *Snapshot) Init(opts ...SnapshotOpts) *Snapshot
type SnapshotOpts ¶ added in v0.1.47
type SnapshotOpts func(*Snapshot)
func SOEntities ¶ added in v0.1.47
func SOEntities(entities ...*Entity) SnapshotOpts
func SOFields ¶ added in v0.1.47
func SOFields(fields ...*Field) SnapshotOpts
func SOSchemas ¶ added in v0.1.47
func SOSchemas(schemas ...*EntitySchema) SnapshotOpts
type Store ¶
type Store struct {
StoreConnector
StoreInteractor
StoreNotifier
}
type StoreConnector ¶ added in v0.1.47
type StoreInteractor ¶ added in v0.1.47
type StoreInteractor interface {
CreateEntity(ctx context.Context, eType EntityType, parentId EntityId, name string) (*Entity, error)
DeleteEntity(context.Context, EntityId) error
PrepareQuery(sql string, args ...any) (*PageResult[QueryRow], error)
Find(ctx context.Context, entityType EntityType, fieldTypes []FieldType, conditionFns ...interface{}) ([]*Entity, error)
FindEntities(entityType EntityType, pageOpts ...PageOpts) (*PageResult[EntityId], error)
GetEntityTypes(pageOpts ...PageOpts) (*PageResult[EntityType], error)
EntityExists(context.Context, EntityId) (bool, error)
FieldExists(context.Context, EntityType, FieldType) (bool, error)
GetEntitySchema(context.Context, EntityType) (*EntitySchema, error)
SetEntitySchema(context.Context, *EntitySchema) error
GetFieldSchema(context.Context, EntityType, FieldType) (*FieldSchema, error)
SetFieldSchema(context.Context, EntityType, FieldType, *FieldSchema) error
Read(context.Context, ...*Request) error
Write(context.Context, ...*Request) error
InitializeSchema(ctx context.Context) error
CreateSnapshot(ctx context.Context) (*Snapshot, error)
RestoreSnapshot(ctx context.Context, ss *Snapshot) error
PublishNotifications() qss.Signal[PublishNotificationArgs]
WriteEvent() qss.Signal[WriteEventArgs]
ReadEvent() qss.Signal[ReadEventArgs]
InteractorConnected() qss.Signal[ConnectedArgs]
InteractorDisconnected() qss.Signal[DisconnectedArgs]
}
type StoreNotifier ¶ added in v0.1.47
type StoreNotifier interface {
Notify(ctx context.Context, config NotificationConfig, callback NotificationCallback) (NotificationToken, error)
Unnotify(ctx context.Context, subscriptionId string) error
UnnotifyCallback(ctx context.Context, subscriptionId string, callback NotificationCallback) error
NotifierConnected() qss.Signal[ConnectedArgs]
NotifierDisconnected() qss.Signal[DisconnectedArgs]
}
type StringConverter ¶ added in v0.1.47
type StringConverter interface {
AsString() string
}
type StringProvider ¶ added in v0.1.47
type StringProvider interface {
GetString() string
}
type StringReceiver ¶ added in v0.1.47
type StringReceiver interface {
SetString(value string)
}
type TimestampProvider ¶ added in v0.1.47
type TimestampReceiver ¶ added in v0.1.47
type TypeHintMap ¶ added in v0.1.47
func (TypeHintMap) ApplyOpts ¶ added in v0.1.47
func (me TypeHintMap) ApplyOpts(opts ...TypeHintOpts) TypeHintMap
type TypeHintOpts ¶ added in v0.1.47
type TypeHintOpts func(TypeHintMap)
func TypeHint ¶ added in v0.1.47
func TypeHint(columnName string, vt ValueType) TypeHintOpts
type Value ¶
type Value struct {
ValueConstructor
AnyPbConverter
StringConverter
ValueTypeProvider
RawProvider
IntProvider
FloatProvider
StringProvider
BoolProvider
BinaryFileProvider
EntityReferenceProvider
TimestampProvider
ChoiceProvider
EntityListProvider
RawReceiver
IntReceiver
FloatReceiver
StringReceiver
BoolReceiver
BinaryFileReceiver
EntityReferenceReceiver
TimestampReceiver
ChoiceReceiver
EntityListReceiver
}
func NewBinaryFile ¶ added in v0.1.47
func NewEntityList ¶ added in v0.1.47
func NewEntityReference ¶ added in v0.1.47
func NewTimestamp ¶ added in v0.1.47
func (*Value) FromBinaryFile ¶ added in v0.1.47
func (*Value) FromChoice ¶ added in v0.1.47
func (*Value) FromEntityList ¶ added in v0.1.47
func (*Value) FromEntityReference ¶ added in v0.1.47
func (*Value) FromString ¶ added in v0.1.47
type ValueBinaryFile ¶ added in v0.1.47
type ValueBinaryFile struct {
Value []byte
}
func (*ValueBinaryFile) AsAnyPb ¶ added in v0.1.47
func (me *ValueBinaryFile) AsAnyPb() *anypb.Any
func (*ValueBinaryFile) AsString ¶ added in v0.1.47
func (me *ValueBinaryFile) AsString() string
func (*ValueBinaryFile) Clone ¶ added in v0.1.47
func (me *ValueBinaryFile) Clone() *Value
func (*ValueBinaryFile) GetBinaryFile ¶ added in v0.1.47
func (me *ValueBinaryFile) GetBinaryFile() string
func (*ValueBinaryFile) GetRaw ¶ added in v0.1.47
func (me *ValueBinaryFile) GetRaw() any
func (*ValueBinaryFile) SetBinaryFile ¶ added in v0.1.47
func (me *ValueBinaryFile) SetBinaryFile(value string)
func (*ValueBinaryFile) SetRaw ¶ added in v0.1.47
func (me *ValueBinaryFile) SetRaw(value any)
type ValueChoice ¶ added in v0.1.47
type ValueChoice struct {
Value int
}
func (*ValueChoice) AsAnyPb ¶ added in v0.1.47
func (me *ValueChoice) AsAnyPb() *anypb.Any
func (*ValueChoice) AsString ¶ added in v0.1.47
func (me *ValueChoice) AsString() string
func (*ValueChoice) Clone ¶ added in v0.1.47
func (me *ValueChoice) Clone() *Value
func (*ValueChoice) GetChoice ¶ added in v0.1.47
func (me *ValueChoice) GetChoice() int
func (*ValueChoice) GetRaw ¶ added in v0.1.47
func (me *ValueChoice) GetRaw() any
func (*ValueChoice) SetChoice ¶ added in v0.1.47
func (me *ValueChoice) SetChoice(value int)
func (*ValueChoice) SetRaw ¶ added in v0.1.47
func (me *ValueChoice) SetRaw(value any)
type ValueConstructor ¶ added in v0.1.47
type ValueConstructor interface {
Clone() *Value
}
type ValueEntityList ¶ added in v0.1.47
type ValueEntityList struct {
Value []EntityId
}
func (*ValueEntityList) AsAnyPb ¶ added in v0.1.47
func (me *ValueEntityList) AsAnyPb() *anypb.Any
func (*ValueEntityList) AsString ¶ added in v0.1.47
func (me *ValueEntityList) AsString() string
func (*ValueEntityList) Clone ¶ added in v0.1.47
func (me *ValueEntityList) Clone() *Value
func (*ValueEntityList) GetEntityList ¶ added in v0.1.47
func (me *ValueEntityList) GetEntityList() []EntityId
func (*ValueEntityList) GetRaw ¶ added in v0.1.47
func (me *ValueEntityList) GetRaw() any
func (*ValueEntityList) SetEntityList ¶ added in v0.1.47
func (me *ValueEntityList) SetEntityList(value []EntityId)
func (*ValueEntityList) SetRaw ¶ added in v0.1.47
func (me *ValueEntityList) SetRaw(value any)
type ValueEntityReference ¶ added in v0.1.47
type ValueEntityReference struct {
Value EntityId
}
func (*ValueEntityReference) AsAnyPb ¶ added in v0.1.47
func (me *ValueEntityReference) AsAnyPb() *anypb.Any
func (*ValueEntityReference) AsString ¶ added in v0.1.47
func (me *ValueEntityReference) AsString() string
func (*ValueEntityReference) Clone ¶ added in v0.1.47
func (me *ValueEntityReference) Clone() *Value
func (*ValueEntityReference) GetEntityReference ¶ added in v0.1.47
func (me *ValueEntityReference) GetEntityReference() EntityId
func (*ValueEntityReference) GetRaw ¶ added in v0.1.47
func (me *ValueEntityReference) GetRaw() any
func (*ValueEntityReference) SetEntityReference ¶ added in v0.1.47
func (me *ValueEntityReference) SetEntityReference(value EntityId)
func (*ValueEntityReference) SetRaw ¶ added in v0.1.47
func (me *ValueEntityReference) SetRaw(value any)
type ValueFloat ¶ added in v0.1.47
type ValueFloat struct {
Value float64
}
func (*ValueFloat) AsAnyPb ¶ added in v0.1.47
func (me *ValueFloat) AsAnyPb() *anypb.Any
func (*ValueFloat) AsString ¶ added in v0.1.47
func (me *ValueFloat) AsString() string
func (*ValueFloat) Clone ¶ added in v0.1.47
func (me *ValueFloat) Clone() *Value
func (*ValueFloat) GetFloat ¶ added in v0.1.47
func (me *ValueFloat) GetFloat() float64
func (*ValueFloat) GetRaw ¶ added in v0.1.47
func (me *ValueFloat) GetRaw() any
func (*ValueFloat) SetFloat ¶ added in v0.1.47
func (me *ValueFloat) SetFloat(value float64)
func (*ValueFloat) SetRaw ¶ added in v0.1.47
func (me *ValueFloat) SetRaw(value any)
type ValueString ¶ added in v0.1.47
type ValueString struct {
Value string
}
func (*ValueString) AsAnyPb ¶ added in v0.1.47
func (me *ValueString) AsAnyPb() *anypb.Any
func (*ValueString) AsString ¶ added in v0.1.47
func (me *ValueString) AsString() string
func (*ValueString) Clone ¶ added in v0.1.47
func (me *ValueString) Clone() *Value
func (*ValueString) GetRaw ¶ added in v0.1.47
func (me *ValueString) GetRaw() any
func (*ValueString) GetString ¶ added in v0.1.47
func (me *ValueString) GetString() string
func (*ValueString) SetRaw ¶ added in v0.1.47
func (me *ValueString) SetRaw(value any)
func (*ValueString) SetString ¶ added in v0.1.47
func (me *ValueString) SetString(value string)
type ValueTimestamp ¶ added in v0.1.47
func (*ValueTimestamp) AsAnyPb ¶ added in v0.1.47
func (me *ValueTimestamp) AsAnyPb() *anypb.Any
func (*ValueTimestamp) AsString ¶ added in v0.1.47
func (me *ValueTimestamp) AsString() string
func (*ValueTimestamp) Clone ¶ added in v0.1.47
func (me *ValueTimestamp) Clone() *Value
func (*ValueTimestamp) GetRaw ¶ added in v0.1.47
func (me *ValueTimestamp) GetRaw() any
func (*ValueTimestamp) GetTimestamp ¶ added in v0.1.47
func (me *ValueTimestamp) GetTimestamp() time.Time
func (*ValueTimestamp) SetRaw ¶ added in v0.1.47
func (me *ValueTimestamp) SetRaw(value any)
func (*ValueTimestamp) SetTimestamp ¶ added in v0.1.47
func (me *ValueTimestamp) SetTimestamp(value time.Time)
type ValueType ¶ added in v0.1.47
type ValueType string
const ( VTInt ValueType = "int" VTFloat ValueType = "float" VTString ValueType = "string" VTBool ValueType = "bool" VTBinaryFile ValueType = "binaryFile" VTEntityReference ValueType = "entityReference" VTTimestamp ValueType = "timestamp" VTChoice ValueType = "choice" VTEntityList ValueType = "entityList" )
func (*ValueType) IsBinaryFile ¶ added in v0.1.47
func (*ValueType) IsEntityList ¶ added in v0.1.47
func (*ValueType) IsEntityReference ¶ added in v0.1.47
func (*ValueType) IsTimestamp ¶ added in v0.1.47
type ValueTypeProvider ¶ added in v0.1.47
type WriteEventArgs ¶ added in v0.1.95
type WriteTime ¶ added in v0.1.47
func (*WriteTime) AsTimestampPb ¶ added in v0.1.47
func (me *WriteTime) AsTimestampPb() *qprotobufs.Timestamp
func (*WriteTime) AsTimestampPb2 ¶ added in v0.1.47
func (me *WriteTime) AsTimestampPb2() *timestamppb.Timestamp
func (*WriteTime) FromUnixNanos ¶ added in v0.1.48
Source Files
¶
- common.go
- indirection_resolver.go
- known_entity_types.go
- known_field_types.go
- notification.go
- path_resolver.go
- query.go
- snapshot.go
- store.go
- validator.go
- value.go
- value_binary_file.go
- value_bool.go
- value_choice.go
- value_entity_list.go
- value_entity_reference.go
- value_float.go
- value_int.go
- value_string.go
- value_timestamp.go
- value_type.go
Click to show internal directories.
Click to hide internal directories.