syncbase

package
v0.0.0-...-e3ab1ac Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 28, 2016 License: BSD-3-Clause Imports: 15 Imported by: 0

Documentation

Overview

Package syncbase defines the wire API for a structured store that supports peer-to-peer synchronization.

TODO(sadovsky): Write a detailed package description, or provide a reference to the Syncbase documentation.

Index

Constants

View Source
const BlobDevTypeLeaf = int32(2) // Blobs migrate from leaves, which have less storage (examples: a camera, phone)
View Source
const BlobDevTypeNormal = int32(1) // Ordinary devices (example: laptop)
View Source
const BlobDevTypeServer = int32(0) // Blobs migrate toward servers, which store them.  (example: server in cloud)
View Source
const NullBlobRef = BlobRef("")

Variables

View Source
var (
	ErrNotInDevMode        = verror.Register("v.io/v23/services/syncbase.NotInDevMode", verror.NoRetry, "{1:}{2:} not running with --dev=true")
	ErrInvalidName         = verror.Register("v.io/v23/services/syncbase.InvalidName", verror.NoRetry, "{1:}{2:} invalid name: {3}")
	ErrCorruptDatabase     = verror.Register("v.io/v23/services/syncbase.CorruptDatabase", verror.NoRetry, "{1:}{2:} database corrupt, moved to {3}; client must create a new database")
	ErrUnknownBatch        = verror.Register("v.io/v23/services/syncbase.UnknownBatch", verror.NoRetry, "{1:}{2:} unknown batch, perhaps the server restarted")
	ErrNotBoundToBatch     = verror.Register("v.io/v23/services/syncbase.NotBoundToBatch", verror.NoRetry, "{1:}{2:} not bound to batch")
	ErrReadOnlyBatch       = verror.Register("v.io/v23/services/syncbase.ReadOnlyBatch", verror.NoRetry, "{1:}{2:} batch is read-only")
	ErrConcurrentBatch     = verror.Register("v.io/v23/services/syncbase.ConcurrentBatch", verror.NoRetry, "{1:}{2:} concurrent batch")
	ErrBlobNotCommitted    = verror.Register("v.io/v23/services/syncbase.BlobNotCommitted", verror.NoRetry, "{1:}{2:} blob is not yet committed")
	ErrSyncgroupJoinFailed = verror.Register("v.io/v23/services/syncbase.SyncgroupJoinFailed", verror.NoRetry, "{1:}{2:} syncgroup join failed")
	ErrBadExecStreamHeader = verror.Register("v.io/v23/services/syncbase.BadExecStreamHeader", verror.NoRetry, "{1:}{2:} Exec stream header improperly formatted")
)

BatchSourceAll holds all labels for BatchSource.

BlobFetchStateAll holds all labels for BlobFetchState.

View Source
var BlobManagerDesc rpc.InterfaceDesc = descBlobManager

BlobManagerDesc describes the BlobManager interface.

View Source
var CollectionDesc rpc.InterfaceDesc = descCollection

CollectionDesc describes the Collection interface.

View Source
var ConflictManagerDesc rpc.InterfaceDesc = descConflictManager

ConflictManagerDesc describes the ConflictManager interface.

View Source
var DatabaseDesc rpc.InterfaceDesc = descDatabase

DatabaseDesc describes the Database interface.

View Source
var DatabaseWatcherDesc rpc.InterfaceDesc = descDatabaseWatcher

DatabaseWatcherDesc describes the DatabaseWatcher interface.

ResolverTypeAll holds all labels for ResolverType.

View Source
var RowDesc rpc.InterfaceDesc = descRow

RowDesc describes the Row interface.

View Source
var SchemaManagerDesc rpc.InterfaceDesc = descSchemaManager

SchemaManagerDesc describes the SchemaManager interface.

View Source
var ServiceDesc rpc.InterfaceDesc = descService

ServiceDesc describes the Service interface.

View Source
var SyncgroupManagerDesc rpc.InterfaceDesc = descSyncgroupManager

SyncgroupManagerDesc describes the SyncgroupManager interface.

ValueSelectionAll holds all labels for ValueSelection.

ValueStateAll holds all labels for ValueState.

Functions

func NewErrBadExecStreamHeader

func NewErrBadExecStreamHeader(ctx *context.T) error

NewErrBadExecStreamHeader returns an error with the ErrBadExecStreamHeader ID.

func NewErrBlobNotCommitted

func NewErrBlobNotCommitted(ctx *context.T) error

NewErrBlobNotCommitted returns an error with the ErrBlobNotCommitted ID.

func NewErrConcurrentBatch

func NewErrConcurrentBatch(ctx *context.T) error

NewErrConcurrentBatch returns an error with the ErrConcurrentBatch ID.

func NewErrCorruptDatabase

func NewErrCorruptDatabase(ctx *context.T, path string) error

NewErrCorruptDatabase returns an error with the ErrCorruptDatabase ID.

func NewErrInvalidName

func NewErrInvalidName(ctx *context.T, name string) error

NewErrInvalidName returns an error with the ErrInvalidName ID.

func NewErrNotBoundToBatch

func NewErrNotBoundToBatch(ctx *context.T) error

NewErrNotBoundToBatch returns an error with the ErrNotBoundToBatch ID.

func NewErrNotInDevMode

func NewErrNotInDevMode(ctx *context.T) error

NewErrNotInDevMode returns an error with the ErrNotInDevMode ID.

func NewErrReadOnlyBatch

func NewErrReadOnlyBatch(ctx *context.T) error

NewErrReadOnlyBatch returns an error with the ErrReadOnlyBatch ID.

func NewErrSyncgroupJoinFailed

func NewErrSyncgroupJoinFailed(ctx *context.T) error

NewErrSyncgroupJoinFailed returns an error with the ErrSyncgroupJoinFailed ID.

func NewErrUnknownBatch

func NewErrUnknownBatch(ctx *context.T) error

NewErrUnknownBatch returns an error with the ErrUnknownBatch ID.

func VDLReadConflictData

func VDLReadConflictData(dec vdl.Decoder, x *ConflictData) error

func VDLReadOperation

func VDLReadOperation(dec vdl.Decoder, x *Operation) error

Types

type BatchHandle

type BatchHandle string

BatchHandle is a reference to a batch.

func (*BatchHandle) FillVDLTarget

func (m *BatchHandle) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BatchHandle) MakeVDLTarget

func (m *BatchHandle) MakeVDLTarget() vdl.Target

func (BatchHandle) VDLIsZero

func (x BatchHandle) VDLIsZero() bool

func (*BatchHandle) VDLRead

func (x *BatchHandle) VDLRead(dec vdl.Decoder) error

func (BatchHandle) VDLWrite

func (x BatchHandle) VDLWrite(enc vdl.Encoder) error

type BatchHandleTarget

type BatchHandleTarget struct {
	Value *BatchHandle
	vdl.TargetBase
}

func (*BatchHandleTarget) FromString

func (t *BatchHandleTarget) FromString(src string, tt *vdl.Type) error

type BatchInfo

type BatchInfo struct {
	// Id is an identifier for a batch contained in a conflict. It is
	// unique only in the context of a given conflict. Its purpose is solely to
	// group one or more RowInfo objects together to represent a batch that
	// was committed by the client.
	Id uint64
	// Hint is the hint provided by the client when this batch was committed.
	Hint string
	// Source states where the batch comes from.
	Source BatchSource
}

func (*BatchInfo) FillVDLTarget

func (m *BatchInfo) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BatchInfo) MakeVDLTarget

func (m *BatchInfo) MakeVDLTarget() vdl.Target

func (BatchInfo) VDLIsZero

func (x BatchInfo) VDLIsZero() bool

func (*BatchInfo) VDLRead

func (x *BatchInfo) VDLRead(dec vdl.Decoder) error

func (BatchInfo) VDLWrite

func (x BatchInfo) VDLWrite(enc vdl.Encoder) error

type BatchInfoTarget

type BatchInfoTarget struct {
	Value *BatchInfo

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*BatchInfoTarget) FinishField

func (t *BatchInfoTarget) FinishField(_, _ vdl.Target) error

func (*BatchInfoTarget) FinishFields

func (t *BatchInfoTarget) FinishFields(_ vdl.FieldsTarget) error

func (*BatchInfoTarget) StartField

func (t *BatchInfoTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*BatchInfoTarget) StartFields

func (t *BatchInfoTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*BatchInfoTarget) ZeroField

func (t *BatchInfoTarget) ZeroField(name string) error

type BatchOptions

type BatchOptions struct {
	// Arbitrary string, typically used to describe the intent behind a batch.
	// Hints are surfaced to clients during conflict resolution.
	// TODO(sadovsky): Use "any" here?
	Hint string
	// ReadOnly specifies whether the batch should allow writes.
	// If ReadOnly is set to true, Abort() should be used to release any resources
	// associated with this batch (though it is not strictly required), and
	// Commit() will always fail.
	ReadOnly bool
}

BatchOptions configures a batch. TODO(sadovsky): Add more options, e.g. to configure isolation, timeouts, whether to track the read set and/or write set, etc. TODO(sadovsky): Maybe add a DefaultBatchOptions() function that initializes BatchOptions with our desired defaults. Clients would be encouraged to initialize their BatchOptions object using that function and then modify it to their liking.

func (*BatchOptions) FillVDLTarget

func (m *BatchOptions) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BatchOptions) MakeVDLTarget

func (m *BatchOptions) MakeVDLTarget() vdl.Target

func (BatchOptions) VDLIsZero

func (x BatchOptions) VDLIsZero() bool

func (*BatchOptions) VDLRead

func (x *BatchOptions) VDLRead(dec vdl.Decoder) error

func (BatchOptions) VDLWrite

func (x BatchOptions) VDLWrite(enc vdl.Encoder) error

type BatchOptionsTarget

type BatchOptionsTarget struct {
	Value *BatchOptions

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*BatchOptionsTarget) FinishField

func (t *BatchOptionsTarget) FinishField(_, _ vdl.Target) error

func (*BatchOptionsTarget) FinishFields

func (t *BatchOptionsTarget) FinishFields(_ vdl.FieldsTarget) error

func (*BatchOptionsTarget) StartField

func (t *BatchOptionsTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*BatchOptionsTarget) StartFields

func (t *BatchOptionsTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*BatchOptionsTarget) ZeroField

func (t *BatchOptionsTarget) ZeroField(name string) error

type BatchSource

type BatchSource int

BatchSource represents where the batch was committed.

const (
	BatchSourceLocal BatchSource = iota
	BatchSourceRemote
)

func BatchSourceFromString

func BatchSourceFromString(label string) (x BatchSource, err error)

BatchSourceFromString creates a BatchSource from a string label.

func (*BatchSource) FillVDLTarget

func (m *BatchSource) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BatchSource) MakeVDLTarget

func (m *BatchSource) MakeVDLTarget() vdl.Target

func (*BatchSource) Set

func (x *BatchSource) Set(label string) error

Set assigns label to x.

func (BatchSource) String

func (x BatchSource) String() string

String returns the string label of x.

func (BatchSource) VDLIsZero

func (x BatchSource) VDLIsZero() bool

func (*BatchSource) VDLRead

func (x *BatchSource) VDLRead(dec vdl.Decoder) error

func (BatchSource) VDLWrite

func (x BatchSource) VDLWrite(enc vdl.Encoder) error

type BatchSourceTarget

type BatchSourceTarget struct {
	Value *BatchSource
	vdl.TargetBase
}

func (*BatchSourceTarget) FromEnumLabel

func (t *BatchSourceTarget) FromEnumLabel(src string, tt *vdl.Type) error

type BlobFetchState

type BlobFetchState int

BlobFetchState represents the state transitions of a blob fetch.

const (
	BlobFetchStatePending BlobFetchState = iota
	BlobFetchStateLocating
	BlobFetchStateFetching
	BlobFetchStateDone
)

func BlobFetchStateFromString

func BlobFetchStateFromString(label string) (x BlobFetchState, err error)

BlobFetchStateFromString creates a BlobFetchState from a string label.

func (*BlobFetchState) FillVDLTarget

func (m *BlobFetchState) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BlobFetchState) MakeVDLTarget

func (m *BlobFetchState) MakeVDLTarget() vdl.Target

func (*BlobFetchState) Set

func (x *BlobFetchState) Set(label string) error

Set assigns label to x.

func (BlobFetchState) String

func (x BlobFetchState) String() string

String returns the string label of x.

func (BlobFetchState) VDLIsZero

func (x BlobFetchState) VDLIsZero() bool

func (*BlobFetchState) VDLRead

func (x *BlobFetchState) VDLRead(dec vdl.Decoder) error

func (BlobFetchState) VDLWrite

func (x BlobFetchState) VDLWrite(enc vdl.Encoder) error

type BlobFetchStateTarget

type BlobFetchStateTarget struct {
	Value *BlobFetchState
	vdl.TargetBase
}

func (*BlobFetchStateTarget) FromEnumLabel

func (t *BlobFetchStateTarget) FromEnumLabel(src string, tt *vdl.Type) error

type BlobFetchStatus

type BlobFetchStatus struct {
	State    BlobFetchState // State of the blob fetch request.
	Received int64          // Total number of bytes received.
	Total    int64          // Blob size.
}

BlobFetchStatus describes the progress of an asynchronous blob fetch.

func (*BlobFetchStatus) FillVDLTarget

func (m *BlobFetchStatus) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BlobFetchStatus) MakeVDLTarget

func (m *BlobFetchStatus) MakeVDLTarget() vdl.Target

func (BlobFetchStatus) VDLIsZero

func (x BlobFetchStatus) VDLIsZero() bool

func (*BlobFetchStatus) VDLRead

func (x *BlobFetchStatus) VDLRead(dec vdl.Decoder) error

func (BlobFetchStatus) VDLWrite

func (x BlobFetchStatus) VDLWrite(enc vdl.Encoder) error

type BlobFetchStatusTarget

type BlobFetchStatusTarget struct {
	Value *BlobFetchStatus

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*BlobFetchStatusTarget) FinishField

func (t *BlobFetchStatusTarget) FinishField(_, _ vdl.Target) error

func (*BlobFetchStatusTarget) FinishFields

func (t *BlobFetchStatusTarget) FinishFields(_ vdl.FieldsTarget) error

func (*BlobFetchStatusTarget) StartField

func (t *BlobFetchStatusTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*BlobFetchStatusTarget) StartFields

func (t *BlobFetchStatusTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*BlobFetchStatusTarget) ZeroField

func (t *BlobFetchStatusTarget) ZeroField(name string) error

type BlobManagerClientMethods

