...

Package shared

import "bitbucket.org/twicedb/twicedb-go/client/shared"
Overview
Index

Overview ▾

Package shared provides things that are used in several client modules.

Index ▾

type AddableField
    func NewBoolAddableField(name FieldName, b bool) *AddableField
    func NewByteAddableField(name FieldName, b byte) *AddableField
    func NewComplex128AddableField(name FieldName, c complex128) *AddableField
    func NewComplex64AddableField(name FieldName, c complex64) *AddableField
    func NewFloat32AddableField(name FieldName, f float32) *AddableField
    func NewFloat64AddableField(name FieldName, f float64) *AddableField
    func NewInt16AddableField(name FieldName, i int16) *AddableField
    func NewInt32AddableField(name FieldName, i int32) *AddableField
    func NewInt64AddableField(name FieldName, i int64) *AddableField
    func NewInt8AddableField(name FieldName, i int8) *AddableField
    func NewIntAddableField(name FieldName, i int) *AddableField
    func NewRuneAddableField(name FieldName, r rune) *AddableField
    func NewStringAddableField(name FieldName, s string) *AddableField
    func NewTimeAddableField(name FieldName, t time.Time) *AddableField
    func NewUint16AddableField(name FieldName, u uint16) *AddableField
    func NewUint32AddableField(name FieldName, u uint32) *AddableField
    func NewUint64AddableField(name FieldName, u uint64) *AddableField
    func NewUint8AddableField(name FieldName, u uint8) *AddableField
    func NewUintAddableField(name FieldName, u uint) *AddableField
    func (af *AddableField) Value() any
type EntitleEntitlement
type FieldName
type ReadAsyncRequest
type ReadAsyncResponse
type ReadEntitlement
type ReadObject
    func NewReadObject(err error, oid shared.ObjectId, lastWrite shared.Tt, ttFrom shared.Tt, ttTo shared.Tt, vtFrom shared.Vt, vtTo shared.Vt, ttResolvedAt shared.Tt, vtResolvedAt shared.Vt, timesliceId shared.TimesliceId, fqn shared.Fqn, blob *shared.Blob) *ReadObject
type ServerStatus
    func NewServerStatus(gitRevision string) *ServerStatus
type ServerType
type SubscribeResponse
    func (sr *SubscribeResponse) IsZero() bool
type SubscriptionId
type WriteAsyncRequest
type WriteAsyncResponse
type WriteEntitlement
type WrittenObject
    func NewWrittenObject(err error, oid shared.ObjectId, lastWrite shared.Tt) *WrittenObject
type WrittenTransaction
    func NewWrittenTransaction(err error, tt shared.Tt, writtenObjects []*WrittenObject) *WrittenTransaction

Package files

addable_field.go doc.go entitlements.go field_name.go read_async_request.go read_async_response.go read_object.go server_status.go server_type.go subscribe_response.go subscription_id.go write_async_request.go write_async_response.go written_object.go written_transaction.go

type AddableField

AddableField represents a field that should be added to all objects of a given type that do not have a field matching Name. This is useful if some data is persisted, then a migration to add a new field is required. Rather than rewriting all existing data, a default value can be added by specifying an AddableField.

type AddableField struct {
    Name          FieldName
    BoolVal       *bool
    StringVal     *string
    IntVal        *int
    Int8Val       *int8
    Int16Val      *int16
    Int32Val      *int32
    Int64Val      *int64
    UintVal       *uint
    Uint8Val      *uint8
    Uint16Val     *uint16
    Uint32Val     *uint32
    Uint64Val     *uint64
    ByteVal       *byte
    RuneVal       *rune
    Float32Val    *float32
    Float64Val    *float64
    Complex64Val  *complex64
    Complex128Val *complex128
    TimeVal       *time.Time
}

func NewBoolAddableField

func NewBoolAddableField(name FieldName, b bool) *AddableField

func NewByteAddableField

func NewByteAddableField(name FieldName, b byte) *AddableField

func NewComplex128AddableField

func NewComplex128AddableField(name FieldName, c complex128) *AddableField

func NewComplex64AddableField

func NewComplex64AddableField(name FieldName, c complex64) *AddableField

func NewFloat32AddableField

func NewFloat32AddableField(name FieldName, f float32) *AddableField

func NewFloat64AddableField

func NewFloat64AddableField(name FieldName, f float64) *AddableField

func NewInt16AddableField

func NewInt16AddableField(name FieldName, i int16) *AddableField

