Documentation ¶
Overview ¶
Package interfaces defines internal interfaces for various objects in the Syncbase server implementation. Defining these interfaces in a separate package helps prevent import cycles: all other packages can import the interfaces package, and individual modules can pass each other interfaces to enable bidirectional cross-package communication.
Index ¶
- Constants
- Variables
- func NewErrBrokenCrConnection(ctx *context.T) error
- func NewErrConnFail(ctx *context.T) error
- func NewErrDbOffline(ctx *context.T, dbId syncbase.Id) error
- func NewErrDupSyncgroupPublish(ctx *context.T, name string) error
- func NewErrGetTimeFailed(ctx *context.T) error
- func NewErrNotAdmin(ctx *context.T) error
- func VDLReadDeltaReq(dec vdl.Decoder, x *DeltaReq) error
- func VDLReadDeltaResp(dec vdl.Decoder, x *DeltaResp) error
- type BlobSharesBySyncgroup
- func (m *BlobSharesBySyncgroup) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *BlobSharesBySyncgroup) MakeVDLTarget() vdl.Target
- func (x BlobSharesBySyncgroup) VDLIsZero() bool
- func (x *BlobSharesBySyncgroup) VDLRead(dec vdl.Decoder) error
- func (x BlobSharesBySyncgroup) VDLWrite(enc vdl.Encoder) error
- type BlobSharesBySyncgroupTarget
- func (t *BlobSharesBySyncgroupTarget) FinishField(key, field vdl.Target) error
- func (t *BlobSharesBySyncgroupTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)
- func (t *BlobSharesBySyncgroupTarget) FinishMap(elem vdl.MapTarget) error
- func (t *BlobSharesBySyncgroupTarget) StartKey() (key vdl.Target, _ error)
- func (t *BlobSharesBySyncgroupTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, error)
- type ChunkData
- type ChunkDataTarget
- func (t *ChunkDataTarget) FinishField(_, _ vdl.Target) error
- func (t *ChunkDataTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *ChunkDataTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *ChunkDataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *ChunkDataTarget) ZeroField(name string) error
- type ChunkHash
- type ChunkHashTarget
- func (t *ChunkHashTarget) FinishField(_, _ vdl.Target) error
- func (t *ChunkHashTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *ChunkHashTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *ChunkHashTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *ChunkHashTarget) ZeroField(name string) error
- type DataDeltaReq
- type DataDeltaReqTarget
- func (t *DataDeltaReqTarget) FinishField(_, _ vdl.Target) error
- func (t *DataDeltaReqTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *DataDeltaReqTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *DataDeltaReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *DataDeltaReqTarget) ZeroField(name string) error
- type Database
- type DeltaFinalResp
- type DeltaFinalRespTarget
- func (t *DeltaFinalRespTarget) FinishField(_, _ vdl.Target) error
- func (t *DeltaFinalRespTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *DeltaFinalRespTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *DeltaFinalRespTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *DeltaFinalRespTarget) ZeroField(name string) error
- type DeltaReq
- type DeltaReqData
- func (m DeltaReqData) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (x DeltaReqData) Index() int
- func (x DeltaReqData) Interface() interface{}
- func (m DeltaReqData) MakeVDLTarget() vdl.Target
- func (x DeltaReqData) Name() string
- func (x DeltaReqData) VDLIsZero() bool
- func (x DeltaReqData) VDLWrite(enc vdl.Encoder) error
- type DeltaReqSgs
- func (m DeltaReqSgs) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (x DeltaReqSgs) Index() int
- func (x DeltaReqSgs) Interface() interface{}
- func (m DeltaReqSgs) MakeVDLTarget() vdl.Target
- func (x DeltaReqSgs) Name() string
- func (x DeltaReqSgs) VDLIsZero() bool
- func (x DeltaReqSgs) VDLWrite(enc vdl.Encoder) error
- type DeltaReqTarget
- type DeltaResp
- type DeltaRespGvs
- func (m DeltaRespGvs) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (x DeltaRespGvs) Index() int
- func (x DeltaRespGvs) Interface() interface{}
- func (m DeltaRespGvs) MakeVDLTarget() vdl.Target
- func (x DeltaRespGvs) Name() string
- func (x DeltaRespGvs) VDLIsZero() bool
- func (x DeltaRespGvs) VDLWrite(enc vdl.Encoder) error
- type DeltaRespRec
- func (m DeltaRespRec) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (x DeltaRespRec) Index() int
- func (x DeltaRespRec) Interface() interface{}
- func (m DeltaRespRec) MakeVDLTarget() vdl.Target
- func (x DeltaRespRec) Name() string
- func (x DeltaRespRec) VDLIsZero() bool
- func (x DeltaRespRec) VDLWrite(enc vdl.Encoder) error
- type DeltaRespTarget
- type GenVector
- func (a GenVector) Compare(b GenVector) int
- func (in GenVector) DeepCopy() GenVector
- func (m *GenVector) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *GenVector) MakeVDLTarget() vdl.Target
- func (x GenVector) VDLIsZero() bool
- func (x *GenVector) VDLRead(dec vdl.Decoder) error
- func (x GenVector) VDLWrite(enc vdl.Encoder) error
- type GenVectorTarget
- func (t *GenVectorTarget) FinishField(key, field vdl.Target) error
- func (t *GenVectorTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)
- func (t *GenVectorTarget) FinishMap(elem vdl.MapTarget) error
- func (t *GenVectorTarget) StartKey() (key vdl.Target, _ error)
- func (t *GenVectorTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, error)
- type GroupId
- type GroupIdTarget
- type Knowledge
- type KnowledgeTarget
- func (t *KnowledgeTarget) FinishField(key, field vdl.Target) error
- func (t *KnowledgeTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)
- func (t *KnowledgeTarget) FinishMap(elem vdl.MapTarget) error
- func (t *KnowledgeTarget) StartKey() (key vdl.Target, _ error)
- func (t *KnowledgeTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, error)
- type LocationData
- type LocationDataTarget
- func (t *LocationDataTarget) FinishField(_, _ vdl.Target) error
- func (t *LocationDataTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *LocationDataTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *LocationDataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *LocationDataTarget) ZeroField(name string) error
- type LogRec
- type LogRecMetadata
- type LogRecMetadataTarget
- func (t *LogRecMetadataTarget) FinishField(_, _ vdl.Target) error
- func (t *LogRecMetadataTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *LogRecMetadataTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *LogRecMetadataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *LogRecMetadataTarget) ZeroField(name string) error
- type LogRecTarget
- func (t *LogRecTarget) FinishField(_, _ vdl.Target) error
- func (t *LogRecTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *LogRecTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *LogRecTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *LogRecTarget) ZeroField(name string) error
- type PeerToLocationDataMap
- func (m *PeerToLocationDataMap) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *PeerToLocationDataMap) MakeVDLTarget() vdl.Target
- func (x PeerToLocationDataMap) VDLIsZero() bool
- func (x *PeerToLocationDataMap) VDLRead(dec vdl.Decoder) error
- func (x PeerToLocationDataMap) VDLWrite(enc vdl.Encoder) error
- type PeerToLocationDataMapTarget
- func (t *PeerToLocationDataMapTarget) FinishField(key, field vdl.Target) error
- func (t *PeerToLocationDataMapTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)
- func (t *PeerToLocationDataMapTarget) FinishMap(elem vdl.MapTarget) error
- func (t *PeerToLocationDataMapTarget) StartKey() (key vdl.Target, _ error)
- func (t *PeerToLocationDataMapTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, error)
- type Service
- type SgDeltaReq
- type SgDeltaReqTarget
- func (t *SgDeltaReqTarget) FinishField(_, _ vdl.Target) error
- func (t *SgDeltaReqTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *SgDeltaReqTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *SgDeltaReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *SgDeltaReqTarget) ZeroField(name string) error
- type SgPriorities
- type SgPrioritiesTarget
- func (t *SgPrioritiesTarget) FinishField(key, field vdl.Target) error
- func (t *SgPrioritiesTarget) FinishKeyStartField(key vdl.Target) (field vdl.Target, _ error)
- func (t *SgPrioritiesTarget) FinishMap(elem vdl.MapTarget) error
- func (t *SgPrioritiesTarget) StartKey() (key vdl.Target, _ error)
- func (t *SgPrioritiesTarget) StartMap(tt *vdl.Type, len int) (vdl.MapTarget, error)
- type SgPriority
- type SgPriorityTarget
- func (t *SgPriorityTarget) FinishField(_, _ vdl.Target) error
- func (t *SgPriorityTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *SgPriorityTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *SgPriorityTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *SgPriorityTarget) ZeroField(name string) error
- type Signpost
- type SignpostTarget
- func (t *SignpostTarget) FinishField(_, _ vdl.Target) error
- func (t *SignpostTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *SignpostTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *SignpostTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *SignpostTarget) ZeroField(name string) error
- type SyncClientMethods
- type SyncClientStub
- type SyncFetchBlobClientCall
- type SyncFetchBlobClientStream
- type SyncFetchBlobRecipeClientCall
- type SyncFetchBlobRecipeClientStream
- type SyncFetchBlobRecipeServerCall
- type SyncFetchBlobRecipeServerCallStub
- type SyncFetchBlobRecipeServerStream
- type SyncFetchBlobServerCall
- type SyncFetchBlobServerCallStub
- type SyncFetchBlobServerStream
- type SyncFetchChunksClientCall
- type SyncFetchChunksClientStream
- type SyncFetchChunksServerCall
- type SyncFetchChunksServerCallStub
- type SyncFetchChunksServerStream
- type SyncGetDeltasClientCall
- type SyncGetDeltasClientStream
- type SyncGetDeltasServerCall
- type SyncGetDeltasServerCallStub
- type SyncGetDeltasServerStream
- type SyncServerMethods
- type SyncServerStub
- type SyncServerStubMethods
- type Syncgroup
- type SyncgroupStatus
- func (m *SyncgroupStatus) FillVDLTarget(t vdl.Target, tt *vdl.Type) error
- func (m *SyncgroupStatus) MakeVDLTarget() vdl.Target
- func (x *SyncgroupStatus) Set(label string) error
- func (x SyncgroupStatus) String() string
- func (x SyncgroupStatus) VDLIsZero() bool
- func (x *SyncgroupStatus) VDLRead(dec vdl.Decoder) error
- func (x SyncgroupStatus) VDLWrite(enc vdl.Encoder) error
- type SyncgroupStatusTarget
- type SyncgroupTarget
- func (t *SyncgroupTarget) FinishField(_, _ vdl.Target) error
- func (t *SyncgroupTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *SyncgroupTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *SyncgroupTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *SyncgroupTarget) ZeroField(name string) error
- type TimeReq
- type TimeReqTarget
- func (t *TimeReqTarget) FinishField(_, _ vdl.Target) error
- func (t *TimeReqTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *TimeReqTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *TimeReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *TimeReqTarget) ZeroField(name string) error
- type TimeResp
- type TimeRespTarget
- func (t *TimeRespTarget) FinishField(_, _ vdl.Target) error
- func (t *TimeRespTarget) FinishFields(_ vdl.FieldsTarget) error
- func (t *TimeRespTarget) StartField(name string) (key, field vdl.Target, _ error)
- func (t *TimeRespTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
- func (t *TimeRespTarget) ZeroField(name string) error
Constants ¶
const LinkRec = byte(1)
LinkRec type log record adds a new link in the dag. Link records are added when a conflict is resolved by picking the local or the remote version as the resolution of a conflict, instead of creating a new version.
const NoGroupId = GroupId("")
const NodeRec = byte(0)
NodeRec type log record adds a new node in the dag.
Variables ¶
var ( ErrDupSyncgroupPublish = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.DupSyncgroupPublish", verror.NoRetry, "{1:}{2:} duplicate publish on syncgroup: {3}") ErrConnFail = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.ConnFail", verror.NoRetry, "{1:}{2:} connection to peer failed{:_}") ErrBrokenCrConnection = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.BrokenCrConnection", verror.NoRetry, "{1:}{2:} CrConnection stream to client does not exist or is broken") ErrDbOffline = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.DbOffline", verror.NoRetry, "{1:}{2:} database {3} is offline and cannot be synced{:_}") ErrGetTimeFailed = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.GetTimeFailed", verror.NoRetry, "{1:}{2:} GetTime failed{:_}") ErrNotAdmin = verror.Register("v.io/x/ref/services/syncbase/server/interfaces.NotAdmin", verror.NoRetry, "{1:}{2:} not an admin of the syncgroup") )
var SyncDesc rpc.InterfaceDesc = descSync
SyncDesc describes the Sync interface.
var SyncgroupStatusAll = [...]SyncgroupStatus{SyncgroupStatusPublishPending, SyncgroupStatusPublishRejected, SyncgroupStatusRunning}
SyncgroupStatusAll holds all labels for SyncgroupStatus.
Functions ¶
func NewErrBrokenCrConnection ¶
NewErrBrokenCrConnection returns an error with the ErrBrokenCrConnection ID.
func NewErrConnFail ¶
NewErrConnFail returns an error with the ErrConnFail ID.
func NewErrDbOffline ¶
NewErrDbOffline returns an error with the ErrDbOffline ID.
func NewErrDupSyncgroupPublish ¶
NewErrDupSyncgroupPublish returns an error with the ErrDupSyncgroupPublish ID.
func NewErrGetTimeFailed ¶
NewErrGetTimeFailed returns an error with the ErrGetTimeFailed ID.
func NewErrNotAdmin ¶
NewErrNotAdmin returns an error with the ErrNotAdmin ID.
Types ¶
type BlobSharesBySyncgroup ¶
A BlobSharesBySyncgroup maps syncgroup IDs to integer share numbers that a syncbase instance may have for a blob.
func (*BlobSharesBySyncgroup) FillVDLTarget ¶
func (*BlobSharesBySyncgroup) MakeVDLTarget ¶
func (m *BlobSharesBySyncgroup) MakeVDLTarget() vdl.Target
func (BlobSharesBySyncgroup) VDLIsZero ¶
func (x BlobSharesBySyncgroup) VDLIsZero() bool
type BlobSharesBySyncgroupTarget ¶
type BlobSharesBySyncgroupTarget struct { // contains filtered or unexported fields }
func (*BlobSharesBySyncgroupTarget) FinishField ¶
func (t *BlobSharesBySyncgroupTarget) FinishField(key, field vdl.Target) error
func (*BlobSharesBySyncgroupTarget) FinishKeyStartField ¶
func (*BlobSharesBySyncgroupTarget) FinishMap ¶
func (t *BlobSharesBySyncgroupTarget) FinishMap(elem vdl.MapTarget) error
type ChunkData ¶
type ChunkData struct {
Data []byte
}
ChunkData contains the data of a chunk.
func (*ChunkData) FillVDLTarget ¶
func (*ChunkData) MakeVDLTarget ¶
type ChunkDataTarget ¶
type ChunkDataTarget struct { Value *ChunkData vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*ChunkDataTarget) FinishField ¶
func (t *ChunkDataTarget) FinishField(_, _ vdl.Target) error
func (*ChunkDataTarget) FinishFields ¶
func (t *ChunkDataTarget) FinishFields(_ vdl.FieldsTarget) error
func (*ChunkDataTarget) StartField ¶
func (t *ChunkDataTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*ChunkDataTarget) StartFields ¶
func (t *ChunkDataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*ChunkDataTarget) ZeroField ¶
func (t *ChunkDataTarget) ZeroField(name string) error
type ChunkHash ¶
type ChunkHash struct {
Hash []byte
}
ChunkHash contains the hash of a chunk that is part of a blob's recipe.
func (*ChunkHash) FillVDLTarget ¶
func (*ChunkHash) MakeVDLTarget ¶
type ChunkHashTarget ¶
type ChunkHashTarget struct { Value *ChunkHash vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*ChunkHashTarget) FinishField ¶
func (t *ChunkHashTarget) FinishField(_, _ vdl.Target) error
func (*ChunkHashTarget) FinishFields ¶
func (t *ChunkHashTarget) FinishFields(_ vdl.FieldsTarget) error
func (*ChunkHashTarget) StartField ¶
func (t *ChunkHashTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*ChunkHashTarget) StartFields ¶
func (t *ChunkHashTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*ChunkHashTarget) ZeroField ¶
func (t *ChunkHashTarget) ZeroField(name string) error
type DataDeltaReq ¶
DataDeltaReq contains the initiator's genvectors and the set of syncgroups it is interested in within a database when requesting deltas for that database.
func (*DataDeltaReq) FillVDLTarget ¶
func (*DataDeltaReq) MakeVDLTarget ¶
func (m *DataDeltaReq) MakeVDLTarget() vdl.Target
func (DataDeltaReq) VDLIsZero ¶
func (x DataDeltaReq) VDLIsZero() bool
type DataDeltaReqTarget ¶
type DataDeltaReqTarget struct { Value *DataDeltaReq vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*DataDeltaReqTarget) FinishField ¶
func (t *DataDeltaReqTarget) FinishField(_, _ vdl.Target) error
func (*DataDeltaReqTarget) FinishFields ¶
func (t *DataDeltaReqTarget) FinishFields(_ vdl.FieldsTarget) error
func (*DataDeltaReqTarget) StartField ¶
func (t *DataDeltaReqTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*DataDeltaReqTarget) StartFields ¶
func (t *DataDeltaReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*DataDeltaReqTarget) ZeroField ¶
func (t *DataDeltaReqTarget) ZeroField(name string) error
type Database ¶
type Database interface { // Id returns the id of this database. Id() wire.Id // St returns the storage engine instance for this database. St() *watchable.Store // Service returns the service handle for this database. Service() Service // CheckPermsInternal checks whether the given RPC (ctx, call) is allowed per // the database perms. // Designed for use from within Service.DestroyDatabase. CheckPermsInternal(ctx *context.T, call rpc.ServerCall, st store.StoreReader) error // GetSchemaMetadataInternal returns SchemaMetadata stored for this db // without checking any credentials. GetSchemaMetadataInternal(ctx *context.T) (*wire.SchemaMetadata, error) // CrConnectionStream returns the current conflict resolution stream // established between an app and this database. CrConnectionStream() wire.ConflictManagerStartConflictResolverServerStream // ResetCrConnectionStream resets the current conflict resolution stream. // This can be used to either close an active stream or to remove a dead // stream. // Note: Resetting a stream does not reconnect the stream. Its upto the // client to reconnect. ResetCrConnectionStream() }
Database is an internal interface to the database layer.
type DeltaFinalResp ¶
type DeltaFinalResp struct {
SgPriorities SgPriorities
}
DeltaFinalResp contains the data returned at the end of a GetDeltas call.
func (*DeltaFinalResp) FillVDLTarget ¶
func (*DeltaFinalResp) MakeVDLTarget ¶
func (m *DeltaFinalResp) MakeVDLTarget() vdl.Target
func (DeltaFinalResp) VDLIsZero ¶
func (x DeltaFinalResp) VDLIsZero() bool
type DeltaFinalRespTarget ¶
type DeltaFinalRespTarget struct { Value *DeltaFinalResp vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*DeltaFinalRespTarget) FinishField ¶
func (t *DeltaFinalRespTarget) FinishField(_, _ vdl.Target) error
func (*DeltaFinalRespTarget) FinishFields ¶
func (t *DeltaFinalRespTarget) FinishFields(_ vdl.FieldsTarget) error
func (*DeltaFinalRespTarget) StartField ¶
func (t *DeltaFinalRespTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*DeltaFinalRespTarget) StartFields ¶
func (t *DeltaFinalRespTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*DeltaFinalRespTarget) ZeroField ¶
func (t *DeltaFinalRespTarget) ZeroField(name string) error
type DeltaReq ¶
type DeltaReq interface { // Index returns the field index. Index() int // Interface returns the field value as an interface. Interface() interface{} // Name returns the field name. Name() string FillVDLTarget(vdl.Target, *vdl.Type) error VDLIsZero() bool VDLWrite(vdl.Encoder) error // contains filtered or unexported methods }
DeltaReq represents any single field of the DeltaReq union type.
DeltaReq contains a request to sync either data or syncgroup metadata for a Database.
type DeltaReqData ¶
type DeltaReqData struct{ Value DataDeltaReq }
DeltaReqData represents field Data of the DeltaReq union type.
func (DeltaReqData) FillVDLTarget ¶
func (DeltaReqData) Index ¶
func (x DeltaReqData) Index() int
func (DeltaReqData) Interface ¶
func (x DeltaReqData) Interface() interface{}
func (DeltaReqData) MakeVDLTarget ¶
func (m DeltaReqData) MakeVDLTarget() vdl.Target
func (DeltaReqData) Name ¶
func (x DeltaReqData) Name() string
func (DeltaReqData) VDLIsZero ¶
func (x DeltaReqData) VDLIsZero() bool
type DeltaReqSgs ¶
type DeltaReqSgs struct{ Value SgDeltaReq }
DeltaReqSgs represents field Sgs of the DeltaReq union type.
func (DeltaReqSgs) FillVDLTarget ¶
func (DeltaReqSgs) Index ¶
func (x DeltaReqSgs) Index() int
func (DeltaReqSgs) Interface ¶
func (x DeltaReqSgs) Interface() interface{}
func (DeltaReqSgs) MakeVDLTarget ¶
func (m DeltaReqSgs) MakeVDLTarget() vdl.Target
func (DeltaReqSgs) Name ¶
func (x DeltaReqSgs) Name() string
func (DeltaReqSgs) VDLIsZero ¶
func (x DeltaReqSgs) VDLIsZero() bool
type DeltaReqTarget ¶
type DeltaReqTarget struct { Value *DeltaReq vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*DeltaReqTarget) FinishField ¶
func (t *DeltaReqTarget) FinishField(_, fieldTarget vdl.Target) error
func (*DeltaReqTarget) FinishFields ¶
func (t *DeltaReqTarget) FinishFields(_ vdl.FieldsTarget) error
func (*DeltaReqTarget) StartField ¶
func (t *DeltaReqTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*DeltaReqTarget) StartFields ¶
func (t *DeltaReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
type DeltaResp ¶
type DeltaResp interface { // Index returns the field index. Index() int // Interface returns the field value as an interface. Interface() interface{} // Name returns the field name. Name() string FillVDLTarget(vdl.Target, *vdl.Type) error VDLIsZero() bool VDLWrite(vdl.Encoder) error // contains filtered or unexported methods }
DeltaResp represents any single field of the DeltaResp union type.
DeltaResp contains the responder's genvectors or the missing log records returned in response to an initiator's request for deltas for a Database.
type DeltaRespGvs ¶
type DeltaRespGvs struct{ Value Knowledge }
DeltaRespGvs represents field Gvs of the DeltaResp union type.
func (DeltaRespGvs) FillVDLTarget ¶
func (DeltaRespGvs) Index ¶
func (x DeltaRespGvs) Index() int
func (DeltaRespGvs) Interface ¶
func (x DeltaRespGvs) Interface() interface{}
func (DeltaRespGvs) MakeVDLTarget ¶
func (m DeltaRespGvs) MakeVDLTarget() vdl.Target
func (DeltaRespGvs) Name ¶
func (x DeltaRespGvs) Name() string
func (DeltaRespGvs) VDLIsZero ¶
func (x DeltaRespGvs) VDLIsZero() bool
type DeltaRespRec ¶
type DeltaRespRec struct{ Value LogRec }
DeltaRespRec represents field Rec of the DeltaResp union type.
func (DeltaRespRec) FillVDLTarget ¶
func (DeltaRespRec) Index ¶
func (x DeltaRespRec) Index() int
func (DeltaRespRec) Interface ¶
func (x DeltaRespRec) Interface() interface{}
func (DeltaRespRec) MakeVDLTarget ¶
func (m DeltaRespRec) MakeVDLTarget() vdl.Target
func (DeltaRespRec) Name ¶
func (x DeltaRespRec) Name() string
func (DeltaRespRec) VDLIsZero ¶
func (x DeltaRespRec) VDLIsZero() bool
type DeltaRespTarget ¶
type DeltaRespTarget struct { Value *DeltaResp vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*DeltaRespTarget) FinishField ¶
func (t *DeltaRespTarget) FinishField(_, fieldTarget vdl.Target) error
func (*DeltaRespTarget) FinishFields ¶
func (t *DeltaRespTarget) FinishFields(_ vdl.FieldsTarget) error
func (*DeltaRespTarget) StartField ¶
func (t *DeltaRespTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*DeltaRespTarget) StartFields ¶
func (t *DeltaRespTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
type GenVector ¶
GenVector is the generation vector for any syncable entity, which maps each device id to its last locally known generation in the scope of that entity.
func (GenVector) Compare ¶
Compare returns an integer comparing two generation vectors. The result will be 0 if a==b, -1 if a < b, +1 if a > b and +2 if a and b are uncomparable.
func (*GenVector) FillVDLTarget ¶
func (*GenVector) MakeVDLTarget ¶
type GenVectorTarget ¶
type GenVectorTarget struct { Value *GenVector vdl.TargetBase vdl.MapTargetBase // contains filtered or unexported fields }
func (*GenVectorTarget) FinishField ¶
func (t *GenVectorTarget) FinishField(key, field vdl.Target) error
func (*GenVectorTarget) FinishKeyStartField ¶
type GroupId ¶
type GroupId string
GroupId is a globally unique syncgroup ID. It is a hash of the syncgroup name.
func (*GroupId) MakeVDLTarget ¶
type GroupIdTarget ¶
type GroupIdTarget struct { Value *GroupId vdl.TargetBase }
func (*GroupIdTarget) FromString ¶
func (t *GroupIdTarget) FromString(src string, tt *vdl.Type) error
type Knowledge ¶
Knowledge is a mapping of syncable entities to their generation vectors. These syncable entities could be data prefixes relative to a Database id, or syncgroup oids.
func (*Knowledge) FillVDLTarget ¶
func (*Knowledge) MakeVDLTarget ¶
type KnowledgeTarget ¶
type KnowledgeTarget struct { Value *Knowledge vdl.TargetBase vdl.MapTargetBase // contains filtered or unexported fields }
func (*KnowledgeTarget) FinishField ¶
func (t *KnowledgeTarget) FinishField(key, field vdl.Target) error
func (*KnowledgeTarget) FinishKeyStartField ¶
type LocationData ¶
type LocationData struct { WhenSeen time.Time // most recent time when blob thought to have been at location IsProxy bool // whether the location is a likely proxy to another syncgroup IsServer bool // whether the location is a server that may be revealed outside its syncgroup }
A LocationData is the information known about a particular location in a Signpost. TODO(m3b): Include mount table information to allow the location to be found.
func (*LocationData) FillVDLTarget ¶
func (*LocationData) MakeVDLTarget ¶
func (m *LocationData) MakeVDLTarget() vdl.Target
func (LocationData) VDLIsZero ¶
func (x LocationData) VDLIsZero() bool
type LocationDataTarget ¶
type LocationDataTarget struct { Value *LocationData vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*LocationDataTarget) FinishField ¶
func (t *LocationDataTarget) FinishField(_, _ vdl.Target) error
func (*LocationDataTarget) FinishFields ¶
func (t *LocationDataTarget) FinishFields(_ vdl.FieldsTarget) error
func (*LocationDataTarget) StartField ¶
func (t *LocationDataTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*LocationDataTarget) StartFields ¶
func (t *LocationDataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*LocationDataTarget) ZeroField ¶
func (t *LocationDataTarget) ZeroField(name string) error
type LogRec ¶
type LogRec struct { Metadata LogRecMetadata Value []byte }
LogRec represents the on-wire representation of an entire log record: its metadata and data. Value is the actual value of a store object.
func (*LogRec) MakeVDLTarget ¶
type LogRecMetadata ¶
type LogRecMetadata struct { // Log related information. Id uint64 // device id that created the log record. Gen uint64 // generation number for the log record. RecType byte // type of log record. // Id of the object that was updated. This id is relative to Application // and Database names and is the store key for a particular row in a // collection. ObjId string CurVers string // current version number of the object. Parents []string // 0, 1 or 2 parent versions that the current version is derived from. UpdTime time.Time // timestamp when the update is generated. Delete bool // indicates whether the update resulted in object being deleted from the store. BatchId uint64 // unique id of the Batch this update belongs to. BatchCount uint64 // number of objects in the Batch. }
LogRecMetadata represents the metadata of a single log record that is exchanged between two peers. Each log record represents a change made to an object in the store.
TODO(hpucha): Add readset/scanset. Look into sending tx metadata only once per transaction.
func (*LogRecMetadata) FillVDLTarget ¶
func (*LogRecMetadata) MakeVDLTarget ¶
func (m *LogRecMetadata) MakeVDLTarget() vdl.Target
func (LogRecMetadata) VDLIsZero ¶
func (x LogRecMetadata) VDLIsZero() bool
type LogRecMetadataTarget ¶
type LogRecMetadataTarget struct { Value *LogRecMetadata vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*LogRecMetadataTarget) FinishField ¶
func (t *LogRecMetadataTarget) FinishField(_, _ vdl.Target) error
func (*LogRecMetadataTarget) FinishFields ¶
func (t *LogRecMetadataTarget) FinishFields(_ vdl.FieldsTarget) error
func (*LogRecMetadataTarget) StartField ¶
func (t *LogRecMetadataTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*LogRecMetadataTarget) StartFields ¶
func (t *LogRecMetadataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*LogRecMetadataTarget) ZeroField ¶
func (t *LogRecMetadataTarget) ZeroField(name string) error
type LogRecTarget ¶
type LogRecTarget struct { Value *LogRec vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*LogRecTarget) FinishField ¶
func (t *LogRecTarget) FinishField(_, _ vdl.Target) error
func (*LogRecTarget) FinishFields ¶
func (t *LogRecTarget) FinishFields(_ vdl.FieldsTarget) error
func (*LogRecTarget) StartField ¶
func (t *LogRecTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*LogRecTarget) StartFields ¶
func (t *LogRecTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*LogRecTarget) ZeroField ¶
func (t *LogRecTarget) ZeroField(name string) error
type PeerToLocationDataMap ¶
type PeerToLocationDataMap map[string]LocationData
A PeerToLocationDataMap is a map from syncbase peer names to LocationData structures.
func (*PeerToLocationDataMap) FillVDLTarget ¶
func (*PeerToLocationDataMap) MakeVDLTarget ¶
func (m *PeerToLocationDataMap) MakeVDLTarget() vdl.Target
func (PeerToLocationDataMap) VDLIsZero ¶
func (x PeerToLocationDataMap) VDLIsZero() bool
type PeerToLocationDataMapTarget ¶
type PeerToLocationDataMapTarget struct { Value *PeerToLocationDataMap vdl.TargetBase vdl.MapTargetBase // contains filtered or unexported fields }
func (*PeerToLocationDataMapTarget) FinishField ¶
func (t *PeerToLocationDataMapTarget) FinishField(key, field vdl.Target) error
func (*PeerToLocationDataMapTarget) FinishKeyStartField ¶
func (*PeerToLocationDataMapTarget) FinishMap ¶
func (t *PeerToLocationDataMapTarget) FinishMap(elem vdl.MapTarget) error
type Service ¶
type Service interface { // St returns the storage engine instance for this service. St() store.Store // Sync returns the sync instance for this service. Sync() SyncServerMethods // Database returns a handle for the specified database. Database(ctx *context.T, call rpc.ServerCall, dbId wire.Id) (Database, error) // DatabaseIds returns ids for all databases. DatabaseIds(ctx *context.T, call rpc.ServerCall) ([]wire.Id, error) }
Service is an internal interface to the service layer.
type SgDeltaReq ¶
SgDeltaReq contains the initiator's genvectors for the syncgroups it is interested in within a database when requesting deltas for those syncgroups.
func (*SgDeltaReq) FillVDLTarget ¶
func (*SgDeltaReq) MakeVDLTarget ¶
func (m *SgDeltaReq) MakeVDLTarget() vdl.Target
func (SgDeltaReq) VDLIsZero ¶
func (x SgDeltaReq) VDLIsZero() bool
type SgDeltaReqTarget ¶
type SgDeltaReqTarget struct { Value *SgDeltaReq vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*SgDeltaReqTarget) FinishField ¶
func (t *SgDeltaReqTarget) FinishField(_, _ vdl.Target) error
func (*SgDeltaReqTarget) FinishFields ¶
func (t *SgDeltaReqTarget) FinishFields(_ vdl.FieldsTarget) error
func (*SgDeltaReqTarget) StartField ¶
func (t *SgDeltaReqTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*SgDeltaReqTarget) StartFields ¶
func (t *SgDeltaReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*SgDeltaReqTarget) ZeroField ¶
func (t *SgDeltaReqTarget) ZeroField(name string) error
type SgPriorities ¶
type SgPriorities map[GroupId]SgPriority
A SgPriorities maps syncgroup IDs to SgPriority structures. It is sent and received in GetDeltas calls to allow the participants to assess who has higher priorities for keeping blobs.
func (*SgPriorities) FillVDLTarget ¶
func (*SgPriorities) MakeVDLTarget ¶
func (m *SgPriorities) MakeVDLTarget() vdl.Target
func (SgPriorities) VDLIsZero ¶
func (x SgPriorities) VDLIsZero() bool
type SgPrioritiesTarget ¶
type SgPrioritiesTarget struct { Value *SgPriorities vdl.TargetBase vdl.MapTargetBase // contains filtered or unexported fields }
func (*SgPrioritiesTarget) FinishField ¶
func (t *SgPrioritiesTarget) FinishField(key, field vdl.Target) error
func (*SgPrioritiesTarget) FinishKeyStartField ¶
func (*SgPrioritiesTarget) FinishMap ¶
func (t *SgPrioritiesTarget) FinishMap(elem vdl.MapTarget) error
type SgPriority ¶
type SgPriority struct { DevType int32 // device type (BlobDevTypeServer, BlobDevTypeNormal, BlobDevTypeLeaf) Distance float32 // mean number of hops from a server-quality member of the syncgroup ServerTime time.Time // when data from a server-quality member reached this device }
A SgPriority represents data used to decide whether to transfer blob ownership between two devices.
func (*SgPriority) FillVDLTarget ¶
func (*SgPriority) MakeVDLTarget ¶
func (m *SgPriority) MakeVDLTarget() vdl.Target
func (SgPriority) VDLIsZero ¶
func (x SgPriority) VDLIsZero() bool
type SgPriorityTarget ¶
type SgPriorityTarget struct { Value *SgPriority vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*SgPriorityTarget) FinishField ¶
func (t *SgPriorityTarget) FinishField(_, _ vdl.Target) error
func (*SgPriorityTarget) FinishFields ¶
func (t *SgPriorityTarget) FinishFields(_ vdl.FieldsTarget) error
func (*SgPriorityTarget) StartField ¶
func (t *SgPriorityTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*SgPriorityTarget) StartFields ¶
func (t *SgPriorityTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*SgPriorityTarget) ZeroField ¶
func (t *SgPriorityTarget) ZeroField(name string) error
type Signpost ¶
type Signpost struct { Locations PeerToLocationDataMap // Maps name of syncbase that probably has the blob to a LocationData SgIds map[GroupId]struct{} // SyncGroups through which the BlobRef was learned. }
A Signpost is a hint to syncbase of the device on which a blob may be found. It represents the data known about a blob even when the blob itself is not present on the device.
func (*Signpost) MakeVDLTarget ¶
type SignpostTarget ¶
type SignpostTarget struct { Value *Signpost vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*SignpostTarget) FinishField ¶
func (t *SignpostTarget) FinishField(_, _ vdl.Target) error
func (*SignpostTarget) FinishFields ¶
func (t *SignpostTarget) FinishFields(_ vdl.FieldsTarget) error
func (*SignpostTarget) StartField ¶
func (t *SignpostTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*SignpostTarget) StartFields ¶
func (t *SignpostTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*SignpostTarget) ZeroField ¶
func (t *SignpostTarget) ZeroField(name string) error
type SyncClientMethods ¶
type SyncClientMethods interface { // GetTime returns metadata related to the Syncbase virtual clock, including // system clock values, last NTP timestamp, num reboots, etc. GetTime(_ *context.T, req TimeReq, initiator string, _ ...rpc.CallOpt) (TimeResp, error) // GetDeltas returns the responder's current generation vectors and all // the missing log records when compared to the initiator's generation // vectors for one Database for either syncgroup metadata or data. // The final result (in DeltaFinalResp) currently includes the // syncgroup priorities for blob ownership for the server. GetDeltas(_ *context.T, req DeltaReq, initiator string, _ ...rpc.CallOpt) (SyncGetDeltasClientCall, error) // PublishSyncgroup is invoked on the syncgroup name (typically served // by a "central" peer) to publish the syncgroup. It takes the name of // Syncbase doing the publishing (the publisher) and returns the name // of the Syncbase where the syncgroup is published (the publishee). // This allows the publisher and the publishee to learn of each other. // When a syncgroup is published, the publishee is given the syncgroup // metadata, its current version at the publisher, and the current // syncgroup generation vector. The generation vector serves as a // checkpoint at the time of publishing. The publishing proceeds // asynchronously, and the publishee learns the syncgroup history // through the routine p2p sync process and determines when it has // caught up to the level of knowledge at the time of publishing using // the checkpointed generation vector. Until that point, the publishee // locally deems the syncgroup to be in a pending state and does not // mutate it. Thus it locally rejects syncgroup joins or updates to // its spec until it is caught up on the syncgroup history. PublishSyncgroup(_ *context.T, publisher string, sg Syncgroup, version string, genvec GenVector, _ ...rpc.CallOpt) (string, error) // JoinSyncgroupAtAdmin is invoked by a prospective syncgroup member's // Syncbase on a syncgroup admin. It checks whether the requestor is // allowed to join the named syncgroup, and if so, adds the requestor to // the syncgroup. It returns a copy of the updated syncgroup metadata, // its version, and the syncgroup generation vector at the time of the // join. Similar to the PublishSyncgroup scenario, the joiner at that // point does not have the syncgroup history and locally deems it to be // in a pending state and does not mutate it. This means it rejects // local updates to the syncgroup spec or, if it were also an admin on // the syncgroup, it would reject syncgroup joins until it is caught up // on the syncgroup history through p2p sync. JoinSyncgroupAtAdmin(_ *context.T, sgName string, joinerName string, myInfo syncbase.SyncgroupMemberInfo, _ ...rpc.CallOpt) (sg Syncgroup, version string, genvec GenVector, _ error) // HaveBlob verifies that the peer has the requested blob, and if // present, returns its size. Otherwise, it returns -1, and the location // hints (the Signpost) that the peer has for the blob, filtered to // include only data the caller is permitted to see: // + Device D reveals a syncgroup SG to the caller C iff // - D is in SG, and // - SG is in the Signpost, and // - at least one of: // - SG is not private, or // - C has permission to join SG. // + Device D reveals a location hint L to caller C iff // there is a syncgroup SG such that // - D is in SG, and // - SG is in the Signpost, and // - L is in SG, and // - at least one of: // - SG is not private, or // - C has permission to join SG, or // - L is a blob server in SG. HaveBlob(_ *context.T, br syncbase.BlobRef, _ ...rpc.CallOpt) (size int64, signpost Signpost, _ error) // FetchBlob fetches the requested blob. // It returns a number of blob ownership shares that the server hopes // the client will accept using the AcceptedBlobOwnership() call. FetchBlob(_ *context.T, br syncbase.BlobRef, mySgPriorities SgPriorities, _ ...rpc.CallOpt) (SyncFetchBlobClientCall, error) // Methods for incremental blob transfer. The transfer starts with the // receiver making a FetchBlobRecipe call to the sender for a given // BlobRef. The sender, in turn, sends the chunk hashes of all the // chunks that make up the requested blob (blob recipe). The receiver // looks up the chunk hashes in its local blob store, and identifies the // missing ones. The receiver then fetches the missing chunks using a // FetchChunks call from the sender. Finally, the receiver finishes the // blob fetch by combining the chunks obtained over the network with the // already available local chunks as per the blob recipe. // callerName is the syncbase Id of the caller, expressed as a string. // FetchBlobRecipe returns a number of blob ownership shares that the // server hopes the client will accept for each syncgroup using the // AcceptedBlobOwnership() call. FetchBlobRecipe(_ *context.T, br syncbase.BlobRef, callerName string, mySgPriorities SgPriorities, _ ...rpc.CallOpt) (SyncFetchBlobRecipeClientCall, error) FetchChunks(*context.T, ...rpc.CallOpt) (SyncFetchChunksClientCall, error) // RequestTakeBlob indicates that the caller wishes the server to take // some blob ownership shares for various syncgroups for the specified blob. // If the server chooses to act on the request, it may call FetchBlob/FetchBlobRecipe, // and ultimately AcceptedBlobOwnership(). // callerName is the syncbase Id of the caller, expressed as a string. RequestTakeBlob(_ *context.T, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup, _ ...rpc.CallOpt) error // AcceptedBlobOwnership tells the server that the client callerName (a // syncbase Id expressed as a string) has accepted blob ownership of a // specified number of shares for blob br. The server may decrement // its share count by up to this number. It is safe for the server to // decrement its share count by fewer than the number of shares another // device has taken responsibility for, but unsafe to decrement it by // more than that that number. It returns a hint as to whether the // server is likely to keep the blob itself, plus its syncbase Id // expressed as a string. AcceptedBlobOwnership(_ *context.T, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup, _ ...rpc.CallOpt) (serverName string, keepingBlob bool, _ error) }
SyncClientMethods is the client interface containing Sync methods.
Sync defines methods for data exchange between Syncbases. TODO(hpucha): Flesh this out further.
type SyncClientStub ¶
type SyncClientStub interface { SyncClientMethods rpc.UniversalServiceMethods }
SyncClientStub adds universal methods to SyncClientMethods.
func SyncClient ¶
func SyncClient(name string) SyncClientStub
SyncClient returns a client stub for Sync.
type SyncFetchBlobClientCall ¶
type SyncFetchBlobClientCall interface { SyncFetchBlobClientStream // Finish blocks until the server is done, and returns the positional return // values for call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() (shares BlobSharesBySyncgroup, _ error) }
SyncFetchBlobClientCall represents the call returned from Sync.FetchBlob.
type SyncFetchBlobClientStream ¶
type SyncFetchBlobClientStream interface { // RecvStream returns the receiver side of the Sync.FetchBlob client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() []byte // Err returns any error encountered by Advance. Never blocks. Err() error } }
SyncFetchBlobClientStream is the client stream for Sync.FetchBlob.
type SyncFetchBlobRecipeClientCall ¶
type SyncFetchBlobRecipeClientCall interface { SyncFetchBlobRecipeClientStream // Finish blocks until the server is done, and returns the positional return // values for call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() (shares BlobSharesBySyncgroup, _ error) }
SyncFetchBlobRecipeClientCall represents the call returned from Sync.FetchBlobRecipe.
type SyncFetchBlobRecipeClientStream ¶
type SyncFetchBlobRecipeClientStream interface { // RecvStream returns the receiver side of the Sync.FetchBlobRecipe client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() ChunkHash // Err returns any error encountered by Advance. Never blocks. Err() error } }
SyncFetchBlobRecipeClientStream is the client stream for Sync.FetchBlobRecipe.
type SyncFetchBlobRecipeServerCall ¶
type SyncFetchBlobRecipeServerCall interface { rpc.ServerCall SyncFetchBlobRecipeServerStream }
SyncFetchBlobRecipeServerCall represents the context passed to Sync.FetchBlobRecipe.
type SyncFetchBlobRecipeServerCallStub ¶
type SyncFetchBlobRecipeServerCallStub struct {
rpc.StreamServerCall
}
SyncFetchBlobRecipeServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements SyncFetchBlobRecipeServerCall.
func (*SyncFetchBlobRecipeServerCallStub) Init ¶
func (s *SyncFetchBlobRecipeServerCallStub) Init(call rpc.StreamServerCall)
Init initializes SyncFetchBlobRecipeServerCallStub from rpc.StreamServerCall.
func (*SyncFetchBlobRecipeServerCallStub) SendStream ¶
func (s *SyncFetchBlobRecipeServerCallStub) SendStream() interface { Send(item ChunkHash) error }
SendStream returns the send side of the Sync.FetchBlobRecipe server stream.
type SyncFetchBlobRecipeServerStream ¶
type SyncFetchBlobRecipeServerStream interface { // SendStream returns the send side of the Sync.FetchBlobRecipe server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item ChunkHash) error } }
SyncFetchBlobRecipeServerStream is the server stream for Sync.FetchBlobRecipe.
type SyncFetchBlobServerCall ¶
type SyncFetchBlobServerCall interface { rpc.ServerCall SyncFetchBlobServerStream }
SyncFetchBlobServerCall represents the context passed to Sync.FetchBlob.
type SyncFetchBlobServerCallStub ¶
type SyncFetchBlobServerCallStub struct {
rpc.StreamServerCall
}
SyncFetchBlobServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements SyncFetchBlobServerCall.
func (*SyncFetchBlobServerCallStub) Init ¶
func (s *SyncFetchBlobServerCallStub) Init(call rpc.StreamServerCall)
Init initializes SyncFetchBlobServerCallStub from rpc.StreamServerCall.
func (*SyncFetchBlobServerCallStub) SendStream ¶
func (s *SyncFetchBlobServerCallStub) SendStream() interface { Send(item []byte) error }
SendStream returns the send side of the Sync.FetchBlob server stream.
type SyncFetchBlobServerStream ¶
type SyncFetchBlobServerStream interface { // SendStream returns the send side of the Sync.FetchBlob server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item []byte) error } }
SyncFetchBlobServerStream is the server stream for Sync.FetchBlob.
type SyncFetchChunksClientCall ¶
type SyncFetchChunksClientCall interface { SyncFetchChunksClientStream // Finish performs the equivalent of SendStream().Close, then blocks until // the server is done, and returns the positional return values for the call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() error }
SyncFetchChunksClientCall represents the call returned from Sync.FetchChunks.
type SyncFetchChunksClientStream ¶
type SyncFetchChunksClientStream interface { // RecvStream returns the receiver side of the Sync.FetchChunks client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() ChunkData // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Sync.FetchChunks client stream. SendStream() interface { // Send places the item onto the output stream. Returns errors // encountered while sending, or if Send is called after Close or // the stream has been canceled. Blocks if there is no buffer // space; will unblock when buffer space is available or after // the stream has been canceled. Send(item ChunkHash) error // Close indicates to the server that no more items will be sent; // server Recv calls will receive io.EOF after all sent items. // This is an optional call - e.g. a client might call Close if it // needs to continue receiving items from the server after it's // done sending. Returns errors encountered while closing, or if // Close is called after the stream has been canceled. Like Send, // blocks if there is no buffer space available. Close() error } }
SyncFetchChunksClientStream is the client stream for Sync.FetchChunks.
type SyncFetchChunksServerCall ¶
type SyncFetchChunksServerCall interface { rpc.ServerCall SyncFetchChunksServerStream }
SyncFetchChunksServerCall represents the context passed to Sync.FetchChunks.
type SyncFetchChunksServerCallStub ¶
type SyncFetchChunksServerCallStub struct { rpc.StreamServerCall // contains filtered or unexported fields }
SyncFetchChunksServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements SyncFetchChunksServerCall.
func (*SyncFetchChunksServerCallStub) Init ¶
func (s *SyncFetchChunksServerCallStub) Init(call rpc.StreamServerCall)
Init initializes SyncFetchChunksServerCallStub from rpc.StreamServerCall.
func (*SyncFetchChunksServerCallStub) RecvStream ¶
func (s *SyncFetchChunksServerCallStub) RecvStream() interface { Advance() bool Value() ChunkHash Err() error }
RecvStream returns the receiver side of the Sync.FetchChunks server stream.
func (*SyncFetchChunksServerCallStub) SendStream ¶
func (s *SyncFetchChunksServerCallStub) SendStream() interface { Send(item ChunkData) error }
SendStream returns the send side of the Sync.FetchChunks server stream.
type SyncFetchChunksServerStream ¶
type SyncFetchChunksServerStream interface { // RecvStream returns the receiver side of the Sync.FetchChunks server stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() ChunkHash // Err returns any error encountered by Advance. Never blocks. Err() error } // SendStream returns the send side of the Sync.FetchChunks server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item ChunkData) error } }
SyncFetchChunksServerStream is the server stream for Sync.FetchChunks.
type SyncGetDeltasClientCall ¶
type SyncGetDeltasClientCall interface { SyncGetDeltasClientStream // Finish blocks until the server is done, and returns the positional return // values for call. // // Finish returns immediately if the call has been canceled; depending on the // timing the output could either be an error signaling cancelation, or the // valid positional return values from the server. // // Calling Finish is mandatory for releasing stream resources, unless the call // has been canceled or any of the other methods return an error. Finish should // be called at most once. Finish() (DeltaFinalResp, error) }
SyncGetDeltasClientCall represents the call returned from Sync.GetDeltas.
type SyncGetDeltasClientStream ¶
type SyncGetDeltasClientStream interface { // RecvStream returns the receiver side of the Sync.GetDeltas client stream. RecvStream() interface { // Advance stages an item so that it may be retrieved via Value. Returns // true iff there is an item to retrieve. Advance must be called before // Value is called. May block if an item is not available. Advance() bool // Value returns the item that was staged by Advance. May panic if Advance // returned false or was not called. Never blocks. Value() DeltaResp // Err returns any error encountered by Advance. Never blocks. Err() error } }
SyncGetDeltasClientStream is the client stream for Sync.GetDeltas.
type SyncGetDeltasServerCall ¶
type SyncGetDeltasServerCall interface { rpc.ServerCall SyncGetDeltasServerStream }
SyncGetDeltasServerCall represents the context passed to Sync.GetDeltas.
type SyncGetDeltasServerCallStub ¶
type SyncGetDeltasServerCallStub struct {
rpc.StreamServerCall
}
SyncGetDeltasServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements SyncGetDeltasServerCall.
func (*SyncGetDeltasServerCallStub) Init ¶
func (s *SyncGetDeltasServerCallStub) Init(call rpc.StreamServerCall)
Init initializes SyncGetDeltasServerCallStub from rpc.StreamServerCall.
func (*SyncGetDeltasServerCallStub) SendStream ¶
func (s *SyncGetDeltasServerCallStub) SendStream() interface { Send(item DeltaResp) error }
SendStream returns the send side of the Sync.GetDeltas server stream.
type SyncGetDeltasServerStream ¶
type SyncGetDeltasServerStream interface { // SendStream returns the send side of the Sync.GetDeltas server stream. SendStream() interface { // Send places the item onto the output stream. Returns errors encountered // while sending. Blocks if there is no buffer space; will unblock when // buffer space is available. Send(item DeltaResp) error } }
SyncGetDeltasServerStream is the server stream for Sync.GetDeltas.
type SyncServerMethods ¶
type SyncServerMethods interface { // GetTime returns metadata related to the Syncbase virtual clock, including // system clock values, last NTP timestamp, num reboots, etc. GetTime(_ *context.T, _ rpc.ServerCall, req TimeReq, initiator string) (TimeResp, error) // GetDeltas returns the responder's current generation vectors and all // the missing log records when compared to the initiator's generation // vectors for one Database for either syncgroup metadata or data. // The final result (in DeltaFinalResp) currently includes the // syncgroup priorities for blob ownership for the server. GetDeltas(_ *context.T, _ SyncGetDeltasServerCall, req DeltaReq, initiator string) (DeltaFinalResp, error) // PublishSyncgroup is invoked on the syncgroup name (typically served // by a "central" peer) to publish the syncgroup. It takes the name of // Syncbase doing the publishing (the publisher) and returns the name // of the Syncbase where the syncgroup is published (the publishee). // This allows the publisher and the publishee to learn of each other. // When a syncgroup is published, the publishee is given the syncgroup // metadata, its current version at the publisher, and the current // syncgroup generation vector. The generation vector serves as a // checkpoint at the time of publishing. The publishing proceeds // asynchronously, and the publishee learns the syncgroup history // through the routine p2p sync process and determines when it has // caught up to the level of knowledge at the time of publishing using // the checkpointed generation vector. Until that point, the publishee // locally deems the syncgroup to be in a pending state and does not // mutate it. Thus it locally rejects syncgroup joins or updates to // its spec until it is caught up on the syncgroup history. PublishSyncgroup(_ *context.T, _ rpc.ServerCall, publisher string, sg Syncgroup, version string, genvec GenVector) (string, error) // JoinSyncgroupAtAdmin is invoked by a prospective syncgroup member's // Syncbase on a syncgroup admin. It checks whether the requestor is // allowed to join the named syncgroup, and if so, adds the requestor to // the syncgroup. It returns a copy of the updated syncgroup metadata, // its version, and the syncgroup generation vector at the time of the // join. Similar to the PublishSyncgroup scenario, the joiner at that // point does not have the syncgroup history and locally deems it to be // in a pending state and does not mutate it. This means it rejects // local updates to the syncgroup spec or, if it were also an admin on // the syncgroup, it would reject syncgroup joins until it is caught up // on the syncgroup history through p2p sync. JoinSyncgroupAtAdmin(_ *context.T, _ rpc.ServerCall, sgName string, joinerName string, myInfo syncbase.SyncgroupMemberInfo) (sg Syncgroup, version string, genvec GenVector, _ error) // HaveBlob verifies that the peer has the requested blob, and if // present, returns its size. Otherwise, it returns -1, and the location // hints (the Signpost) that the peer has for the blob, filtered to // include only data the caller is permitted to see: // + Device D reveals a syncgroup SG to the caller C iff // - D is in SG, and // - SG is in the Signpost, and // - at least one of: // - SG is not private, or // - C has permission to join SG. // + Device D reveals a location hint L to caller C iff // there is a syncgroup SG such that // - D is in SG, and // - SG is in the Signpost, and // - L is in SG, and // - at least one of: // - SG is not private, or // - C has permission to join SG, or // - L is a blob server in SG. HaveBlob(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef) (size int64, signpost Signpost, _ error) // FetchBlob fetches the requested blob. // It returns a number of blob ownership shares that the server hopes // the client will accept using the AcceptedBlobOwnership() call. FetchBlob(_ *context.T, _ SyncFetchBlobServerCall, br syncbase.BlobRef, mySgPriorities SgPriorities) (shares BlobSharesBySyncgroup, _ error) // Methods for incremental blob transfer. The transfer starts with the // receiver making a FetchBlobRecipe call to the sender for a given // BlobRef. The sender, in turn, sends the chunk hashes of all the // chunks that make up the requested blob (blob recipe). The receiver // looks up the chunk hashes in its local blob store, and identifies the // missing ones. The receiver then fetches the missing chunks using a // FetchChunks call from the sender. Finally, the receiver finishes the // blob fetch by combining the chunks obtained over the network with the // already available local chunks as per the blob recipe. // callerName is the syncbase Id of the caller, expressed as a string. // FetchBlobRecipe returns a number of blob ownership shares that the // server hopes the client will accept for each syncgroup using the // AcceptedBlobOwnership() call. FetchBlobRecipe(_ *context.T, _ SyncFetchBlobRecipeServerCall, br syncbase.BlobRef, callerName string, mySgPriorities SgPriorities) (shares BlobSharesBySyncgroup, _ error) FetchChunks(*context.T, SyncFetchChunksServerCall) error // RequestTakeBlob indicates that the caller wishes the server to take // some blob ownership shares for various syncgroups for the specified blob. // If the server chooses to act on the request, it may call FetchBlob/FetchBlobRecipe, // and ultimately AcceptedBlobOwnership(). // callerName is the syncbase Id of the caller, expressed as a string. RequestTakeBlob(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup) error // AcceptedBlobOwnership tells the server that the client callerName (a // syncbase Id expressed as a string) has accepted blob ownership of a // specified number of shares for blob br. The server may decrement // its share count by up to this number. It is safe for the server to // decrement its share count by fewer than the number of shares another // device has taken responsibility for, but unsafe to decrement it by // more than that that number. It returns a hint as to whether the // server is likely to keep the blob itself, plus its syncbase Id // expressed as a string. AcceptedBlobOwnership(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup) (serverName string, keepingBlob bool, _ error) }
SyncServerMethods is the interface a server writer implements for Sync.
Sync defines methods for data exchange between Syncbases. TODO(hpucha): Flesh this out further.
type SyncServerStub ¶
type SyncServerStub interface { SyncServerStubMethods // Describe the Sync interfaces. Describe__() []rpc.InterfaceDesc }
SyncServerStub adds universal methods to SyncServerStubMethods.
func SyncServer ¶
func SyncServer(impl SyncServerMethods) SyncServerStub
SyncServer returns a server stub for Sync. It converts an implementation of SyncServerMethods into an object that may be used by rpc.Server.
type SyncServerStubMethods ¶
type SyncServerStubMethods interface { // GetTime returns metadata related to the Syncbase virtual clock, including // system clock values, last NTP timestamp, num reboots, etc. GetTime(_ *context.T, _ rpc.ServerCall, req TimeReq, initiator string) (TimeResp, error) // GetDeltas returns the responder's current generation vectors and all // the missing log records when compared to the initiator's generation // vectors for one Database for either syncgroup metadata or data. // The final result (in DeltaFinalResp) currently includes the // syncgroup priorities for blob ownership for the server. GetDeltas(_ *context.T, _ *SyncGetDeltasServerCallStub, req DeltaReq, initiator string) (DeltaFinalResp, error) // PublishSyncgroup is invoked on the syncgroup name (typically served // by a "central" peer) to publish the syncgroup. It takes the name of // Syncbase doing the publishing (the publisher) and returns the name // of the Syncbase where the syncgroup is published (the publishee). // This allows the publisher and the publishee to learn of each other. // When a syncgroup is published, the publishee is given the syncgroup // metadata, its current version at the publisher, and the current // syncgroup generation vector. The generation vector serves as a // checkpoint at the time of publishing. The publishing proceeds // asynchronously, and the publishee learns the syncgroup history // through the routine p2p sync process and determines when it has // caught up to the level of knowledge at the time of publishing using // the checkpointed generation vector. Until that point, the publishee // locally deems the syncgroup to be in a pending state and does not // mutate it. Thus it locally rejects syncgroup joins or updates to // its spec until it is caught up on the syncgroup history. PublishSyncgroup(_ *context.T, _ rpc.ServerCall, publisher string, sg Syncgroup, version string, genvec GenVector) (string, error) // JoinSyncgroupAtAdmin is invoked by a prospective syncgroup member's // Syncbase on a syncgroup admin. It checks whether the requestor is // allowed to join the named syncgroup, and if so, adds the requestor to // the syncgroup. It returns a copy of the updated syncgroup metadata, // its version, and the syncgroup generation vector at the time of the // join. Similar to the PublishSyncgroup scenario, the joiner at that // point does not have the syncgroup history and locally deems it to be // in a pending state and does not mutate it. This means it rejects // local updates to the syncgroup spec or, if it were also an admin on // the syncgroup, it would reject syncgroup joins until it is caught up // on the syncgroup history through p2p sync. JoinSyncgroupAtAdmin(_ *context.T, _ rpc.ServerCall, sgName string, joinerName string, myInfo syncbase.SyncgroupMemberInfo) (sg Syncgroup, version string, genvec GenVector, _ error) // HaveBlob verifies that the peer has the requested blob, and if // present, returns its size. Otherwise, it returns -1, and the location // hints (the Signpost) that the peer has for the blob, filtered to // include only data the caller is permitted to see: // + Device D reveals a syncgroup SG to the caller C iff // - D is in SG, and // - SG is in the Signpost, and // - at least one of: // - SG is not private, or // - C has permission to join SG. // + Device D reveals a location hint L to caller C iff // there is a syncgroup SG such that // - D is in SG, and // - SG is in the Signpost, and // - L is in SG, and // - at least one of: // - SG is not private, or // - C has permission to join SG, or // - L is a blob server in SG. HaveBlob(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef) (size int64, signpost Signpost, _ error) // FetchBlob fetches the requested blob. // It returns a number of blob ownership shares that the server hopes // the client will accept using the AcceptedBlobOwnership() call. FetchBlob(_ *context.T, _ *SyncFetchBlobServerCallStub, br syncbase.BlobRef, mySgPriorities SgPriorities) (shares BlobSharesBySyncgroup, _ error) // Methods for incremental blob transfer. The transfer starts with the // receiver making a FetchBlobRecipe call to the sender for a given // BlobRef. The sender, in turn, sends the chunk hashes of all the // chunks that make up the requested blob (blob recipe). The receiver // looks up the chunk hashes in its local blob store, and identifies the // missing ones. The receiver then fetches the missing chunks using a // FetchChunks call from the sender. Finally, the receiver finishes the // blob fetch by combining the chunks obtained over the network with the // already available local chunks as per the blob recipe. // callerName is the syncbase Id of the caller, expressed as a string. // FetchBlobRecipe returns a number of blob ownership shares that the // server hopes the client will accept for each syncgroup using the // AcceptedBlobOwnership() call. FetchBlobRecipe(_ *context.T, _ *SyncFetchBlobRecipeServerCallStub, br syncbase.BlobRef, callerName string, mySgPriorities SgPriorities) (shares BlobSharesBySyncgroup, _ error) FetchChunks(*context.T, *SyncFetchChunksServerCallStub) error // RequestTakeBlob indicates that the caller wishes the server to take // some blob ownership shares for various syncgroups for the specified blob. // If the server chooses to act on the request, it may call FetchBlob/FetchBlobRecipe, // and ultimately AcceptedBlobOwnership(). // callerName is the syncbase Id of the caller, expressed as a string. RequestTakeBlob(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup) error // AcceptedBlobOwnership tells the server that the client callerName (a // syncbase Id expressed as a string) has accepted blob ownership of a // specified number of shares for blob br. The server may decrement // its share count by up to this number. It is safe for the server to // decrement its share count by fewer than the number of shares another // device has taken responsibility for, but unsafe to decrement it by // more than that that number. It returns a hint as to whether the // server is likely to keep the blob itself, plus its syncbase Id // expressed as a string. AcceptedBlobOwnership(_ *context.T, _ rpc.ServerCall, br syncbase.BlobRef, callerName string, shares BlobSharesBySyncgroup) (serverName string, keepingBlob bool, _ error) }
SyncServerStubMethods is the server interface containing Sync methods, as expected by rpc.Server. The only difference between this interface and SyncServerMethods is the streaming methods.
type Syncgroup ¶
type Syncgroup struct { Name string // globally unique Vanadium name chosen by app SpecVersion string // version on syncgroup spec for concurrency control Spec syncbase.SyncgroupSpec // app-given specification Creator string // Creator's Vanadium name DbId syncbase.Id // Globally unique database id Status SyncgroupStatus // Status of the syncgroup Joiners map[string]syncbase.SyncgroupMemberInfo // map of joiners to their metadata }
Syncgroup contains the state of a syncgroup.
func (*Syncgroup) FillVDLTarget ¶
func (*Syncgroup) MakeVDLTarget ¶
type SyncgroupStatus ¶
type SyncgroupStatus int
Possible states for a syncgroup.
const ( SyncgroupStatusPublishPending SyncgroupStatus = iota SyncgroupStatusPublishRejected SyncgroupStatusRunning )
func SyncgroupStatusFromString ¶
func SyncgroupStatusFromString(label string) (x SyncgroupStatus, err error)
SyncgroupStatusFromString creates a SyncgroupStatus from a string label.
func (*SyncgroupStatus) FillVDLTarget ¶
func (*SyncgroupStatus) MakeVDLTarget ¶
func (m *SyncgroupStatus) MakeVDLTarget() vdl.Target
func (*SyncgroupStatus) Set ¶
func (x *SyncgroupStatus) Set(label string) error
Set assigns label to x.
func (SyncgroupStatus) String ¶
func (x SyncgroupStatus) String() string
String returns the string label of x.
func (SyncgroupStatus) VDLIsZero ¶
func (x SyncgroupStatus) VDLIsZero() bool
type SyncgroupStatusTarget ¶
type SyncgroupStatusTarget struct { Value *SyncgroupStatus vdl.TargetBase }
func (*SyncgroupStatusTarget) FromEnumLabel ¶
func (t *SyncgroupStatusTarget) FromEnumLabel(src string, tt *vdl.Type) error
type SyncgroupTarget ¶
type SyncgroupTarget struct { Value *Syncgroup vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*SyncgroupTarget) FinishField ¶
func (t *SyncgroupTarget) FinishField(_, _ vdl.Target) error
func (*SyncgroupTarget) FinishFields ¶
func (t *SyncgroupTarget) FinishFields(_ vdl.FieldsTarget) error
func (*SyncgroupTarget) StartField ¶
func (t *SyncgroupTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*SyncgroupTarget) StartFields ¶
func (t *SyncgroupTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*SyncgroupTarget) ZeroField ¶
func (t *SyncgroupTarget) ZeroField(name string) error
type TimeReq ¶
TimeReq contains the send timestamp from the requester.
func (*TimeReq) MakeVDLTarget ¶
type TimeReqTarget ¶
type TimeReqTarget struct { Value *TimeReq vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*TimeReqTarget) FinishField ¶
func (t *TimeReqTarget) FinishField(_, _ vdl.Target) error
func (*TimeReqTarget) FinishFields ¶
func (t *TimeReqTarget) FinishFields(_ vdl.FieldsTarget) error
func (*TimeReqTarget) StartField ¶
func (t *TimeReqTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*TimeReqTarget) StartFields ¶
func (t *TimeReqTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*TimeReqTarget) ZeroField ¶
func (t *TimeReqTarget) ZeroField(name string) error
type TimeResp ¶
type TimeResp struct { OrigTs time.Time // when we sent request RecvTs time.Time // when peer received request SendTs time.Time // when peer sent response // NTP server timestamp from the most recent NTP sync, or zero value if none. // Note, the NTP sync may have been performed by some peer device. LastNtpTs time.Time // Number of reboots since last NTP sync, accumulated across all hops of p2p // clock sync. NumReboots uint16 // Number of sync hops between peer's device and its source of LastNtpTs. NumHops uint16 }
TimeResp contains information needed by the requester to estimate the difference between the two vclocks and to decide whether to incorporate the peer's vclock data.
func (*TimeResp) MakeVDLTarget ¶
type TimeRespTarget ¶
type TimeRespTarget struct { Value *TimeResp vdl.TargetBase vdl.FieldsTargetBase // contains filtered or unexported fields }
func (*TimeRespTarget) FinishField ¶
func (t *TimeRespTarget) FinishField(_, _ vdl.Target) error
func (*TimeRespTarget) FinishFields ¶
func (t *TimeRespTarget) FinishFields(_ vdl.FieldsTarget) error
func (*TimeRespTarget) StartField ¶
func (t *TimeRespTarget) StartField(name string) (key, field vdl.Target, _ error)
func (*TimeRespTarget) StartFields ¶
func (t *TimeRespTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)
func (*TimeRespTarget) ZeroField ¶
func (t *TimeRespTarget) ZeroField(name string) error