type BlobManagerClientMethods interface {
	// CreateBlob returns a BlobRef for a newly created blob.
	CreateBlob(*context.T, ...rpc.CallOpt) (br BlobRef, _ error)
	// PutBlob appends the byte stream to the blob.
	PutBlob(_ *context.T, br BlobRef, _ ...rpc.CallOpt) (BlobManagerPutBlobClientCall, error)
	// CommitBlob marks the blob as immutable.
	CommitBlob(_ *context.T, br BlobRef, _ ...rpc.CallOpt) error
	// GetBlobSize returns the count of bytes written as part of the blob
	// (committed or uncommitted).
	GetBlobSize(_ *context.T, br BlobRef, _ ...rpc.CallOpt) (int64, error)
	// DeleteBlob locally deletes the blob (committed or uncommitted).
	DeleteBlob(_ *context.T, br BlobRef, _ ...rpc.CallOpt) error
	// GetBlob returns the byte stream from a committed blob starting at offset.
	GetBlob(_ *context.T, br BlobRef, offset int64, _ ...rpc.CallOpt) (BlobManagerGetBlobClientCall, error)
	// FetchBlob initiates fetching a blob if not locally found. priority
	// controls the network priority of the blob. Higher priority blobs are
	// fetched before the lower priority ones. However, an ongoing blob
	// transfer is not interrupted. Status updates are streamed back to the
	// client as fetch is in progress.
	FetchBlob(_ *context.T, br BlobRef, priority uint64, _ ...rpc.CallOpt) (BlobManagerFetchBlobClientCall, error)
	// PinBlob locally pins the blob so that it is not evicted.
	PinBlob(_ *context.T, br BlobRef, _ ...rpc.CallOpt) error
	// UnpinBlob locally unpins the blob so that it can be evicted if needed.
	UnpinBlob(_ *context.T, br BlobRef, _ ...rpc.CallOpt) error
	// KeepBlob locally caches the blob with the specified rank. Lower
	// ranked blobs are more eagerly evicted.
	KeepBlob(_ *context.T, br BlobRef, rank uint64, _ ...rpc.CallOpt) error
}

BlobManagerClientMethods is the client interface containing BlobManager methods.

BlobManager is the interface for blob operations.

Description of API for resumable blob creation (append-only):

  • Up until commit, a BlobRef may be used with PutBlob, GetBlobSize, DeleteBlob, and CommitBlob. Blob creation may be resumed by obtaining the current blob size via GetBlobSize and appending to the blob via PutBlob.
  • After commit, a blob is immutable, at which point PutBlob and CommitBlob may no longer be used.
  • All other methods (GetBlob, FetchBlob, PinBlob, etc.) may only be used after commit.

type BlobManagerClientStub

type BlobManagerClientStub interface {
	BlobManagerClientMethods
	rpc.UniversalServiceMethods
}

BlobManagerClientStub adds universal methods to BlobManagerClientMethods.

func BlobManagerClient

func BlobManagerClient(name string) BlobManagerClientStub

BlobManagerClient returns a client stub for BlobManager.

type BlobManagerFetchBlobClientCall

type BlobManagerFetchBlobClientCall interface {
	BlobManagerFetchBlobClientStream
	// 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() error
}

BlobManagerFetchBlobClientCall represents the call returned from BlobManager.FetchBlob.

type BlobManagerFetchBlobClientStream

type BlobManagerFetchBlobClientStream interface {
	// RecvStream returns the receiver side of the BlobManager.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() BlobFetchStatus
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
}

BlobManagerFetchBlobClientStream is the client stream for BlobManager.FetchBlob.

type BlobManagerFetchBlobServerCall

type BlobManagerFetchBlobServerCall interface {
	rpc.ServerCall
	BlobManagerFetchBlobServerStream
}

BlobManagerFetchBlobServerCall represents the context passed to BlobManager.FetchBlob.

type BlobManagerFetchBlobServerCallStub

type BlobManagerFetchBlobServerCallStub struct {
	rpc.StreamServerCall
}

BlobManagerFetchBlobServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements BlobManagerFetchBlobServerCall.

func (*BlobManagerFetchBlobServerCallStub) Init

Init initializes BlobManagerFetchBlobServerCallStub from rpc.StreamServerCall.

func (*BlobManagerFetchBlobServerCallStub) SendStream

func (s *BlobManagerFetchBlobServerCallStub) SendStream() interface {
	Send(item BlobFetchStatus) error
}

SendStream returns the send side of the BlobManager.FetchBlob server stream.

type BlobManagerFetchBlobServerStream

type BlobManagerFetchBlobServerStream interface {
	// SendStream returns the send side of the BlobManager.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 BlobFetchStatus) error
	}
}

BlobManagerFetchBlobServerStream is the server stream for BlobManager.FetchBlob.

type BlobManagerGetBlobClientCall

type BlobManagerGetBlobClientCall interface {
	BlobManagerGetBlobClientStream
	// 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() error
}

BlobManagerGetBlobClientCall represents the call returned from BlobManager.GetBlob.

type BlobManagerGetBlobClientStream

type BlobManagerGetBlobClientStream interface {
	// RecvStream returns the receiver side of the BlobManager.GetBlob 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
	}
}

BlobManagerGetBlobClientStream is the client stream for BlobManager.GetBlob.

type BlobManagerGetBlobServerCall

type BlobManagerGetBlobServerCall interface {
	rpc.ServerCall
	BlobManagerGetBlobServerStream
}

BlobManagerGetBlobServerCall represents the context passed to BlobManager.GetBlob.

type BlobManagerGetBlobServerCallStub

type BlobManagerGetBlobServerCallStub struct {
	rpc.StreamServerCall
}

BlobManagerGetBlobServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements BlobManagerGetBlobServerCall.

func (*BlobManagerGetBlobServerCallStub) Init

Init initializes BlobManagerGetBlobServerCallStub from rpc.StreamServerCall.

func (*BlobManagerGetBlobServerCallStub) SendStream

func (s *BlobManagerGetBlobServerCallStub) SendStream() interface {
	Send(item []byte) error
}

SendStream returns the send side of the BlobManager.GetBlob server stream.

type BlobManagerGetBlobServerStream

type BlobManagerGetBlobServerStream interface {
	// SendStream returns the send side of the BlobManager.GetBlob 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
	}
}

BlobManagerGetBlobServerStream is the server stream for BlobManager.GetBlob.

type BlobManagerPutBlobClientCall

type BlobManagerPutBlobClientCall interface {
	BlobManagerPutBlobClientStream
	// 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
}

BlobManagerPutBlobClientCall represents the call returned from BlobManager.PutBlob.

type BlobManagerPutBlobClientStream

type BlobManagerPutBlobClientStream interface {
	// SendStream returns the send side of the BlobManager.PutBlob 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 []byte) 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
	}
}

BlobManagerPutBlobClientStream is the client stream for BlobManager.PutBlob.

type BlobManagerPutBlobServerCall

type BlobManagerPutBlobServerCall interface {
	rpc.ServerCall
	BlobManagerPutBlobServerStream
}

BlobManagerPutBlobServerCall represents the context passed to BlobManager.PutBlob.

type BlobManagerPutBlobServerCallStub

type BlobManagerPutBlobServerCallStub struct {
	rpc.StreamServerCall
	// contains filtered or unexported fields
}

BlobManagerPutBlobServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements BlobManagerPutBlobServerCall.

func (*BlobManagerPutBlobServerCallStub) Init

Init initializes BlobManagerPutBlobServerCallStub from rpc.StreamServerCall.

func (*BlobManagerPutBlobServerCallStub) RecvStream

func (s *BlobManagerPutBlobServerCallStub) RecvStream() interface {
	Advance() bool
	Value() []byte
	Err() error
}

RecvStream returns the receiver side of the BlobManager.PutBlob server stream.

type BlobManagerPutBlobServerStream

type BlobManagerPutBlobServerStream interface {
	// RecvStream returns the receiver side of the BlobManager.PutBlob 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() []byte
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
}

BlobManagerPutBlobServerStream is the server stream for BlobManager.PutBlob.

type BlobManagerServerMethods

type BlobManagerServerMethods interface {
	// CreateBlob returns a BlobRef for a newly created blob.
	CreateBlob(*context.T, rpc.ServerCall) (br BlobRef, _ error)
	// PutBlob appends the byte stream to the blob.
	PutBlob(_ *context.T, _ BlobManagerPutBlobServerCall, br BlobRef) error
	// CommitBlob marks the blob as immutable.
	CommitBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// GetBlobSize returns the count of bytes written as part of the blob
	// (committed or uncommitted).
	GetBlobSize(_ *context.T, _ rpc.ServerCall, br BlobRef) (int64, error)
	// DeleteBlob locally deletes the blob (committed or uncommitted).
	DeleteBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// GetBlob returns the byte stream from a committed blob starting at offset.
	GetBlob(_ *context.T, _ BlobManagerGetBlobServerCall, br BlobRef, offset int64) error
	// FetchBlob initiates fetching a blob if not locally found. priority
	// controls the network priority of the blob. Higher priority blobs are
	// fetched before the lower priority ones. However, an ongoing blob
	// transfer is not interrupted. Status updates are streamed back to the
	// client as fetch is in progress.
	FetchBlob(_ *context.T, _ BlobManagerFetchBlobServerCall, br BlobRef, priority uint64) error
	// PinBlob locally pins the blob so that it is not evicted.
	PinBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// UnpinBlob locally unpins the blob so that it can be evicted if needed.
	UnpinBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// KeepBlob locally caches the blob with the specified rank. Lower
	// ranked blobs are more eagerly evicted.
	KeepBlob(_ *context.T, _ rpc.ServerCall, br BlobRef, rank uint64) error
}

BlobManagerServerMethods is the interface a server writer implements for BlobManager.

BlobManager is the interface for blob operations.

Description of API for resumable blob creation (append-only):

  • Up until commit, a BlobRef may be used with PutBlob, GetBlobSize, DeleteBlob, and CommitBlob. Blob creation may be resumed by obtaining the current blob size via GetBlobSize and appending to the blob via PutBlob.
  • After commit, a blob is immutable, at which point PutBlob and CommitBlob may no longer be used.
  • All other methods (GetBlob, FetchBlob, PinBlob, etc.) may only be used after commit.

type BlobManagerServerStub

type BlobManagerServerStub interface {
	BlobManagerServerStubMethods
	// Describe the BlobManager interfaces.
	Describe__() []rpc.InterfaceDesc
}

BlobManagerServerStub adds universal methods to BlobManagerServerStubMethods.

func BlobManagerServer

func BlobManagerServer(impl BlobManagerServerMethods) BlobManagerServerStub

BlobManagerServer returns a server stub for BlobManager. It converts an implementation of BlobManagerServerMethods into an object that may be used by rpc.Server.

type BlobManagerServerStubMethods

type BlobManagerServerStubMethods interface {
	// CreateBlob returns a BlobRef for a newly created blob.
	CreateBlob(*context.T, rpc.ServerCall) (br BlobRef, _ error)
	// PutBlob appends the byte stream to the blob.
	PutBlob(_ *context.T, _ *BlobManagerPutBlobServerCallStub, br BlobRef) error
	// CommitBlob marks the blob as immutable.
	CommitBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// GetBlobSize returns the count of bytes written as part of the blob
	// (committed or uncommitted).
	GetBlobSize(_ *context.T, _ rpc.ServerCall, br BlobRef) (int64, error)
	// DeleteBlob locally deletes the blob (committed or uncommitted).
	DeleteBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// GetBlob returns the byte stream from a committed blob starting at offset.
	GetBlob(_ *context.T, _ *BlobManagerGetBlobServerCallStub, br BlobRef, offset int64) error
	// FetchBlob initiates fetching a blob if not locally found. priority
	// controls the network priority of the blob. Higher priority blobs are
	// fetched before the lower priority ones. However, an ongoing blob
	// transfer is not interrupted. Status updates are streamed back to the
	// client as fetch is in progress.
	FetchBlob(_ *context.T, _ *BlobManagerFetchBlobServerCallStub, br BlobRef, priority uint64) error
	// PinBlob locally pins the blob so that it is not evicted.
	PinBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// UnpinBlob locally unpins the blob so that it can be evicted if needed.
	UnpinBlob(_ *context.T, _ rpc.ServerCall, br BlobRef) error
	// KeepBlob locally caches the blob with the specified rank. Lower
	// ranked blobs are more eagerly evicted.
	KeepBlob(_ *context.T, _ rpc.ServerCall, br BlobRef, rank uint64) error
}

BlobManagerServerStubMethods is the server interface containing BlobManager methods, as expected by rpc.Server. The only difference between this interface and BlobManagerServerMethods is the streaming methods.

type BlobRef

type BlobRef string

BlobRef is a reference to a blob.

func (*BlobRef) FillVDLTarget

func (m *BlobRef) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*BlobRef) MakeVDLTarget

func (m *BlobRef) MakeVDLTarget() vdl.Target

func (BlobRef) VDLIsZero

func (x BlobRef) VDLIsZero() bool

func (*BlobRef) VDLRead

func (x *BlobRef) VDLRead(dec vdl.Decoder) error

func (BlobRef) VDLWrite

func (x BlobRef) VDLWrite(enc vdl.Encoder) error

type BlobRefTarget

type BlobRefTarget struct {
	Value *BlobRef
	vdl.TargetBase
}

func (*BlobRefTarget) FromString

func (t *BlobRefTarget) FromString(src string, tt *vdl.Type) error

type CollectionClientMethods

type CollectionClientMethods interface {
	// Create creates this Collection.
	// TODO(sadovsky): Specify what happens if perms is nil.
	Create(_ *context.T, bh BatchHandle, perms access.Permissions, _ ...rpc.CallOpt) error
	// Destroy destroys this Collection, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) error
	// Exists returns true only if this Collection exists. Insufficient
	// permissions cause Exists to return false instead of an error.
	// TODO(ivanpi): Exists may fail with an error if higher levels of hierarchy
	// do not exist.
	Exists(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) (bool, error)
	// GetPermissions returns the current Permissions for the Collection.
	GetPermissions(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) (access.Permissions, error)
	// SetPermissions replaces the current Permissions for the Collection.
	SetPermissions(_ *context.T, bh BatchHandle, perms access.Permissions, _ ...rpc.CallOpt) error
	// DeleteRange deletes all rows in the given half-open range [start, limit).
	// If limit is "", all rows with keys >= start are included.
	DeleteRange(_ *context.T, bh BatchHandle, start []byte, limit []byte, _ ...rpc.CallOpt) error
	// Scan returns all rows in the given half-open range [start, limit). If limit
	// is "", all rows with keys >= start are included.
	// Concurrency semantics are documented in model.go.
	Scan(_ *context.T, bh BatchHandle, start []byte, limit []byte, _ ...rpc.CallOpt) (CollectionScanClientCall, error)
}