func NewInt32AddableField

func NewInt32AddableField(name FieldName, i int32) *AddableField

func NewInt64AddableField

func NewInt64AddableField(name FieldName, i int64) *AddableField

func NewInt8AddableField

func NewInt8AddableField(name FieldName, i int8) *AddableField

func NewIntAddableField

func NewIntAddableField(name FieldName, i int) *AddableField

func NewRuneAddableField

func NewRuneAddableField(name FieldName, r rune) *AddableField

func NewStringAddableField

func NewStringAddableField(name FieldName, s string) *AddableField

func NewTimeAddableField

func NewTimeAddableField(name FieldName, t time.Time) *AddableField

func NewUint16AddableField

func NewUint16AddableField(name FieldName, u uint16) *AddableField

func NewUint32AddableField

func NewUint32AddableField(name FieldName, u uint32) *AddableField

func NewUint64AddableField

func NewUint64AddableField(name FieldName, u uint64) *AddableField

func NewUint8AddableField

func NewUint8AddableField(name FieldName, u uint8) *AddableField

func NewUintAddableField

func NewUintAddableField(name FieldName, u uint) *AddableField

func (*AddableField) Value

func (af *AddableField) Value() any

type EntitleEntitlement

type EntitleEntitlement int8
const (
    CannotEntitle EntitleEntitlement = iota
    CanEntitle
)

type FieldName

type FieldName string

type ReadAsyncRequest

type ReadAsyncRequest struct {
    ReadRequest *readerp.ReadRequest
    Ch          chan ReadAsyncResponse
}

type ReadAsyncResponse

type ReadAsyncResponse struct {
    Event               main_shared.Event
    ReadObjects         []*ReadObject
    ServerStatus        *ServerStatus
    AggregationResponse *big.Rat
    AggregationExists   bool
    Error               error
}

type ReadEntitlement

type ReadEntitlement int8
const (
    CannotRead ReadEntitlement = iota
    CanRead
)

type ReadObject

type ReadObject struct {
    Error        error
    ObjectId     shared.ObjectId
    LastWrite    shared.Tt
    TtFrom       shared.Tt
    TtTo         shared.Tt
    VtFrom       shared.Vt
    VtTo         shared.Vt
    TtResolvedAt shared.Tt
    VtResolvedAt shared.Vt
    TimesliceId  shared.TimesliceId
    Fqn          shared.Fqn
    Blob         *shared.Blob
}

func NewReadObject

func NewReadObject(err error, oid shared.ObjectId, lastWrite shared.Tt, ttFrom shared.Tt, ttTo shared.Tt, vtFrom shared.Vt, vtTo shared.Vt, ttResolvedAt shared.Tt, vtResolvedAt shared.Vt, timesliceId shared.TimesliceId, fqn shared.Fqn, blob *shared.Blob) *ReadObject

type ServerStatus

type ServerStatus struct {
    GitRevision string
}

func NewServerStatus

func NewServerStatus(gitRevision string) *ServerStatus

type ServerType

type ServerType int8
const (
    ReaderServerType ServerType = iota
    WriterServerType
)

type SubscribeResponse

type SubscribeResponse struct {
    Tt             shared.Tt
    Vt             shared.Vt
    SubscriptionId SubscriptionId
}

func (*SubscribeResponse) IsZero

func (sr *SubscribeResponse) IsZero() bool

type SubscriptionId

type SubscriptionId int64

type WriteAsyncRequest

type WriteAsyncRequest struct {
    WriteRequest *writerp.WriteRequest
    Ch           chan WriteAsyncResponse
}

type WriteAsyncResponse

type WriteAsyncResponse struct {
    WrittenTransactions []*WrittenTransaction
    Error               error
}

type WriteEntitlement

type WriteEntitlement int8
const (
    CannotWrite WriteEntitlement = iota
    CanWrite
)

type WrittenObject

type WrittenObject struct {
    Error     error
    ObjectId  shared.ObjectId
    LastWrite shared.Tt
}

func NewWrittenObject

func NewWrittenObject(err error, oid shared.ObjectId, lastWrite shared.Tt) *WrittenObject

type WrittenTransaction

type WrittenTransaction struct {
    Error          error
    Tt             shared.Tt
    WrittenObjects []*WrittenObject
}

func NewWrittenTransaction

func NewWrittenTransaction(err error, tt shared.Tt, writtenObjects []*WrittenObject) *WrittenTransaction