CollectionClientMethods is the client interface containing Collection methods.

Collection represents a set of Rows. Collection.Glob operates over keys of Rows in the Collection.

type CollectionClientStub

type CollectionClientStub interface {
	CollectionClientMethods
	rpc.UniversalServiceMethods
}

CollectionClientStub adds universal methods to CollectionClientMethods.

func CollectionClient

func CollectionClient(name string) CollectionClientStub

CollectionClient returns a client stub for Collection.

type CollectionRow

type CollectionRow struct {
	CollectionId Id
	Row          string
}

CollectionRow encapsulates a collection id and row key or row prefix.

func (*CollectionRow) FillVDLTarget

func (m *CollectionRow) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*CollectionRow) MakeVDLTarget

func (m *CollectionRow) MakeVDLTarget() vdl.Target

func (CollectionRow) VDLIsZero

func (x CollectionRow) VDLIsZero() bool

func (*CollectionRow) VDLRead

func (x *CollectionRow) VDLRead(dec vdl.Decoder) error

func (CollectionRow) VDLWrite

func (x CollectionRow) VDLWrite(enc vdl.Encoder) error

type CollectionRowTarget

type CollectionRowTarget struct {
	Value *CollectionRow

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*CollectionRowTarget) FinishField

func (t *CollectionRowTarget) FinishField(_, _ vdl.Target) error

func (*CollectionRowTarget) FinishFields

func (t *CollectionRowTarget) FinishFields(_ vdl.FieldsTarget) error

func (*CollectionRowTarget) StartField

func (t *CollectionRowTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*CollectionRowTarget) StartFields

func (t *CollectionRowTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*CollectionRowTarget) ZeroField

func (t *CollectionRowTarget) ZeroField(name string) error

type CollectionScanClientCall

type CollectionScanClientCall interface {
	CollectionScanClientStream
	// 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() error
}

CollectionScanClientCall represents the call returned from Collection.Scan.

type CollectionScanClientStream

type CollectionScanClientStream interface {
	// RecvStream returns the receiver side of the Collection.Scan 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() KeyValue
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
}

CollectionScanClientStream is the client stream for Collection.Scan.

type CollectionScanServerCall

type CollectionScanServerCall interface {
	rpc.ServerCall
	CollectionScanServerStream
}

CollectionScanServerCall represents the context passed to Collection.Scan.

type CollectionScanServerCallStub

type CollectionScanServerCallStub struct {
	rpc.StreamServerCall
}

CollectionScanServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements CollectionScanServerCall.

func (*CollectionScanServerCallStub) Init

Init initializes CollectionScanServerCallStub from rpc.StreamServerCall.

func (*CollectionScanServerCallStub) SendStream

func (s *CollectionScanServerCallStub) SendStream() interface {
	Send(item KeyValue) error
}

SendStream returns the send side of the Collection.Scan server stream.

type CollectionScanServerStream

type CollectionScanServerStream interface {
	// SendStream returns the send side of the Collection.Scan 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 KeyValue) error
	}
}

CollectionScanServerStream is the server stream for Collection.Scan.

type CollectionServerMethods

type CollectionServerMethods interface {
	// Create creates this Collection.
	// TODO(sadovsky): Specify what happens if perms is nil.
	Create(_ *context.T, _ rpc.ServerCall, bh BatchHandle, perms access.Permissions) error
	// Destroy destroys this Collection, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// Exists returns true only if this Collection exists. Insufficient
	// permissions cause Exists to return false instead of an error.
	// TODO(ivanpi): Exists may fail with an error if higher levels of hierarchy
	// do not exist.
	Exists(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (bool, error)
	// GetPermissions returns the current Permissions for the Collection.
	GetPermissions(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (access.Permissions, error)
	// SetPermissions replaces the current Permissions for the Collection.
	SetPermissions(_ *context.T, _ rpc.ServerCall, bh BatchHandle, perms access.Permissions) error
	// DeleteRange deletes all rows in the given half-open range [start, limit).
	// If limit is "", all rows with keys >= start are included.
	DeleteRange(_ *context.T, _ rpc.ServerCall, bh BatchHandle, start []byte, limit []byte) error
	// Scan returns all rows in the given half-open range [start, limit). If limit
	// is "", all rows with keys >= start are included.
	// Concurrency semantics are documented in model.go.
	Scan(_ *context.T, _ CollectionScanServerCall, bh BatchHandle, start []byte, limit []byte) error
}

CollectionServerMethods is the interface a server writer implements for Collection.

Collection represents a set of Rows. Collection.Glob operates over keys of Rows in the Collection.

type CollectionServerStub

type CollectionServerStub interface {
	CollectionServerStubMethods
	// Describe the Collection interfaces.
	Describe__() []rpc.InterfaceDesc
}

CollectionServerStub adds universal methods to CollectionServerStubMethods.

func CollectionServer

func CollectionServer(impl CollectionServerMethods) CollectionServerStub

CollectionServer returns a server stub for Collection. It converts an implementation of CollectionServerMethods into an object that may be used by rpc.Server.

type CollectionServerStubMethods

type CollectionServerStubMethods interface {
	// Create creates this Collection.
	// TODO(sadovsky): Specify what happens if perms is nil.
	Create(_ *context.T, _ rpc.ServerCall, bh BatchHandle, perms access.Permissions) error
	// Destroy destroys this Collection, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// Exists returns true only if this Collection exists. Insufficient
	// permissions cause Exists to return false instead of an error.
	// TODO(ivanpi): Exists may fail with an error if higher levels of hierarchy
	// do not exist.
	Exists(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (bool, error)
	// GetPermissions returns the current Permissions for the Collection.
	GetPermissions(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (access.Permissions, error)
	// SetPermissions replaces the current Permissions for the Collection.
	SetPermissions(_ *context.T, _ rpc.ServerCall, bh BatchHandle, perms access.Permissions) error
	// DeleteRange deletes all rows in the given half-open range [start, limit).
	// If limit is "", all rows with keys >= start are included.
	DeleteRange(_ *context.T, _ rpc.ServerCall, bh BatchHandle, start []byte, limit []byte) error
	// Scan returns all rows in the given half-open range [start, limit). If limit
	// is "", all rows with keys >= start are included.
	// Concurrency semantics are documented in model.go.
	Scan(_ *context.T, _ *CollectionScanServerCallStub, bh BatchHandle, start []byte, limit []byte) error
}

CollectionServerStubMethods is the server interface containing Collection methods, as expected by rpc.Server. The only difference between this interface and CollectionServerMethods is the streaming methods.

type ConflictData

type ConflictData 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
}

ConflictData represents any single field of the ConflictData union type.

ConflictData represents a unit of conflict data sent over the stream. It can either contain information about a Batch or about an operation done on a row.

type ConflictDataBatch

type ConflictDataBatch struct{ Value BatchInfo }

ConflictDataBatch represents field Batch of the ConflictData union type.

func (ConflictDataBatch) FillVDLTarget

func (m ConflictDataBatch) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (ConflictDataBatch) Index

func (x ConflictDataBatch) Index() int

func (ConflictDataBatch) Interface

func (x ConflictDataBatch) Interface() interface{}

func (ConflictDataBatch) MakeVDLTarget

func (m ConflictDataBatch) MakeVDLTarget() vdl.Target

func (ConflictDataBatch) Name

func (x ConflictDataBatch) Name() string

func (ConflictDataBatch) VDLIsZero

func (x ConflictDataBatch) VDLIsZero() bool

func (ConflictDataBatch) VDLWrite

func (x ConflictDataBatch) VDLWrite(enc vdl.Encoder) error

type ConflictDataRow

type ConflictDataRow struct{ Value RowInfo }

ConflictDataRow represents field Row of the ConflictData union type.

func (ConflictDataRow) FillVDLTarget

func (m ConflictDataRow) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (ConflictDataRow) Index

func (x ConflictDataRow) Index() int

func (ConflictDataRow) Interface

func (x ConflictDataRow) Interface() interface{}

func (ConflictDataRow) MakeVDLTarget

func (m ConflictDataRow) MakeVDLTarget() vdl.Target

func (ConflictDataRow) Name

func (x ConflictDataRow) Name() string

func (ConflictDataRow) VDLIsZero

func (x ConflictDataRow) VDLIsZero() bool

func (ConflictDataRow) VDLWrite

func (x ConflictDataRow) VDLWrite(enc vdl.Encoder) error

type ConflictDataTarget

type ConflictDataTarget struct {
	Value *ConflictData

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*ConflictDataTarget) FinishField

func (t *ConflictDataTarget) FinishField(_, fieldTarget vdl.Target) error

func (*ConflictDataTarget) FinishFields

func (t *ConflictDataTarget) FinishFields(_ vdl.FieldsTarget) error

func (*ConflictDataTarget) StartField

func (t *ConflictDataTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*ConflictDataTarget) StartFields

func (t *ConflictDataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

type ConflictInfo

type ConflictInfo struct {
	// Data is a unit chunk of ConflictInfo which can be sent over the conflict
	// stream.
	Data ConflictData
	// Continued represents whether the batch of ConflictInfos has ended.
	Continued bool
}

ConflictInfo contains information to fully specify a conflict for a key, providing the (local, remote, ancestor) tuple. A key under conflict can be a part of a batch in local, remote or both updates. Since the batches can have more than one key, all ConflictInfos for the keys within the batches are grouped together into a single conflict batch and sent as a stream with the Continued field representing conflict batch boundaries.

func (*ConflictInfo) FillVDLTarget

func (m *ConflictInfo) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ConflictInfo) MakeVDLTarget

func (m *ConflictInfo) MakeVDLTarget() vdl.Target

func (ConflictInfo) VDLIsZero

func (x ConflictInfo) VDLIsZero() bool

func (*ConflictInfo) VDLRead

func (x *ConflictInfo) VDLRead(dec vdl.Decoder) error

func (ConflictInfo) VDLWrite

func (x ConflictInfo) VDLWrite(enc vdl.Encoder) error

type ConflictInfoTarget

type ConflictInfoTarget struct {
	Value *ConflictInfo

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*ConflictInfoTarget) FinishField

func (t *ConflictInfoTarget) FinishField(_, _ vdl.Target) error

func (*ConflictInfoTarget) FinishFields

func (t *ConflictInfoTarget) FinishFields(_ vdl.FieldsTarget) error

func (*ConflictInfoTarget) StartField

func (t *ConflictInfoTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*ConflictInfoTarget) StartFields

func (t *ConflictInfoTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*ConflictInfoTarget) ZeroField

func (t *ConflictInfoTarget) ZeroField(name string) error

type ConflictManagerClientMethods

type ConflictManagerClientMethods interface {
	// StartConflictResolver registers a resolver for the database that is
	// associated with this ConflictManager and creates a stream to receive
	// conflicts and send resolutions.
	// Batches of ConflictInfos will be sent over with the Continued field
	// within the ConflictInfo representing the batch boundary. Client must
	// respond with a batch of ResolutionInfos in the same fashion.
	// A key is under conflict if two different values were written to it
	// concurrently (in logical time), i.e. neither value is an ancestor of the
	// other in the history graph.
	// A key under conflict can be a part of a batch committed on local or
	// remote or both syncbases. ConflictInfos for all keys in these two batches
	// are grouped together. These keys may themselves be under conflict; the
	// presented batch is a transitive closure of all batches containing keys
	// under conflict.
	// For example, for local batch {key1, key2} and remote batch {key1, key3},
	// the batch sent for conflict resolution will be {key1, key2, key3}.
	// If there was another concurrent batch {key2, key4}, then the batch sent
	// for conflict resolution will be {key1, key2, key3, key4}.
	StartConflictResolver(*context.T, ...rpc.CallOpt) (ConflictManagerStartConflictResolverClientCall, error)
}

ConflictManagerClientMethods is the client interface containing ConflictManager methods.

ConflictManager interface provides all the methods necessary to handle conflict resolution for a given database.

type ConflictManagerClientStub

type ConflictManagerClientStub interface {
	ConflictManagerClientMethods
	rpc.UniversalServiceMethods
}

ConflictManagerClientStub adds universal methods to ConflictManagerClientMethods.

func ConflictManagerClient

func ConflictManagerClient(name string) ConflictManagerClientStub

ConflictManagerClient returns a client stub for ConflictManager.

type ConflictManagerServerMethods

type ConflictManagerServerMethods interface {
	// StartConflictResolver registers a resolver for the database that is
	// associated with this ConflictManager and creates a stream to receive
	// conflicts and send resolutions.
	// Batches of ConflictInfos will be sent over with the Continued field
	// within the ConflictInfo representing the batch boundary. Client must
	// respond with a batch of ResolutionInfos in the same fashion.
	// A key is under conflict if two different values were written to it
	// concurrently (in logical time), i.e. neither value is an ancestor of the
	// other in the history graph.
	// A key under conflict can be a part of a batch committed on local or
	// remote or both syncbases. ConflictInfos for all keys in these two batches
	// are grouped together. These keys may themselves be under conflict; the
	// presented batch is a transitive closure of all batches containing keys
	// under conflict.
	// For example, for local batch {key1, key2} and remote batch {key1, key3},
	// the batch sent for conflict resolution will be {key1, key2, key3}.
	// If there was another concurrent batch {key2, key4}, then the batch sent
	// for conflict resolution will be {key1, key2, key3, key4}.
	StartConflictResolver(*context.T, ConflictManagerStartConflictResolverServerCall) error
}

ConflictManagerServerMethods is the interface a server writer implements for ConflictManager.

ConflictManager interface provides all the methods necessary to handle conflict resolution for a given database.

type ConflictManagerServerStub

type ConflictManagerServerStub interface {
	ConflictManagerServerStubMethods
	// Describe the ConflictManager interfaces.
	Describe__() []rpc.InterfaceDesc
}

ConflictManagerServerStub adds universal methods to ConflictManagerServerStubMethods.

func ConflictManagerServer

func ConflictManagerServer(impl ConflictManagerServerMethods) ConflictManagerServerStub

ConflictManagerServer returns a server stub for ConflictManager. It converts an implementation of ConflictManagerServerMethods into an object that may be used by rpc.Server.

type ConflictManagerServerStubMethods

type ConflictManagerServerStubMethods interface {
	// StartConflictResolver registers a resolver for the database that is
	// associated with this ConflictManager and creates a stream to receive
	// conflicts and send resolutions.
	// Batches of ConflictInfos will be sent over with the Continued field
	// within the ConflictInfo representing the batch boundary. Client must
	// respond with a batch of ResolutionInfos in the same fashion.
	// A key is under conflict if two different values were written to it
	// concurrently (in logical time), i.e. neither value is an ancestor of the
	// other in the history graph.
	// A key under conflict can be a part of a batch committed on local or
	// remote or both syncbases. ConflictInfos for all keys in these two batches
	// are grouped together. These keys may themselves be under conflict; the
	// presented batch is a transitive closure of all batches containing keys
	// under conflict.
	// For example, for local batch {key1, key2} and remote batch {key1, key3},
	// the batch sent for conflict resolution will be {key1, key2, key3}.
	// If there was another concurrent batch {key2, key4}, then the batch sent
	// for conflict resolution will be {key1, key2, key3, key4}.
	StartConflictResolver(*context.T, *ConflictManagerStartConflictResolverServerCallStub) error
}

ConflictManagerServerStubMethods is the server interface containing ConflictManager methods, as expected by rpc.Server. The only difference between this interface and ConflictManagerServerMethods is the streaming methods.

type ConflictManagerStartConflictResolverClientCall

type ConflictManagerStartConflictResolverClientCall interface {
	ConflictManagerStartConflictResolverClientStream
	// 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
}

ConflictManagerStartConflictResolverClientCall represents the call returned from ConflictManager.StartConflictResolver.

type ConflictManagerStartConflictResolverClientStream

type ConflictManagerStartConflictResolverClientStream interface {
	// RecvStream returns the receiver side of the ConflictManager.StartConflictResolver 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() ConflictInfo
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the ConflictManager.StartConflictResolver 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 ResolutionInfo) 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
	}
}

ConflictManagerStartConflictResolverClientStream is the client stream for ConflictManager.StartConflictResolver.

type ConflictManagerStartConflictResolverServerCall

type ConflictManagerStartConflictResolverServerCall interface {
	rpc.ServerCall
	ConflictManagerStartConflictResolverServerStream
}

ConflictManagerStartConflictResolverServerCall represents the context passed to ConflictManager.StartConflictResolver.

type ConflictManagerStartConflictResolverServerCallStub

type ConflictManagerStartConflictResolverServerCallStub struct {
	rpc.StreamServerCall
	// contains filtered or unexported fields
}

ConflictManagerStartConflictResolverServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements ConflictManagerStartConflictResolverServerCall.

func (*ConflictManagerStartConflictResolverServerCallStub) Init

Init initializes ConflictManagerStartConflictResolverServerCallStub from rpc.StreamServerCall.

func (*ConflictManagerStartConflictResolverServerCallStub) RecvStream

func (s *ConflictManagerStartConflictResolverServerCallStub) RecvStream() interface {
	Advance() bool
	Value() ResolutionInfo
	Err() error
}

RecvStream returns the receiver side of the ConflictManager.StartConflictResolver server stream.

func (*ConflictManagerStartConflictResolverServerCallStub) SendStream

func (s *ConflictManagerStartConflictResolverServerCallStub) SendStream() interface {
	Send(item ConflictInfo) error
}

SendStream returns the send side of the ConflictManager.StartConflictResolver server stream.

type ConflictManagerStartConflictResolverServerStream

type ConflictManagerStartConflictResolverServerStream interface {
	// RecvStream returns the receiver side of the ConflictManager.StartConflictResolver 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() ResolutionInfo
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
	// SendStream returns the send side of the ConflictManager.StartConflictResolver 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 ConflictInfo) error
	}
}

ConflictManagerStartConflictResolverServerStream is the server stream for ConflictManager.StartConflictResolver.

type CrPolicy

type CrPolicy struct {
	Rules []CrRule
}

For a given row with a conflict, all rules are matched against the row. If no rules match the row, we default to "LastWins". If multiple rules match the row, ties are broken as follows:

  1. If one match has a longer prefix than the other, take that one.
  2. Else, if only one match specifies a type, take that one.
  3. Else, the two matches are identical; take the last one in the Rules array.

func (*CrPolicy) FillVDLTarget

func (m *CrPolicy) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*CrPolicy) MakeVDLTarget

func (m *CrPolicy) MakeVDLTarget() vdl.Target

func (CrPolicy) VDLIsZero

func (x CrPolicy) VDLIsZero() bool

func (*CrPolicy) VDLRead

func (x *CrPolicy) VDLRead(dec vdl.Decoder) error

func (CrPolicy) VDLWrite

func (x CrPolicy) VDLWrite(enc vdl.Encoder) error

type CrPolicyTarget

type CrPolicyTarget struct {
	Value *CrPolicy

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*CrPolicyTarget) FinishField

func (t *CrPolicyTarget) FinishField(_, _ vdl.Target) error

func (*CrPolicyTarget) FinishFields

func (t *CrPolicyTarget) FinishFields(_ vdl.FieldsTarget) error

func (*CrPolicyTarget) StartField

func (t *CrPolicyTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*CrPolicyTarget) StartFields

func (t *CrPolicyTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*CrPolicyTarget) ZeroField

func (t *CrPolicyTarget) ZeroField(name string) error

type CrRule

type CrRule struct {
	// CollectionId is the id of the collection that this rule applies to.
	CollectionId Id
	// KeyPrefix represents the set of keys within the given collection for which
	// this policy applies. CollectionId must not be empty if this field is set.
	KeyPrefix string
	// Type includes the full package path for the value type for which this
	// policy applies.
	Type string
	// Policy for resolving conflict.
	Resolver ResolverType
}

CrRule provides a filter and the type of resolution to perform for a row under conflict that passes the filter.

func (*CrRule) FillVDLTarget

func (m *CrRule) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*CrRule) MakeVDLTarget

func (m *CrRule) MakeVDLTarget() vdl.Target

func (CrRule) VDLIsZero

func (x CrRule) VDLIsZero() bool

func (*CrRule) VDLRead

func (x *CrRule) VDLRead(dec vdl.Decoder) error

func (CrRule) VDLWrite

func (x CrRule) VDLWrite(enc vdl.Encoder) error

type CrRuleTarget

type CrRuleTarget struct {
	Value *CrRule

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*CrRuleTarget) FinishField

func (t *CrRuleTarget) FinishField(_, _ vdl.Target) error

func (*CrRuleTarget) FinishFields

func (t *CrRuleTarget) FinishFields(_ vdl.FieldsTarget) error

func (*CrRuleTarget) StartField

func (t *CrRuleTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*CrRuleTarget) StartFields

func (t *CrRuleTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*CrRuleTarget) ZeroField

func (t *CrRuleTarget) ZeroField(name string) error

type DatabaseClientMethods

type DatabaseClientMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectClientMethods
	// DatabaseWatcher allows a client to watch for updates to the database. For
	// each watch request, the client will receive a reliable stream of watch events
	// without re-ordering. See watch.GlobWatcher for a detailed explanation of the
	// behavior.
	// TODO(rogulenko): Currently the only supported watch patterns are
	// "<collectionId>/<rowPrefix>*". Consider changing that.
	//
	// Watching is done by starting a streaming RPC. The RPC takes a ResumeMarker
	// argument that points to a particular place in the database event log. If an
	// empty ResumeMarker is provided, the WatchStream will begin with a Change
	// batch containing the initial state. Otherwise, the WatchStream will contain
	// only changes since the provided ResumeMarker.
	//
	// The result stream consists of a never-ending sequence of Change messages
	// (until the call fails or is canceled). Each Change contains the Name field in
	// the form "<collectionId>/<rowKey>" and the Value field of the StoreChange
	// type. If the client has no access to a row specified in a change, that change
	// is excluded from the result stream.
	//
	// Note: A single Watch Change batch may contain changes from more than one
	// batch as originally committed on a remote Syncbase or obtained from conflict
	// resolution. However, changes from a single original batch will always appear
	// in the same Change batch.
	DatabaseWatcherClientMethods
	// SyncgroupManager is the interface for syncgroup operations.
	// TODO(hpucha): Add blessings to create/join and add a refresh method.
	SyncgroupManagerClientMethods
	// BlobManager is the interface for blob operations.
	//
	// Description of API for resumable blob creation (append-only):
	// - Up until commit, a BlobRef may be used with PutBlob, GetBlobSize,
	//   DeleteBlob, and CommitBlob. Blob creation may be resumed by obtaining the
	//   current blob size via GetBlobSize and appending to the blob via PutBlob.
	// - After commit, a blob is immutable, at which point PutBlob and CommitBlob
	//   may no longer be used.
	// - All other methods (GetBlob, FetchBlob, PinBlob, etc.) may only be used
	//   after commit.
	BlobManagerClientMethods
	// SchemaManager implements the API for managing schema metadata attached
	// to a Database.
	SchemaManagerClientMethods
	// ConflictManager interface provides all the methods necessary to handle
	// conflict resolution for a given database.
	ConflictManagerClientMethods
	// Create creates this Database.
	// TODO(sadovsky): Specify what happens if perms is nil.
	// Create requires the caller to have Write permission at the Service.
	Create(_ *context.T, metadata *SchemaMetadata, perms access.Permissions, _ ...rpc.CallOpt) error
	// Destroy destroys this Database, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(*context.T, ...rpc.CallOpt) error
	// Exists returns true only if this Database exists. Insufficient permissions
	// cause Exists to return false instead of an error.
	Exists(*context.T, ...rpc.CallOpt) (bool, error)
	// ListCollections returns an unsorted list of all Collection ids that the
	// caller is allowed to see.
	// This method exists on Database but not on Service because for the latter
	// we can simply use glob, while for the former glob lists only Collections
	// visible in a new snapshot of the Database, ignoring user batches.
	// (Note that the same issue is present in glob on Collection, where Scan can
	// be used instead if batch awareness is required.)
	// Note, the glob client library checks Resolve access on every component
	// along the path (by doing a Dispatcher.Lookup), whereas this doesn't happen
	// for other RPCs.
	// TODO(ivanpi): Resolve should be checked on all RPCs.
	// TODO(sadovsky): Maybe switch to streaming RPC.
	ListCollections(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) ([]Id, error)
	// Exec executes a syncQL query with positional parameters and returns all
	// results as specified by the query's select/delete statement.
	// Concurrency semantics are documented in model.go.
	Exec(_ *context.T, bh BatchHandle, query string, params []*vom.RawBytes, _ ...rpc.CallOpt) (DatabaseExecClientCall, error)
	// BeginBatch creates a new batch. It returns a batch handle to pass in when
	// calling batch-aware RPCs.
	// Concurrency semantics are documented in model.go.
	// All batch-aware RPCs can also be called outside a batch (with an empty
	// handle), with the exception of Commit and Abort which only make sense on
	// a batch. Note that glob RPCs are not batch-aware.
	// TODO(sadovsky): Maybe make BatchOptions optional. Also, rename it to 'opts'
	// everywhere now that v.io/i/912 is resolved.
	BeginBatch(_ *context.T, bo BatchOptions, _ ...rpc.CallOpt) (BatchHandle, error)
	// Commit persists the pending changes to the database.
	// If the batch is readonly, Commit() will fail with ErrReadOnlyBatch; Abort()
	// should be used instead.
	// If the BatchHandle is empty, Commit() will fail with ErrNotBoundToBatch.
	Commit(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) error
	// Abort notifies the server that any pending changes can be discarded.
	// It is not strictly required, but it may allow the server to release locks
	// or other resources sooner than if it was not called.
	// If the BatchHandle is empty, Abort() will fail with ErrNotBoundToBatch.
	Abort(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) error
	// PauseSync pauses sync for this database. Incoming sync, as well as outgoing
	// sync of subsequent writes, will be disabled until ResumeSync is called.
	// PauseSync is idempotent.
	PauseSync(*context.T, ...rpc.CallOpt) error
	// ResumeSync resumes sync for this database. ResumeSync is idempotent.
	ResumeSync(*context.T, ...rpc.CallOpt) error
}

DatabaseClientMethods is the client interface containing Database methods.

Database represents a set of Collections. Batches, queries, syncgroups, and watch all operate at the Database level. Database.Glob operates over Collection ids.

type DatabaseClientStub

type DatabaseClientStub interface {
	DatabaseClientMethods
	rpc.UniversalServiceMethods
}

DatabaseClientStub adds universal methods to DatabaseClientMethods.

func DatabaseClient

func DatabaseClient(name string) DatabaseClientStub

DatabaseClient returns a client stub for Database.

type DatabaseExecClientCall

type DatabaseExecClientCall interface {
	DatabaseExecClientStream
	// 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() error
}

DatabaseExecClientCall represents the call returned from Database.Exec.

type DatabaseExecClientStream

type DatabaseExecClientStream interface {
	// RecvStream returns the receiver side of the Database.Exec 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() []*vom.RawBytes
		// Err returns any error encountered by Advance.  Never blocks.
		Err() error
	}
}

DatabaseExecClientStream is the client stream for Database.Exec.

type DatabaseExecServerCall

type DatabaseExecServerCall interface {
	rpc.ServerCall
	DatabaseExecServerStream
}

DatabaseExecServerCall represents the context passed to Database.Exec.

type DatabaseExecServerCallStub

type DatabaseExecServerCallStub struct {
	rpc.StreamServerCall
}

DatabaseExecServerCallStub is a wrapper that converts rpc.StreamServerCall into a typesafe stub that implements DatabaseExecServerCall.

func (*DatabaseExecServerCallStub) Init

Init initializes DatabaseExecServerCallStub from rpc.StreamServerCall.

func (*DatabaseExecServerCallStub) SendStream

func (s *DatabaseExecServerCallStub) SendStream() interface {
	Send(item []*vom.RawBytes) error
}

SendStream returns the send side of the Database.Exec server stream.

type DatabaseExecServerStream

type DatabaseExecServerStream interface {
	// SendStream returns the send side of the Database.Exec 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 []*vom.RawBytes) error
	}
}

DatabaseExecServerStream is the server stream for Database.Exec.

type DatabaseServerMethods

type DatabaseServerMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectServerMethods
	// DatabaseWatcher allows a client to watch for updates to the database. For
	// each watch request, the client will receive a reliable stream of watch events
	// without re-ordering. See watch.GlobWatcher for a detailed explanation of the
	// behavior.
	// TODO(rogulenko): Currently the only supported watch patterns are
	// "<collectionId>/<rowPrefix>*". Consider changing that.
	//
	// Watching is done by starting a streaming RPC. The RPC takes a ResumeMarker
	// argument that points to a particular place in the database event log. If an
	// empty ResumeMarker is provided, the WatchStream will begin with a Change
	// batch containing the initial state. Otherwise, the WatchStream will contain
	// only changes since the provided ResumeMarker.
	//
	// The result stream consists of a never-ending sequence of Change messages
	// (until the call fails or is canceled). Each Change contains the Name field in
	// the form "<collectionId>/<rowKey>" and the Value field of the StoreChange
	// type. If the client has no access to a row specified in a change, that change
	// is excluded from the result stream.
	//
	// Note: A single Watch Change batch may contain changes from more than one
	// batch as originally committed on a remote Syncbase or obtained from conflict
	// resolution. However, changes from a single original batch will always appear
	// in the same Change batch.
	DatabaseWatcherServerMethods
	// SyncgroupManager is the interface for syncgroup operations.
	// TODO(hpucha): Add blessings to create/join and add a refresh method.
	SyncgroupManagerServerMethods
	// BlobManager is the interface for blob operations.
	//
	// Description of API for resumable blob creation (append-only):
	// - Up until commit, a BlobRef may be used with PutBlob, GetBlobSize,
	//   DeleteBlob, and CommitBlob. Blob creation may be resumed by obtaining the
	//   current blob size via GetBlobSize and appending to the blob via PutBlob.
	// - After commit, a blob is immutable, at which point PutBlob and CommitBlob
	//   may no longer be used.
	// - All other methods (GetBlob, FetchBlob, PinBlob, etc.) may only be used
	//   after commit.
	BlobManagerServerMethods
	// SchemaManager implements the API for managing schema metadata attached
	// to a Database.
	SchemaManagerServerMethods
	// ConflictManager interface provides all the methods necessary to handle
	// conflict resolution for a given database.
	ConflictManagerServerMethods
	// Create creates this Database.
	// TODO(sadovsky): Specify what happens if perms is nil.
	// Create requires the caller to have Write permission at the Service.
	Create(_ *context.T, _ rpc.ServerCall, metadata *SchemaMetadata, perms access.Permissions) error
	// Destroy destroys this Database, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(*context.T, rpc.ServerCall) error
	// Exists returns true only if this Database exists. Insufficient permissions
	// cause Exists to return false instead of an error.
	Exists(*context.T, rpc.ServerCall) (bool, error)
	// ListCollections returns an unsorted list of all Collection ids that the
	// caller is allowed to see.
	// This method exists on Database but not on Service because for the latter
	// we can simply use glob, while for the former glob lists only Collections
	// visible in a new snapshot of the Database, ignoring user batches.
	// (Note that the same issue is present in glob on Collection, where Scan can
	// be used instead if batch awareness is required.)
	// Note, the glob client library checks Resolve access on every component
	// along the path (by doing a Dispatcher.Lookup), whereas this doesn't happen
	// for other RPCs.
	// TODO(ivanpi): Resolve should be checked on all RPCs.
	// TODO(sadovsky): Maybe switch to streaming RPC.
	ListCollections(_ *context.T, _ rpc.ServerCall, bh BatchHandle) ([]Id, error)
	// Exec executes a syncQL query with positional parameters and returns all
	// results as specified by the query's select/delete statement.
	// Concurrency semantics are documented in model.go.
	Exec(_ *context.T, _ DatabaseExecServerCall, bh BatchHandle, query string, params []*vom.RawBytes) error
	// BeginBatch creates a new batch. It returns a batch handle to pass in when
	// calling batch-aware RPCs.
	// Concurrency semantics are documented in model.go.
	// All batch-aware RPCs can also be called outside a batch (with an empty
	// handle), with the exception of Commit and Abort which only make sense on
	// a batch. Note that glob RPCs are not batch-aware.
	// TODO(sadovsky): Maybe make BatchOptions optional. Also, rename it to 'opts'
	// everywhere now that v.io/i/912 is resolved.
	BeginBatch(_ *context.T, _ rpc.ServerCall, bo BatchOptions) (BatchHandle, error)
	// Commit persists the pending changes to the database.
	// If the batch is readonly, Commit() will fail with ErrReadOnlyBatch; Abort()
	// should be used instead.
	// If the BatchHandle is empty, Commit() will fail with ErrNotBoundToBatch.
	Commit(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// Abort notifies the server that any pending changes can be discarded.
	// It is not strictly required, but it may allow the server to release locks
	// or other resources sooner than if it was not called.
	// If the BatchHandle is empty, Abort() will fail with ErrNotBoundToBatch.
	Abort(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// PauseSync pauses sync for this database. Incoming sync, as well as outgoing
	// sync of subsequent writes, will be disabled until ResumeSync is called.
	// PauseSync is idempotent.
	PauseSync(*context.T, rpc.ServerCall) error
	// ResumeSync resumes sync for this database. ResumeSync is idempotent.
	ResumeSync(*context.T, rpc.ServerCall) error
}

DatabaseServerMethods is the interface a server writer implements for Database.

Database represents a set of Collections. Batches, queries, syncgroups, and watch all operate at the Database level. Database.Glob operates over Collection ids.

type DatabaseServerStub

type DatabaseServerStub interface {
	DatabaseServerStubMethods
	// Describe the Database interfaces.
	Describe__() []rpc.InterfaceDesc
}

DatabaseServerStub adds universal methods to DatabaseServerStubMethods.

func DatabaseServer

func DatabaseServer(impl DatabaseServerMethods) DatabaseServerStub

DatabaseServer returns a server stub for Database. It converts an implementation of DatabaseServerMethods into an object that may be used by rpc.Server.

type DatabaseServerStubMethods

type DatabaseServerStubMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectServerStubMethods
	// DatabaseWatcher allows a client to watch for updates to the database. For
	// each watch request, the client will receive a reliable stream of watch events
	// without re-ordering. See watch.GlobWatcher for a detailed explanation of the
	// behavior.
	// TODO(rogulenko): Currently the only supported watch patterns are
	// "<collectionId>/<rowPrefix>*". Consider changing that.
	//
	// Watching is done by starting a streaming RPC. The RPC takes a ResumeMarker
	// argument that points to a particular place in the database event log. If an
	// empty ResumeMarker is provided, the WatchStream will begin with a Change
	// batch containing the initial state. Otherwise, the WatchStream will contain
	// only changes since the provided ResumeMarker.
	//
	// The result stream consists of a never-ending sequence of Change messages
	// (until the call fails or is canceled). Each Change contains the Name field in
	// the form "<collectionId>/<rowKey>" and the Value field of the StoreChange
	// type. If the client has no access to a row specified in a change, that change
	// is excluded from the result stream.
	//
	// Note: A single Watch Change batch may contain changes from more than one
	// batch as originally committed on a remote Syncbase or obtained from conflict
	// resolution. However, changes from a single original batch will always appear
	// in the same Change batch.
	DatabaseWatcherServerStubMethods
	// SyncgroupManager is the interface for syncgroup operations.
	// TODO(hpucha): Add blessings to create/join and add a refresh method.
	SyncgroupManagerServerStubMethods
	// BlobManager is the interface for blob operations.
	//
	// Description of API for resumable blob creation (append-only):
	// - Up until commit, a BlobRef may be used with PutBlob, GetBlobSize,
	//   DeleteBlob, and CommitBlob. Blob creation may be resumed by obtaining the
	//   current blob size via GetBlobSize and appending to the blob via PutBlob.
	// - After commit, a blob is immutable, at which point PutBlob and CommitBlob
	//   may no longer be used.
	// - All other methods (GetBlob, FetchBlob, PinBlob, etc.) may only be used
	//   after commit.
	BlobManagerServerStubMethods
	// SchemaManager implements the API for managing schema metadata attached
	// to a Database.
	SchemaManagerServerStubMethods
	// ConflictManager interface provides all the methods necessary to handle
	// conflict resolution for a given database.
	ConflictManagerServerStubMethods
	// Create creates this Database.
	// TODO(sadovsky): Specify what happens if perms is nil.
	// Create requires the caller to have Write permission at the Service.
	Create(_ *context.T, _ rpc.ServerCall, metadata *SchemaMetadata, perms access.Permissions) error
	// Destroy destroys this Database, permanently removing all of its data.
	// TODO(sadovsky): Specify what happens to syncgroups.
	Destroy(*context.T, rpc.ServerCall) error
	// Exists returns true only if this Database exists. Insufficient permissions
	// cause Exists to return false instead of an error.
	Exists(*context.T, rpc.ServerCall) (bool, error)
	// ListCollections returns an unsorted list of all Collection ids that the
	// caller is allowed to see.
	// This method exists on Database but not on Service because for the latter
	// we can simply use glob, while for the former glob lists only Collections
	// visible in a new snapshot of the Database, ignoring user batches.
	// (Note that the same issue is present in glob on Collection, where Scan can
	// be used instead if batch awareness is required.)
	// Note, the glob client library checks Resolve access on every component
	// along the path (by doing a Dispatcher.Lookup), whereas this doesn't happen
	// for other RPCs.
	// TODO(ivanpi): Resolve should be checked on all RPCs.
	// TODO(sadovsky): Maybe switch to streaming RPC.
	ListCollections(_ *context.T, _ rpc.ServerCall, bh BatchHandle) ([]Id, error)
	// Exec executes a syncQL query with positional parameters and returns all
	// results as specified by the query's select/delete statement.
	// Concurrency semantics are documented in model.go.
	Exec(_ *context.T, _ *DatabaseExecServerCallStub, bh BatchHandle, query string, params []*vom.RawBytes) error
	// BeginBatch creates a new batch. It returns a batch handle to pass in when
	// calling batch-aware RPCs.
	// Concurrency semantics are documented in model.go.
	// All batch-aware RPCs can also be called outside a batch (with an empty
	// handle), with the exception of Commit and Abort which only make sense on
	// a batch. Note that glob RPCs are not batch-aware.
	// TODO(sadovsky): Maybe make BatchOptions optional. Also, rename it to 'opts'
	// everywhere now that v.io/i/912 is resolved.
	BeginBatch(_ *context.T, _ rpc.ServerCall, bo BatchOptions) (BatchHandle, error)
	// Commit persists the pending changes to the database.
	// If the batch is readonly, Commit() will fail with ErrReadOnlyBatch; Abort()
	// should be used instead.
	// If the BatchHandle is empty, Commit() will fail with ErrNotBoundToBatch.
	Commit(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// Abort notifies the server that any pending changes can be discarded.
	// It is not strictly required, but it may allow the server to release locks
	// or other resources sooner than if it was not called.
	// If the BatchHandle is empty, Abort() will fail with ErrNotBoundToBatch.
	Abort(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
	// PauseSync pauses sync for this database. Incoming sync, as well as outgoing
	// sync of subsequent writes, will be disabled until ResumeSync is called.
	// PauseSync is idempotent.
	PauseSync(*context.T, rpc.ServerCall) error
	// ResumeSync resumes sync for this database. ResumeSync is idempotent.
	ResumeSync(*context.T, rpc.ServerCall) error
}

DatabaseServerStubMethods is the server interface containing Database methods, as expected by rpc.Server. The only difference between this interface and DatabaseServerMethods is the streaming methods.

type DatabaseWatcherClientMethods

type DatabaseWatcherClientMethods interface {
	// GlobWatcher allows a client to receive updates for changes to objects
	// that match a pattern.  See the package comments for details.
	watch.GlobWatcherClientMethods
	// GetResumeMarker returns the ResumeMarker that points to the current end
	// of the event log. GetResumeMarker() can be called on a batch.
	GetResumeMarker(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) (watch.ResumeMarker, error)
}

DatabaseWatcherClientMethods is the client interface containing DatabaseWatcher methods.

DatabaseWatcher allows a client to watch for updates to the database. For each watch request, the client will receive a reliable stream of watch events without re-ordering. See watch.GlobWatcher for a detailed explanation of the behavior. TODO(rogulenko): Currently the only supported watch patterns are "<collectionId>/<rowPrefix>*". Consider changing that.

Watching is done by starting a streaming RPC. The RPC takes a ResumeMarker argument that points to a particular place in the database event log. If an empty ResumeMarker is provided, the WatchStream will begin with a Change batch containing the initial state. Otherwise, the WatchStream will contain only changes since the provided ResumeMarker.

The result stream consists of a never-ending sequence of Change messages (until the call fails or is canceled). Each Change contains the Name field in the form "<collectionId>/<rowKey>" and the Value field of the StoreChange type. If the client has no access to a row specified in a change, that change is excluded from the result stream.

Note: A single Watch Change batch may contain changes from more than one batch as originally committed on a remote Syncbase or obtained from conflict resolution. However, changes from a single original batch will always appear in the same Change batch.

type DatabaseWatcherClientStub

type DatabaseWatcherClientStub interface {
	DatabaseWatcherClientMethods
	rpc.UniversalServiceMethods
}

DatabaseWatcherClientStub adds universal methods to DatabaseWatcherClientMethods.

func DatabaseWatcherClient

func DatabaseWatcherClient(name string) DatabaseWatcherClientStub

DatabaseWatcherClient returns a client stub for DatabaseWatcher.

type DatabaseWatcherServerMethods

type DatabaseWatcherServerMethods interface {
	// GlobWatcher allows a client to receive updates for changes to objects
	// that match a pattern.  See the package comments for details.
	watch.GlobWatcherServerMethods
	// GetResumeMarker returns the ResumeMarker that points to the current end
	// of the event log. GetResumeMarker() can be called on a batch.
	GetResumeMarker(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (watch.ResumeMarker, error)
}

DatabaseWatcherServerMethods is the interface a server writer implements for DatabaseWatcher.

DatabaseWatcher allows a client to watch for updates to the database. For each watch request, the client will receive a reliable stream of watch events without re-ordering. See watch.GlobWatcher for a detailed explanation of the behavior. TODO(rogulenko): Currently the only supported watch patterns are "<collectionId>/<rowPrefix>*". Consider changing that.

Watching is done by starting a streaming RPC. The RPC takes a ResumeMarker argument that points to a particular place in the database event log. If an empty ResumeMarker is provided, the WatchStream will begin with a Change batch containing the initial state. Otherwise, the WatchStream will contain only changes since the provided ResumeMarker.

The result stream consists of a never-ending sequence of Change messages (until the call fails or is canceled). Each Change contains the Name field in the form "<collectionId>/<rowKey>" and the Value field of the StoreChange type. If the client has no access to a row specified in a change, that change is excluded from the result stream.

Note: A single Watch Change batch may contain changes from more than one batch as originally committed on a remote Syncbase or obtained from conflict resolution. However, changes from a single original batch will always appear in the same Change batch.

type DatabaseWatcherServerStub

type DatabaseWatcherServerStub interface {
	DatabaseWatcherServerStubMethods
	// Describe the DatabaseWatcher interfaces.
	Describe__() []rpc.InterfaceDesc
}

DatabaseWatcherServerStub adds universal methods to DatabaseWatcherServerStubMethods.

func DatabaseWatcherServer

func DatabaseWatcherServer(impl DatabaseWatcherServerMethods) DatabaseWatcherServerStub

DatabaseWatcherServer returns a server stub for DatabaseWatcher. It converts an implementation of DatabaseWatcherServerMethods into an object that may be used by rpc.Server.

type DatabaseWatcherServerStubMethods

type DatabaseWatcherServerStubMethods interface {
	// GlobWatcher allows a client to receive updates for changes to objects
	// that match a pattern.  See the package comments for details.
	watch.GlobWatcherServerStubMethods
	// GetResumeMarker returns the ResumeMarker that points to the current end
	// of the event log. GetResumeMarker() can be called on a batch.
	GetResumeMarker(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (watch.ResumeMarker, error)
}

DatabaseWatcherServerStubMethods is the server interface containing DatabaseWatcher methods, as expected by rpc.Server. The only difference between this interface and DatabaseWatcherServerMethods is the streaming methods.

type DevModeUpdateVClockOpts

type DevModeUpdateVClockOpts struct {
	// If specified, sets the NTP host to talk to for subsequent NTP requests.
	NtpHost string
	// If Now is specified, the fake system clock is updated to the given values
	// of Now and ElapsedTime. If Now is not specified (i.e. takes the zero
	// value), the system clock is not touched by DevModeUpdateVClock.
	Now         time.Time
	ElapsedTime time.Duration
	// If specified, the clock daemon's local and/or NTP update code is triggered
	// after applying the updates specified by the fields above. (Helpful because
	// otherwise these only run periodically.) These functions work even if the
	// clock daemon hasn't been started.
	DoNtpUpdate   bool
	DoLocalUpdate bool
}

DevModeUpdateVClockOpts specifies what DevModeUpdateVClock should do, as described below.

func (*DevModeUpdateVClockOpts) FillVDLTarget

func (m *DevModeUpdateVClockOpts) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*DevModeUpdateVClockOpts) MakeVDLTarget

func (m *DevModeUpdateVClockOpts) MakeVDLTarget() vdl.Target

func (DevModeUpdateVClockOpts) VDLIsZero

func (x DevModeUpdateVClockOpts) VDLIsZero() bool

func (*DevModeUpdateVClockOpts) VDLRead

func (x *DevModeUpdateVClockOpts) VDLRead(dec vdl.Decoder) error

func (DevModeUpdateVClockOpts) VDLWrite

func (x DevModeUpdateVClockOpts) VDLWrite(enc vdl.Encoder) error

type DevModeUpdateVClockOptsTarget

type DevModeUpdateVClockOptsTarget struct {
	Value *DevModeUpdateVClockOpts

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*DevModeUpdateVClockOptsTarget) FinishField

func (t *DevModeUpdateVClockOptsTarget) FinishField(_, _ vdl.Target) error

func (*DevModeUpdateVClockOptsTarget) FinishFields

func (*DevModeUpdateVClockOptsTarget) StartField

func (t *DevModeUpdateVClockOptsTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*DevModeUpdateVClockOptsTarget) StartFields

func (*DevModeUpdateVClockOptsTarget) ZeroField

func (t *DevModeUpdateVClockOptsTarget) ZeroField(name string) error

type Id

type Id struct {
	Blessing string
	Name     string
}

Id is a {blessing, name} pair, used to identify a database or a collection. TODO(sadovsky): Maybe implement Id.String().

func (*Id) FillVDLTarget

func (m *Id) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*Id) MakeVDLTarget

func (m *Id) MakeVDLTarget() vdl.Target

func (Id) VDLIsZero

func (x Id) VDLIsZero() bool

func (*Id) VDLRead

func (x *Id) VDLRead(dec vdl.Decoder) error

func (Id) VDLWrite

func (x Id) VDLWrite(enc vdl.Encoder) error

type IdTarget

type IdTarget struct {
	Value *Id

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*IdTarget) FinishField

func (t *IdTarget) FinishField(_, _ vdl.Target) error

func (*IdTarget) FinishFields

func (t *IdTarget) FinishFields(_ vdl.FieldsTarget) error

func (*IdTarget) StartField

func (t *IdTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*IdTarget) StartFields

func (t *IdTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*IdTarget) ZeroField

func (t *IdTarget) ZeroField(name string) error

type KeyValue

type KeyValue struct {
	Key   string
	Value []byte
}

KeyValue is a key-value pair.

func (*KeyValue) FillVDLTarget

func (m *KeyValue) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*KeyValue) MakeVDLTarget

func (m *KeyValue) MakeVDLTarget() vdl.Target

func (KeyValue) VDLIsZero

func (x KeyValue) VDLIsZero() bool

func (*KeyValue) VDLRead

func (x *KeyValue) VDLRead(dec vdl.Decoder) error

func (KeyValue) VDLWrite

func (x KeyValue) VDLWrite(enc vdl.Encoder) error

type KeyValueTarget

type KeyValueTarget struct {
	Value *KeyValue

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*KeyValueTarget) FinishField

func (t *KeyValueTarget) FinishField(_, _ vdl.Target) error

func (*KeyValueTarget) FinishFields

func (t *KeyValueTarget) FinishFields(_ vdl.FieldsTarget) error

func (*KeyValueTarget) StartField

func (t *KeyValueTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*KeyValueTarget) StartFields

func (t *KeyValueTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*KeyValueTarget) ZeroField

func (t *KeyValueTarget) ZeroField(name string) error

type Operation

type Operation 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
}

Operation represents any single field of the Operation union type.

Operation represents a specific operation on a row or a set of rows that is a part of the conflict.

type OperationRead

type OperationRead struct{ Value RowOp }

OperationRead represents field Read of the Operation union type.

Read represents a read operation performed on a specific row. For a given row key there can only be at max one Read operation within a conflict.

func (OperationRead) FillVDLTarget

func (m OperationRead) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (OperationRead) Index

func (x OperationRead) Index() int

func (OperationRead) Interface

func (x OperationRead) Interface() interface{}

func (OperationRead) MakeVDLTarget

func (m OperationRead) MakeVDLTarget() vdl.Target

func (OperationRead) Name

func (x OperationRead) Name() string

func (OperationRead) VDLIsZero

func (x OperationRead) VDLIsZero() bool

func (OperationRead) VDLWrite

func (x OperationRead) VDLWrite(enc vdl.Encoder) error

type OperationScan

type OperationScan struct{ Value ScanOp }

OperationScan represents field Scan of the Operation union type.

Scan represents a scan operation performed over a specific range of keys. For a given key range there can be at max one ScanOp within the Conflict.

func (OperationScan) FillVDLTarget

func (m OperationScan) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (OperationScan) Index

func (x OperationScan) Index() int

func (OperationScan) Interface

func (x OperationScan) Interface() interface{}

func (OperationScan) MakeVDLTarget

func (m OperationScan) MakeVDLTarget() vdl.Target

func (OperationScan) Name

func (x OperationScan) Name() string

func (OperationScan) VDLIsZero

func (x OperationScan) VDLIsZero() bool

func (OperationScan) VDLWrite

func (x OperationScan) VDLWrite(enc vdl.Encoder) error

type OperationTarget

type OperationTarget struct {
	Value *Operation

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*OperationTarget) FinishField

func (t *OperationTarget) FinishField(_, fieldTarget vdl.Target) error

func (*OperationTarget) FinishFields

func (t *OperationTarget) FinishFields(_ vdl.FieldsTarget) error

func (*OperationTarget) StartField

func (t *OperationTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*OperationTarget) StartFields

func (t *OperationTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

type OperationWrite

type OperationWrite struct{ Value RowOp }

OperationWrite represents field Write of the Operation union type.

Write represents a write operation performed on a specific row. For a given row key there can only be at max one Write operation within a conflict.

func (OperationWrite) FillVDLTarget

func (m OperationWrite) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (OperationWrite) Index

func (x OperationWrite) Index() int

func (OperationWrite) Interface

func (x OperationWrite) Interface() interface{}

func (OperationWrite) MakeVDLTarget

func (m OperationWrite) MakeVDLTarget() vdl.Target

func (OperationWrite) Name

func (x OperationWrite) Name() string

func (OperationWrite) VDLIsZero

func (x OperationWrite) VDLIsZero() bool

func (OperationWrite) VDLWrite

func (x OperationWrite) VDLWrite(enc vdl.Encoder) error

type ResolutionInfo

type ResolutionInfo struct {
	// Key is the key under conflict.
	Key string
	// Selection represents the value that was selected as resolution.
	Selection ValueSelection
	// Result is the resolved value for the key. This field should be used only
	// if value of Selection field is 'Other'. If the result of a resolution is
	// delete for this key then add Value with nil Bytes.
	Result *Value
	// Continued represents whether the batch of ResolutionInfos has ended.
	Continued bool
}

ResolutionInfo contains the application’s reply to a conflict for a key, providing the resolution value. The resolution may be over a group of keys in which case the application must send a stream of ResolutionInfos with the Continued field for the last ResolutionInfo representing the end of the batch with a value false. ResolutionInfos sent as part of a batch will be committed as a batch. If the commit fails, the Conflict will be re-sent.

func (*ResolutionInfo) FillVDLTarget

func (m *ResolutionInfo) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ResolutionInfo) MakeVDLTarget

func (m *ResolutionInfo) MakeVDLTarget() vdl.Target

func (ResolutionInfo) VDLIsZero

func (x ResolutionInfo) VDLIsZero() bool

func (*ResolutionInfo) VDLRead

func (x *ResolutionInfo) VDLRead(dec vdl.Decoder) error

func (ResolutionInfo) VDLWrite

func (x ResolutionInfo) VDLWrite(enc vdl.Encoder) error

type ResolutionInfoTarget

type ResolutionInfoTarget struct {
	Value *ResolutionInfo

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*ResolutionInfoTarget) FinishField

func (t *ResolutionInfoTarget) FinishField(_, _ vdl.Target) error

func (*ResolutionInfoTarget) FinishFields

func (t *ResolutionInfoTarget) FinishFields(_ vdl.FieldsTarget) error

func (*ResolutionInfoTarget) StartField

func (t *ResolutionInfoTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*ResolutionInfoTarget) StartFields

func (t *ResolutionInfoTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*ResolutionInfoTarget) ZeroField

func (t *ResolutionInfoTarget) ZeroField(name string) error

type ResolverType

type ResolverType int

ResolverType defines the possible conflict resolution policies. A Conflict is defined as presence of two independent sets of updates originating from the same version of an object. Syncbase uses version vectors to determine sequence of changes to a given row. Hence if device A updates a row with key "foo" from version V3 to V4, then syncs with device B which further updates the same row from version V4 to V5 and then V5 is synced back to device A, device A will see V5 as a forward progression of "foo" and not a conflict with V3 of "foo". But in the meantime if device A had already updated "foo" again from version V4 to version V6 then there is a conflict between V5 and V6 with V4 being the common ancestor.

const (
	ResolverTypeLastWins ResolverType = iota
	ResolverTypeAppResolves
	ResolverTypeDefer
)

func ResolverTypeFromString

func ResolverTypeFromString(label string) (x ResolverType, err error)

ResolverTypeFromString creates a ResolverType from a string label.

func (*ResolverType) FillVDLTarget

func (m *ResolverType) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ResolverType) MakeVDLTarget

func (m *ResolverType) MakeVDLTarget() vdl.Target

func (*ResolverType) Set

func (x *ResolverType) Set(label string) error

Set assigns label to x.

func (ResolverType) String

func (x ResolverType) String() string

String returns the string label of x.

func (ResolverType) VDLIsZero

func (x ResolverType) VDLIsZero() bool

func (*ResolverType) VDLRead

func (x *ResolverType) VDLRead(dec vdl.Decoder) error

func (ResolverType) VDLWrite

func (x ResolverType) VDLWrite(enc vdl.Encoder) error

type ResolverTypeTarget

type ResolverTypeTarget struct {
	Value *ResolverType
	vdl.TargetBase
}

func (*ResolverTypeTarget) FromEnumLabel

func (t *ResolverTypeTarget) FromEnumLabel(src string, tt *vdl.Type) error

type RowClientMethods

type RowClientMethods interface {
	// Exists returns true only if this Row exists. Insufficient permissions
	// cause Exists to return false instead of an error.
	// Note, Exists on Row requires read permissions, unlike higher levels of
	// hierarchy which require resolve, because Row existence usually carries
	// more information.
	// TODO(ivanpi): Exists may fail with an error if higher levels of hierarchy
	// do not exist.
	Exists(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) (bool, error)
	// Get returns the value for this Row.
	Get(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) ([]byte, error)
	// Put writes the given value for this Row.
	Put(_ *context.T, bh BatchHandle, value []byte, _ ...rpc.CallOpt) error
	// Delete deletes this Row.
	Delete(_ *context.T, bh BatchHandle, _ ...rpc.CallOpt) error
}

RowClientMethods is the client interface containing Row methods.

Row represents a single row in a Collection. All access checks are performed against the Collection ACL. NOTE(sadovsky): Currently we send []byte values over the wire for Get, Put, and Scan. If there's a way to avoid encoding/decoding on the server side, we can use vdl.Value everywhere without sacrificing performance.

type RowClientStub

type RowClientStub interface {
	RowClientMethods
	rpc.UniversalServiceMethods
}

RowClientStub adds universal methods to RowClientMethods.

func RowClient

func RowClient(name string) RowClientStub

RowClient returns a client stub for Row.

type RowInfo

type RowInfo struct {
	// Op is a specific operation represented by RowInfo
	Op Operation
	// BatchIds contains ids of all batches that this RowInfo is a part of.
	BatchIds []uint64
}

RowInfo contains a single operation performed on a row (in case of read or write) or a range or rows (in case of scan) along with a mapping to each of the batches that this operation belongs to. For example, if Row1 was updated on local syncbase conflicting with a write on remote syncbase as part of two separate batches, then it will be represented by a single RowInfo with Write Operation containing the respective local and remote values along with the batch id for both batches stored in the BatchIds field.

func (*RowInfo) FillVDLTarget

func (m *RowInfo) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*RowInfo) MakeVDLTarget

func (m *RowInfo) MakeVDLTarget() vdl.Target

func (RowInfo) VDLIsZero

func (x RowInfo) VDLIsZero() bool

func (*RowInfo) VDLRead

func (x *RowInfo) VDLRead(dec vdl.Decoder) error

func (RowInfo) VDLWrite

func (x RowInfo) VDLWrite(enc vdl.Encoder) error

type RowInfoTarget

type RowInfoTarget struct {
	Value *RowInfo

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*RowInfoTarget) FinishField

func (t *RowInfoTarget) FinishField(_, _ vdl.Target) error

func (*RowInfoTarget) FinishFields

func (t *RowInfoTarget) FinishFields(_ vdl.FieldsTarget) error

func (*RowInfoTarget) StartField

func (t *RowInfoTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*RowInfoTarget) StartFields

func (t *RowInfoTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*RowInfoTarget) ZeroField

func (t *RowInfoTarget) ZeroField(name string) error

type RowOp

type RowOp struct {
	// The key under conflict.
	Key string
	// LocalValue contains the value read or written by local syncbase or nil.
	LocalValue *Value
	// RemoteValue contains the value read or written by remote syncbase or nil.
	RemoteValue *Value
	// AncestorValue contains the value for the key which is the lowest common
	// ancestor of the two values represented by LocalValue and RemoteValue or
	// nil if no ancestor exists or if the operation was read.
	AncestorValue *Value
}

RowOp represents a read or write operation on a row corresponding to the given key.

func (*RowOp) FillVDLTarget

func (m *RowOp) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*RowOp) MakeVDLTarget

func (m *RowOp) MakeVDLTarget() vdl.Target

func (RowOp) VDLIsZero

func (x RowOp) VDLIsZero() bool

func (*RowOp) VDLRead

func (x *RowOp) VDLRead(dec vdl.Decoder) error

func (RowOp) VDLWrite

func (x RowOp) VDLWrite(enc vdl.Encoder) error

type RowOpTarget

type RowOpTarget struct {
	Value *RowOp

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*RowOpTarget) FinishField

func (t *RowOpTarget) FinishField(_, _ vdl.Target) error

func (*RowOpTarget) FinishFields

func (t *RowOpTarget) FinishFields(_ vdl.FieldsTarget) error

func (*RowOpTarget) StartField

func (t *RowOpTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*RowOpTarget) StartFields

func (t *RowOpTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*RowOpTarget) ZeroField

func (t *RowOpTarget) ZeroField(name string) error

type RowServerMethods

type RowServerMethods interface {
	// Exists returns true only if this Row exists. Insufficient permissions
	// cause Exists to return false instead of an error.
	// Note, Exists on Row requires read permissions, unlike higher levels of
	// hierarchy which require resolve, because Row existence usually carries
	// more information.
	// TODO(ivanpi): Exists may fail with an error if higher levels of hierarchy
	// do not exist.
	Exists(_ *context.T, _ rpc.ServerCall, bh BatchHandle) (bool, error)
	// Get returns the value for this Row.
	Get(_ *context.T, _ rpc.ServerCall, bh BatchHandle) ([]byte, error)
	// Put writes the given value for this Row.
	Put(_ *context.T, _ rpc.ServerCall, bh BatchHandle, value []byte) error
	// Delete deletes this Row.
	Delete(_ *context.T, _ rpc.ServerCall, bh BatchHandle) error
}

RowServerMethods is the interface a server writer implements for Row.

Row represents a single row in a Collection. All access checks are performed against the Collection ACL. NOTE(sadovsky): Currently we send []byte values over the wire for Get, Put, and Scan. If there's a way to avoid encoding/decoding on the server side, we can use vdl.Value everywhere without sacrificing performance.

type RowServerStub

type RowServerStub interface {
	RowServerStubMethods
	// Describe the Row interfaces.
	Describe__() []rpc.InterfaceDesc
}

RowServerStub adds universal methods to RowServerStubMethods.

func RowServer

func RowServer(impl RowServerMethods) RowServerStub

RowServer returns a server stub for Row. It converts an implementation of RowServerMethods into an object that may be used by rpc.Server.

type RowServerStubMethods

type RowServerStubMethods RowServerMethods

RowServerStubMethods is the server interface containing Row methods, as expected by rpc.Server. There is no difference between this interface and RowServerMethods since there are no streaming methods.

type ScanOp

type ScanOp struct {
	// Start contains the starting key for a range scan.
	Start string
	// Limit contains the end key for a range scan.
	Limit string
}

ScanOp provides details of a scan operation.

func (*ScanOp) FillVDLTarget

func (m *ScanOp) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ScanOp) MakeVDLTarget

func (m *ScanOp) MakeVDLTarget() vdl.Target

func (ScanOp) VDLIsZero

func (x ScanOp) VDLIsZero() bool

func (*ScanOp) VDLRead

func (x *ScanOp) VDLRead(dec vdl.Decoder) error

func (ScanOp) VDLWrite

func (x ScanOp) VDLWrite(enc vdl.Encoder) error

type ScanOpTarget

type ScanOpTarget struct {
	Value *ScanOp

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*ScanOpTarget) FinishField

func (t *ScanOpTarget) FinishField(_, _ vdl.Target) error

func (*ScanOpTarget) FinishFields

func (t *ScanOpTarget) FinishFields(_ vdl.FieldsTarget) error

func (*ScanOpTarget) StartField

func (t *ScanOpTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*ScanOpTarget) StartFields

func (t *ScanOpTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*ScanOpTarget) ZeroField

func (t *ScanOpTarget) ZeroField(name string) error

type SchemaManagerClientMethods

type SchemaManagerClientMethods interface {
	// GetSchemaMetadata retrieves schema metadata for this database.
	//
	// Requires: Client must have at least Read access on the Database.
	GetSchemaMetadata(*context.T, ...rpc.CallOpt) (SchemaMetadata, error)
	// SetSchemaMetadata stores schema metadata for this database.
	//
	// Requires: Client must have at least Write access on the Database.
	SetSchemaMetadata(_ *context.T, metadata SchemaMetadata, _ ...rpc.CallOpt) error
}

SchemaManagerClientMethods is the client interface containing SchemaManager methods.

SchemaManager implements the API for managing schema metadata attached to a Database.

type SchemaManagerClientStub

type SchemaManagerClientStub interface {
	SchemaManagerClientMethods
	rpc.UniversalServiceMethods
}

SchemaManagerClientStub adds universal methods to SchemaManagerClientMethods.

func SchemaManagerClient

func SchemaManagerClient(name string) SchemaManagerClientStub

SchemaManagerClient returns a client stub for SchemaManager.

type SchemaManagerServerMethods

type SchemaManagerServerMethods interface {
	// GetSchemaMetadata retrieves schema metadata for this database.
	//
	// Requires: Client must have at least Read access on the Database.
	GetSchemaMetadata(*context.T, rpc.ServerCall) (SchemaMetadata, error)
	// SetSchemaMetadata stores schema metadata for this database.
	//
	// Requires: Client must have at least Write access on the Database.
	SetSchemaMetadata(_ *context.T, _ rpc.ServerCall, metadata SchemaMetadata) error
}

SchemaManagerServerMethods is the interface a server writer implements for SchemaManager.

SchemaManager implements the API for managing schema metadata attached to a Database.

type SchemaManagerServerStub

type SchemaManagerServerStub interface {
	SchemaManagerServerStubMethods
	// Describe the SchemaManager interfaces.
	Describe__() []rpc.InterfaceDesc
}

SchemaManagerServerStub adds universal methods to SchemaManagerServerStubMethods.

func SchemaManagerServer

func SchemaManagerServer(impl SchemaManagerServerMethods) SchemaManagerServerStub

SchemaManagerServer returns a server stub for SchemaManager. It converts an implementation of SchemaManagerServerMethods into an object that may be used by rpc.Server.

type SchemaManagerServerStubMethods

type SchemaManagerServerStubMethods SchemaManagerServerMethods

SchemaManagerServerStubMethods is the server interface containing SchemaManager methods, as expected by rpc.Server. There is no difference between this interface and SchemaManagerServerMethods since there are no streaming methods.

type SchemaMetadata

type SchemaMetadata struct {
	// Non negative Schema version number. Should be increased with every schema
	// change (e.g. adding fields to structs) that cannot be handled by previous
	// versions of the app.
	// TODO(jlodhia,ivanpi): Deprecated, needs update to multiple parallel version
	// semantics.
	Version int32
	Policy  CrPolicy
}

SchemaMetadata maintains metadata related to the schema of a given database. There is one SchemaMetadata per database.

func (*SchemaMetadata) FillVDLTarget

func (m *SchemaMetadata) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*SchemaMetadata) MakeVDLTarget

func (m *SchemaMetadata) MakeVDLTarget() vdl.Target

func (SchemaMetadata) VDLIsZero

func (x SchemaMetadata) VDLIsZero() bool

func (*SchemaMetadata) VDLRead

func (x *SchemaMetadata) VDLRead(dec vdl.Decoder) error

func (SchemaMetadata) VDLWrite

func (x SchemaMetadata) VDLWrite(enc vdl.Encoder) error

type SchemaMetadataTarget

type SchemaMetadataTarget struct {
	Value *SchemaMetadata

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*SchemaMetadataTarget) FinishField

func (t *SchemaMetadataTarget) FinishField(_, _ vdl.Target) error

func (*SchemaMetadataTarget) FinishFields

func (t *SchemaMetadataTarget) FinishFields(_ vdl.FieldsTarget) error

func (*SchemaMetadataTarget) StartField

func (t *SchemaMetadataTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*SchemaMetadataTarget) StartFields

func (t *SchemaMetadataTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*SchemaMetadataTarget) ZeroField

func (t *SchemaMetadataTarget) ZeroField(name string) error

type ServiceClientMethods

type ServiceClientMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectClientMethods
	// DevModeUpdateVClock updates various bits of Syncbase virtual clock and
	// clock daemon state based on the specified options.
	// Requires --dev flag to be set (in addition to Admin check).
	DevModeUpdateVClock(_ *context.T, uco DevModeUpdateVClockOpts, _ ...rpc.CallOpt) error
	// DevModeGetTime returns the current time per the Syncbase clock.
	// Requires --dev flag to be set (in addition to Admin check).
	DevModeGetTime(*context.T, ...rpc.CallOpt) (time.Time, error)
}

ServiceClientMethods is the client interface containing Service methods.

Service represents a Vanadium Syncbase service. Service.Glob operates over Database ids.

type ServiceClientStub

type ServiceClientStub interface {
	ServiceClientMethods
	rpc.UniversalServiceMethods
}

ServiceClientStub adds universal methods to ServiceClientMethods.

func ServiceClient

func ServiceClient(name string) ServiceClientStub

ServiceClient returns a client stub for Service.

type ServiceServerMethods

type ServiceServerMethods interface {
	// Object provides access control for Vanadium objects.
	//
	// Vanadium services implementing dynamic access control would typically embed
	// this interface and tag additional methods defined by the service with one of
	// Admin, Read, Write, Resolve etc. For example, the VDL definition of the
	// object would be:
	//
	//   package mypackage
	//
	//   import "v.io/v23/security/access"
	//   import "v.io/v23/services/permissions"
	//
	//   type MyObject interface {
	//     permissions.Object
	//     MyRead() (string, error) {access.Read}
	//     MyWrite(string) error    {access.Write}
	//   }
	//
	// If the set of pre-defined tags is insufficient, services may define their
	// own tag type and annotate all methods with this new type.
	//
	// Instead of embedding this Object interface, define SetPermissions and
	// GetPermissions in their own interface. Authorization policies will typically
	// respect annotations of a single type. For example, the VDL definition of an
	// object would be:
	//
	//  package mypackage
	//
	//  import "v.io/v23/security/access"
	//
	//  type MyTag string
	//
	//  const (
	//    Blue = MyTag("Blue")
	//    Red  = MyTag("Red")
	//  )
	//
	//  type MyObject interface {
	//    MyMethod() (string, error) {Blue}
	//
	//    // Allow clients to change access via the access.Object interface:
	//    SetPermissions(perms access.Permissions, version string) error         {Red}
	//    GetPermissions() (perms access.Permissions, version string, err error) {Blue}
	//  }
	permissions.ObjectServerMethods
	// DevModeUpdateVClock updates various bits of Syncbase virtual clock and
	// clock daemon state based on the specified options.
	// Requires --dev flag to be set (in addition to Admin check).
	DevModeUpdateVClock(_ *context.T, _ rpc.ServerCall, uco DevModeUpdateVClockOpts) error
	// DevModeGetTime returns the current time per the Syncbase clock.
	// Requires --dev flag to be set (in addition to Admin check).
	DevModeGetTime(*context.T, rpc.ServerCall) (time.Time, error)
}

ServiceServerMethods is the interface a server writer implements for Service.

Service represents a Vanadium Syncbase service. Service.Glob operates over Database ids.

type ServiceServerStub

type ServiceServerStub interface {
	ServiceServerStubMethods
	// Describe the Service interfaces.
	Describe__() []rpc.InterfaceDesc
}

ServiceServerStub adds universal methods to ServiceServerStubMethods.

func ServiceServer

func ServiceServer(impl ServiceServerMethods) ServiceServerStub

ServiceServer returns a server stub for Service. It converts an implementation of ServiceServerMethods into an object that may be used by rpc.Server.

type ServiceServerStubMethods

type ServiceServerStubMethods ServiceServerMethods

ServiceServerStubMethods is the server interface containing Service methods, as expected by rpc.Server. There is no difference between this interface and ServiceServerMethods since there are no streaming methods.

type StoreChange

type StoreChange struct {
	// Value is the new value for the row if the Change state equals to Exists,
	// otherwise the Value is nil.
	Value *vom.RawBytes
	// FromSync indicates whether the change came from sync. If FromSync is
	// false, then the change originated from the local device.
	// Note: FromSync is always false for initial state Changes.
	FromSync bool
}

StoreChange is the new value for a watched entity. TODO(rogulenko): Consider adding the Shell state.

func (*StoreChange) FillVDLTarget

func (m *StoreChange) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*StoreChange) MakeVDLTarget

func (m *StoreChange) MakeVDLTarget() vdl.Target

func (StoreChange) VDLIsZero

func (x StoreChange) VDLIsZero() bool

func (*StoreChange) VDLRead

func (x *StoreChange) VDLRead(dec vdl.Decoder) error

func (StoreChange) VDLWrite

func (x StoreChange) VDLWrite(enc vdl.Encoder) error

type StoreChangeTarget

type StoreChangeTarget struct {
	Value *StoreChange

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*StoreChangeTarget) FinishField

func (t *StoreChangeTarget) FinishField(_, _ vdl.Target) error

func (*StoreChangeTarget) FinishFields

func (t *StoreChangeTarget) FinishFields(_ vdl.FieldsTarget) error

func (*StoreChangeTarget) StartField

func (t *StoreChangeTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*StoreChangeTarget) StartFields

func (t *StoreChangeTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*StoreChangeTarget) ZeroField

func (t *StoreChangeTarget) ZeroField(name string) error

type SyncgroupManagerClientMethods

type SyncgroupManagerClientMethods interface {
	// GetSyncgroupNames returns the global names of all syncgroups attached to
	// this database.
	GetSyncgroupNames(*context.T, ...rpc.CallOpt) ([]string, error)
	// CreateSyncgroup creates a new syncgroup with the given spec.
	//
	// Requires: Client must have at least Read access on the Database; all
	// Collections specified in prefixes must exist; Client must have at least
	// Read access on each of the Collection ACLs.
	CreateSyncgroup(_ *context.T, sgName string, spec SyncgroupSpec, myInfo SyncgroupMemberInfo, _ ...rpc.CallOpt) error
	// JoinSyncgroup joins the syncgroup.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	JoinSyncgroup(_ *context.T, sgName string, myInfo SyncgroupMemberInfo, _ ...rpc.CallOpt) (spec SyncgroupSpec, _ error)
	// LeaveSyncgroup leaves the syncgroup. Previously synced data will continue
	// to be available.
	//
	// Requires: Client must have at least Read access on the Database.
	LeaveSyncgroup(_ *context.T, sgName string, _ ...rpc.CallOpt) error
	// DestroySyncgroup destroys the syncgroup. Previously synced data will
	// continue to be available to all members.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	DestroySyncgroup(_ *context.T, sgName string, _ ...rpc.CallOpt) error
	// EjectFromSyncgroup ejects a member from the syncgroup. The ejected member
	// will not be able to sync further, but will retain any data it has already
	// synced.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	EjectFromSyncgroup(_ *context.T, sgName string, member string, _ ...rpc.CallOpt) error
	// GetSyncgroupSpec gets the syncgroup spec. version allows for atomic
	// read-modify-write of the spec - see comment for SetSyncgroupSpec.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	GetSyncgroupSpec(_ *context.T, sgName string, _ ...rpc.CallOpt) (spec SyncgroupSpec, version string, _ error)
	// SetSyncgroupSpec sets the syncgroup spec. version may be either empty or
	// the value from a previous Get. If not empty, Set will only succeed if the
	// current version matches the specified one.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	SetSyncgroupSpec(_ *context.T, sgName string, spec SyncgroupSpec, version string, _ ...rpc.CallOpt) error
	// GetSyncgroupMembers gets the info objects for members of the syncgroup.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	GetSyncgroupMembers(_ *context.T, sgName string, _ ...rpc.CallOpt) (members map[string]SyncgroupMemberInfo, _ error)
}

SyncgroupManagerClientMethods is the client interface containing SyncgroupManager methods.

SyncgroupManager is the interface for syncgroup operations. TODO(hpucha): Add blessings to create/join and add a refresh method.

type SyncgroupManagerClientStub

type SyncgroupManagerClientStub interface {
	SyncgroupManagerClientMethods
	rpc.UniversalServiceMethods
}

SyncgroupManagerClientStub adds universal methods to SyncgroupManagerClientMethods.

func SyncgroupManagerClient

func SyncgroupManagerClient(name string) SyncgroupManagerClientStub

SyncgroupManagerClient returns a client stub for SyncgroupManager.

type SyncgroupManagerServerMethods

type SyncgroupManagerServerMethods interface {
	// GetSyncgroupNames returns the global names of all syncgroups attached to
	// this database.
	GetSyncgroupNames(*context.T, rpc.ServerCall) ([]string, error)
	// CreateSyncgroup creates a new syncgroup with the given spec.
	//
	// Requires: Client must have at least Read access on the Database; all
	// Collections specified in prefixes must exist; Client must have at least
	// Read access on each of the Collection ACLs.
	CreateSyncgroup(_ *context.T, _ rpc.ServerCall, sgName string, spec SyncgroupSpec, myInfo SyncgroupMemberInfo) error
	// JoinSyncgroup joins the syncgroup.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	JoinSyncgroup(_ *context.T, _ rpc.ServerCall, sgName string, myInfo SyncgroupMemberInfo) (spec SyncgroupSpec, _ error)
	// LeaveSyncgroup leaves the syncgroup. Previously synced data will continue
	// to be available.
	//
	// Requires: Client must have at least Read access on the Database.
	LeaveSyncgroup(_ *context.T, _ rpc.ServerCall, sgName string) error
	// DestroySyncgroup destroys the syncgroup. Previously synced data will
	// continue to be available to all members.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	DestroySyncgroup(_ *context.T, _ rpc.ServerCall, sgName string) error
	// EjectFromSyncgroup ejects a member from the syncgroup. The ejected member
	// will not be able to sync further, but will retain any data it has already
	// synced.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	EjectFromSyncgroup(_ *context.T, _ rpc.ServerCall, sgName string, member string) error
	// GetSyncgroupSpec gets the syncgroup spec. version allows for atomic
	// read-modify-write of the spec - see comment for SetSyncgroupSpec.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	GetSyncgroupSpec(_ *context.T, _ rpc.ServerCall, sgName string) (spec SyncgroupSpec, version string, _ error)
	// SetSyncgroupSpec sets the syncgroup spec. version may be either empty or
	// the value from a previous Get. If not empty, Set will only succeed if the
	// current version matches the specified one.
	//
	// Requires: Client must have at least Read access on the Database, and must
	// have Admin access on the syncgroup ACL.
	SetSyncgroupSpec(_ *context.T, _ rpc.ServerCall, sgName string, spec SyncgroupSpec, version string) error
	// GetSyncgroupMembers gets the info objects for members of the syncgroup.
	//
	// Requires: Client must have at least Read access on the Database and on the
	// syncgroup ACL.
	GetSyncgroupMembers(_ *context.T, _ rpc.ServerCall, sgName string) (members map[string]SyncgroupMemberInfo, _ error)
}

SyncgroupManagerServerMethods is the interface a server writer implements for SyncgroupManager.

SyncgroupManager is the interface for syncgroup operations. TODO(hpucha): Add blessings to create/join and add a refresh method.

type SyncgroupManagerServerStub

type SyncgroupManagerServerStub interface {
	SyncgroupManagerServerStubMethods
	// Describe the SyncgroupManager interfaces.
	Describe__() []rpc.InterfaceDesc
}

SyncgroupManagerServerStub adds universal methods to SyncgroupManagerServerStubMethods.

func SyncgroupManagerServer

func SyncgroupManagerServer(impl SyncgroupManagerServerMethods) SyncgroupManagerServerStub

SyncgroupManagerServer returns a server stub for SyncgroupManager. It converts an implementation of SyncgroupManagerServerMethods into an object that may be used by rpc.Server.

type SyncgroupManagerServerStubMethods

type SyncgroupManagerServerStubMethods SyncgroupManagerServerMethods

SyncgroupManagerServerStubMethods is the server interface containing SyncgroupManager methods, as expected by rpc.Server. There is no difference between this interface and SyncgroupManagerServerMethods since there are no streaming methods.

type SyncgroupMemberInfo

type SyncgroupMemberInfo struct {
	SyncPriority byte
	BlobDevType  byte // See BlobDevType* constants.
}

SyncgroupMemberInfo contains per-member metadata.

func (*SyncgroupMemberInfo) FillVDLTarget

func (m *SyncgroupMemberInfo) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*SyncgroupMemberInfo) MakeVDLTarget

func (m *SyncgroupMemberInfo) MakeVDLTarget() vdl.Target

func (SyncgroupMemberInfo) VDLIsZero

func (x SyncgroupMemberInfo) VDLIsZero() bool

func (*SyncgroupMemberInfo) VDLRead

func (x *SyncgroupMemberInfo) VDLRead(dec vdl.Decoder) error

func (SyncgroupMemberInfo) VDLWrite

func (x SyncgroupMemberInfo) VDLWrite(enc vdl.Encoder) error

type SyncgroupMemberInfoTarget

type SyncgroupMemberInfoTarget struct {
	Value *SyncgroupMemberInfo

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*SyncgroupMemberInfoTarget) FinishField

func (t *SyncgroupMemberInfoTarget) FinishField(_, _ vdl.Target) error

func (*SyncgroupMemberInfoTarget) FinishFields

func (t *SyncgroupMemberInfoTarget) FinishFields(_ vdl.FieldsTarget) error

func (*SyncgroupMemberInfoTarget) StartField

func (t *SyncgroupMemberInfoTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*SyncgroupMemberInfoTarget) StartFields

func (t *SyncgroupMemberInfoTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*SyncgroupMemberInfoTarget) ZeroField

func (t *SyncgroupMemberInfoTarget) ZeroField(name string) error

type SyncgroupSpec

type SyncgroupSpec struct {
	// Human-readable description of this syncgroup.
	Description string
	// Permissions governing access to this syncgroup.
	Perms access.Permissions
	// Data (collectionId-rowPrefix pairs) covered by this syncgroup.
	Prefixes []CollectionRow
	// Mount tables at which to advertise this syncgroup, for rendezvous purposes.
	// (Note that in addition to these mount tables, Syncbase also uses
	// network-neighborhood-based discovery for rendezvous.)
	// We expect most clients to specify a single mount table, but we accept an
	// array of mount tables to permit the mount table to be changed over time
	// without disruption.
	// TODO(hpucha): Figure out a convention for advertising syncgroups in the
	// mount table.
	MountTables []string
	// Specifies the privacy of this syncgroup. More specifically, specifies
	// whether blobs in this syncgroup can be served to clients presenting
	// blobrefs obtained from other syncgroups.
	IsPrivate bool
}

SyncgroupSpec contains the specification for a syncgroup.

func (*SyncgroupSpec) FillVDLTarget

func (m *SyncgroupSpec) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*SyncgroupSpec) MakeVDLTarget

func (m *SyncgroupSpec) MakeVDLTarget() vdl.Target

func (SyncgroupSpec) VDLIsZero

func (x SyncgroupSpec) VDLIsZero() bool

func (*SyncgroupSpec) VDLRead

func (x *SyncgroupSpec) VDLRead(dec vdl.Decoder) error

func (SyncgroupSpec) VDLWrite

func (x SyncgroupSpec) VDLWrite(enc vdl.Encoder) error

type SyncgroupSpecTarget

type SyncgroupSpecTarget struct {
	Value *SyncgroupSpec

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*SyncgroupSpecTarget) FinishField

func (t *SyncgroupSpecTarget) FinishField(_, _ vdl.Target) error

func (*SyncgroupSpecTarget) FinishFields

func (t *SyncgroupSpecTarget) FinishFields(_ vdl.FieldsTarget) error

func (*SyncgroupSpecTarget) StartField

func (t *SyncgroupSpecTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*SyncgroupSpecTarget) StartFields

func (t *SyncgroupSpecTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*SyncgroupSpecTarget) ZeroField

func (t *SyncgroupSpecTarget) ZeroField(name string) error

type Value

type Value struct {
	// State provides information about whether the field Bytes is empty or
	// not and if it is empty then why.
	State ValueState
	// VOM encoded bytes for a row's value or nil if the row was deleted.
	Bytes []byte
	// Write timestamp for this value
	WriteTs time.Time
}

Value contains the encoded bytes for a row's value stored in syncbase.

func (*Value) FillVDLTarget

func (m *Value) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*Value) MakeVDLTarget

func (m *Value) MakeVDLTarget() vdl.Target

func (Value) VDLIsZero

func (x Value) VDLIsZero() bool

func (*Value) VDLRead

func (x *Value) VDLRead(dec vdl.Decoder) error

func (Value) VDLWrite

func (x Value) VDLWrite(enc vdl.Encoder) error

type ValueSelection

type ValueSelection int

ValueSelection represents the value that was selected as the final resolution for a conflict.

const (
	ValueSelectionLocal ValueSelection = iota
	ValueSelectionRemote
	ValueSelectionOther
)

func ValueSelectionFromString

func ValueSelectionFromString(label string) (x ValueSelection, err error)

ValueSelectionFromString creates a ValueSelection from a string label.

func (*ValueSelection) FillVDLTarget

func (m *ValueSelection) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ValueSelection) MakeVDLTarget

func (m *ValueSelection) MakeVDLTarget() vdl.Target

func (*ValueSelection) Set

func (x *ValueSelection) Set(label string) error

Set assigns label to x.

func (ValueSelection) String

func (x ValueSelection) String() string

String returns the string label of x.

func (ValueSelection) VDLIsZero

func (x ValueSelection) VDLIsZero() bool

func (*ValueSelection) VDLRead

func (x *ValueSelection) VDLRead(dec vdl.Decoder) error

func (ValueSelection) VDLWrite

func (x ValueSelection) VDLWrite(enc vdl.Encoder) error

type ValueSelectionTarget

type ValueSelectionTarget struct {
	Value *ValueSelection
	vdl.TargetBase
}

func (*ValueSelectionTarget) FromEnumLabel

func (t *ValueSelectionTarget) FromEnumLabel(src string, tt *vdl.Type) error

type ValueState

type ValueState int

ValueState represents the state for Value object providing information about whether the Value object's Byte field is empty or not.

const (
	ValueStateExists ValueState = iota
	ValueStateNoExists
	ValueStateDeleted
	ValueStateUnknown
)

func ValueStateFromString

func ValueStateFromString(label string) (x ValueState, err error)

ValueStateFromString creates a ValueState from a string label.

func (*ValueState) FillVDLTarget

func (m *ValueState) FillVDLTarget(t vdl.Target, tt *vdl.Type) error

func (*ValueState) MakeVDLTarget

func (m *ValueState) MakeVDLTarget() vdl.Target

func (*ValueState) Set

func (x *ValueState) Set(label string) error

Set assigns label to x.

func (ValueState) String

func (x ValueState) String() string

String returns the string label of x.

func (ValueState) VDLIsZero

func (x ValueState) VDLIsZero() bool

func (*ValueState) VDLRead

func (x *ValueState) VDLRead(dec vdl.Decoder) error

func (ValueState) VDLWrite

func (x ValueState) VDLWrite(enc vdl.Encoder) error

type ValueStateTarget

type ValueStateTarget struct {
	Value *ValueState
	vdl.TargetBase
}

func (*ValueStateTarget) FromEnumLabel

func (t *ValueStateTarget) FromEnumLabel(src string, tt *vdl.Type) error

type ValueTarget

type ValueTarget struct {
	Value *Value

	vdl.TargetBase
	vdl.FieldsTargetBase
	// contains filtered or unexported fields
}

func (*ValueTarget) FinishField

func (t *ValueTarget) FinishField(_, _ vdl.Target) error

func (*ValueTarget) FinishFields

func (t *ValueTarget) FinishFields(_ vdl.FieldsTarget) error

func (*ValueTarget) StartField

func (t *ValueTarget) StartField(name string) (key, field vdl.Target, _ error)

func (*ValueTarget) StartFields

func (t *ValueTarget) StartFields(tt *vdl.Type) (vdl.FieldsTarget, error)

func (*ValueTarget) ZeroField

func (t *ValueTarget) ZeroField(name string) error

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL