Documentation
¶
Index ¶
- Variables
- type Block
- type Challenge
- func (*Challenge) Descriptor() ([]byte, []int)deprecated
- func (x *Challenge) GetExpiresAtMs() uint64
- func (x *Challenge) GetNonce() []byte
- func (x *Challenge) GetServerId() string
- func (*Challenge) ProtoMessage()
- func (x *Challenge) ProtoReflect() protoreflect.Message
- func (x *Challenge) Reset()
- func (x *Challenge) String() string
- type Changed
- type Changes
- func (*Changes) Descriptor() ([]byte, []int)deprecated
- func (x *Changes) GetBlocks() []uint64
- func (x *Changes) GetComplete() bool
- func (x *Changes) GetFromVersion() uint64
- func (x *Changes) GetToVersion() uint64
- func (*Changes) ProtoMessage()
- func (x *Changes) ProtoReflect() protoreflect.Message
- func (x *Changes) Reset()
- func (x *Changes) String() string
- type ClaimSlot
- type ClientFrame
- func (*ClientFrame) Descriptor() ([]byte, []int)deprecated
- func (x *ClientFrame) GetBody() isClientFrame_Body
- func (x *ClientFrame) GetChanged() *Changed
- func (x *ClientFrame) GetClaimSlot() *ClaimSlot
- func (x *ClientFrame) GetCloseDb() *CloseDb
- func (x *ClientFrame) GetCommit() *Commit
- func (x *ClientFrame) GetDelete() *Delete
- func (x *ClientFrame) GetDeleteSlot() *DeleteSlot
- func (x *ClientFrame) GetFetch() *Fetch
- func (x *ClientFrame) GetHello() *Hello
- func (x *ClientFrame) GetOpen() *Open
- func (x *ClientFrame) GetPing() *Ping
- func (x *ClientFrame) GetProof() *Proof
- func (x *ClientFrame) GetRequestId() uint64
- func (x *ClientFrame) GetSetSlotLabel() *SetSlotLabel
- func (*ClientFrame) ProtoMessage()
- func (x *ClientFrame) ProtoReflect() protoreflect.Message
- func (x *ClientFrame) Reset()
- func (x *ClientFrame) String() string
- type ClientFrame_Changed
- type ClientFrame_ClaimSlot
- type ClientFrame_CloseDb
- type ClientFrame_Commit
- type ClientFrame_Delete
- type ClientFrame_DeleteSlot
- type ClientFrame_Fetch
- type ClientFrame_Hello
- type ClientFrame_Open
- type ClientFrame_Ping
- type ClientFrame_Proof
- type ClientFrame_SetSlotLabel
- type CloseDb
- type Commit
- func (*Commit) Descriptor() ([]byte, []int)deprecated
- func (x *Commit) GetBaseVersion() uint64
- func (x *Commit) GetBlocks() []*Block
- func (x *Commit) GetCommitId() []byte
- func (x *Commit) GetDbId() string
- func (x *Commit) GetLeaseEpoch() uint64
- func (x *Commit) GetMore() bool
- func (x *Commit) GetPageCount() uint64
- func (x *Commit) GetPart() uint32
- func (*Commit) ProtoMessage()
- func (x *Commit) ProtoReflect() protoreflect.Message
- func (x *Commit) Reset()
- func (x *Commit) String() string
- type CommitAck
- type Delete
- type DeleteSlot
- type Error
- func (*Error) Descriptor() ([]byte, []int)deprecated
- func (x *Error) GetCode() ErrorCode
- func (x *Error) GetCurrentVersion() uint64
- func (x *Error) GetDetail() string
- func (x *Error) GetLeaseHolderSinceMs() uint64
- func (*Error) ProtoMessage()
- func (x *Error) ProtoReflect() protoreflect.Message
- func (x *Error) Reset()
- func (x *Error) String() string
- type ErrorCode
- type Fetch
- func (*Fetch) Descriptor() ([]byte, []int)deprecated
- func (x *Fetch) GetCount() uint64
- func (x *Fetch) GetDbId() string
- func (x *Fetch) GetFirstBlock() uint64
- func (x *Fetch) GetRanges() []*Range
- func (x *Fetch) GetVersion() uint64
- func (*Fetch) ProtoMessage()
- func (x *Fetch) ProtoReflect() protoreflect.Message
- func (x *Fetch) Reset()
- func (x *Fetch) String() string
- type Hello
- func (*Hello) Descriptor() ([]byte, []int)deprecated
- func (x *Hello) GetAccessToken() string
- func (x *Hello) GetInstanceId() []byte
- func (x *Hello) GetProtocolVersion() uint32
- func (x *Hello) GetPublicKey() []byte
- func (x *Hello) GetSigAlg() SigAlg
- func (*Hello) ProtoMessage()
- func (x *Hello) ProtoReflect() protoreflect.Message
- func (x *Hello) Reset()
- func (x *Hello) String() string
- type HelloOk
- func (*HelloOk) Descriptor() ([]byte, []int)deprecated
- func (x *HelloOk) GetAccessTokenTtlMs() uint64
- func (x *HelloOk) GetLeaseTtlMs() uint32
- func (x *HelloOk) GetMaxFrameBytes() uint32
- func (x *HelloOk) GetPingIntervalMs() uint32
- func (x *HelloOk) GetProtocolVersion() uint32
- func (*HelloOk) ProtoMessage()
- func (x *HelloOk) ProtoReflect() protoreflect.Message
- func (x *HelloOk) Reset()
- func (x *HelloOk) String() string
- type LeaseRevoked
- func (*LeaseRevoked) Descriptor() ([]byte, []int)deprecated
- func (x *LeaseRevoked) GetDbId() string
- func (x *LeaseRevoked) GetNewLeaseEpoch() uint64
- func (*LeaseRevoked) ProtoMessage()
- func (x *LeaseRevoked) ProtoReflect() protoreflect.Message
- func (x *LeaseRevoked) Reset()
- func (x *LeaseRevoked) String() string
- type Ok
- type Open
- func (*Open) Descriptor() ([]byte, []int)deprecated
- func (x *Open) GetCreateIfMissing() bool
- func (x *Open) GetDbId() string
- func (x *Open) GetPageSize() uint32
- func (x *Open) GetResume() *Resume
- func (x *Open) GetTakeover() bool
- func (*Open) ProtoMessage()
- func (x *Open) ProtoReflect() protoreflect.Message
- func (x *Open) Reset()
- func (x *Open) String() string
- type Opened
- func (*Opened) Descriptor() ([]byte, []int)deprecated
- func (x *Opened) GetLastCommitId() []byte
- func (x *Opened) GetLeaseEpoch() uint64
- func (x *Opened) GetLeaseId() []byte
- func (x *Opened) GetPageCount() uint64
- func (x *Opened) GetPageSize() uint32
- func (x *Opened) GetVersion() uint64
- func (*Opened) ProtoMessage()
- func (x *Opened) ProtoReflect() protoreflect.Message
- func (x *Opened) Reset()
- func (x *Opened) String() string
- type Pages
- type Ping
- type Pong
- type Proof
- type Range
- type Resume
- func (*Resume) Descriptor() ([]byte, []int)deprecated
- func (x *Resume) GetKnownVersion() uint64
- func (x *Resume) GetLeaseEpoch() uint64
- func (x *Resume) GetLeaseId() []byte
- func (x *Resume) GetPendingCommitId() []byte
- func (*Resume) ProtoMessage()
- func (x *Resume) ProtoReflect() protoreflect.Message
- func (x *Resume) Reset()
- func (x *Resume) String() string
- type ServerFrame
- func (*ServerFrame) Descriptor() ([]byte, []int)deprecated
- func (x *ServerFrame) GetBody() isServerFrame_Body
- func (x *ServerFrame) GetChallenge() *Challenge
- func (x *ServerFrame) GetChanges() *Changes
- func (x *ServerFrame) GetCommitAck() *CommitAck
- func (x *ServerFrame) GetError() *Error
- func (x *ServerFrame) GetHelloOk() *HelloOk
- func (x *ServerFrame) GetLeaseRevoked() *LeaseRevoked
- func (x *ServerFrame) GetOk() *Ok
- func (x *ServerFrame) GetOpened() *Opened
- func (x *ServerFrame) GetPages() *Pages
- func (x *ServerFrame) GetPong() *Pong
- func (x *ServerFrame) GetRequestId() uint64
- func (x *ServerFrame) GetSlot() *Slot
- func (*ServerFrame) ProtoMessage()
- func (x *ServerFrame) ProtoReflect() protoreflect.Message
- func (x *ServerFrame) Reset()
- func (x *ServerFrame) String() string
- type ServerFrame_Challenge
- type ServerFrame_Changes
- type ServerFrame_CommitAck
- type ServerFrame_Error
- type ServerFrame_HelloOk
- type ServerFrame_LeaseRevoked
- type ServerFrame_Ok
- type ServerFrame_Opened
- type ServerFrame_Pages
- type ServerFrame_Pong
- type ServerFrame_Slot
- type SetSlotLabel
- type SigAlg
- type Slot
Constants ¶
This section is empty.
Variables ¶
var ( SigAlg_name = map[int32]string{ 0: "SIG_ALG_UNSPECIFIED", 1: "SIG_ALG_ED25519", } SigAlg_value = map[string]int32{ "SIG_ALG_UNSPECIFIED": 0, "SIG_ALG_ED25519": 1, } )
Enum value maps for SigAlg.
var ( ErrorCode_name = map[int32]string{ 0: "ERROR_CODE_UNSPECIFIED", 1: "ERROR_CODE_UNAUTHENTICATED", 2: "ERROR_CODE_FORBIDDEN", 3: "ERROR_CODE_NOT_FOUND", 4: "ERROR_CODE_LEASE_HELD", 5: "ERROR_CODE_FENCED", 6: "ERROR_CODE_VERSION_CONFLICT", 7: "ERROR_CODE_BAD_REQUEST", 8: "ERROR_CODE_TOO_LARGE", 9: "ERROR_CODE_QUOTA_EXCEEDED", 10: "ERROR_CODE_RATE_LIMITED", 11: "ERROR_CODE_INTERNAL", 12: "ERROR_CODE_ACCESS_DENIED", 13: "ERROR_CODE_SLOT_TAKEN", } ErrorCode_value = map[string]int32{ "ERROR_CODE_UNSPECIFIED": 0, "ERROR_CODE_UNAUTHENTICATED": 1, "ERROR_CODE_FORBIDDEN": 2, "ERROR_CODE_NOT_FOUND": 3, "ERROR_CODE_LEASE_HELD": 4, "ERROR_CODE_FENCED": 5, "ERROR_CODE_VERSION_CONFLICT": 6, "ERROR_CODE_BAD_REQUEST": 7, "ERROR_CODE_TOO_LARGE": 8, "ERROR_CODE_QUOTA_EXCEEDED": 9, "ERROR_CODE_RATE_LIMITED": 10, "ERROR_CODE_INTERNAL": 11, "ERROR_CODE_ACCESS_DENIED": 12, "ERROR_CODE_SLOT_TAKEN": 13, } )
Enum value maps for ErrorCode.
var File_sqlite_remote_v1_sqlite_remote_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type Block ¶
type Block struct {
// Byte offset in the file divided by page_size.
Index uint64 `protobuf:"varint,1,opt,name=index,proto3" json:"index,omitempty"`
// Exactly page_size bytes.
Data []byte `protobuf:"bytes,2,opt,name=data,proto3" json:"data,omitempty"`
// contains filtered or unexported fields
}
One block of the database file.
func (*Block) Descriptor
deprecated
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type Challenge ¶
type Challenge struct {
// 32 random bytes. Valid for this login only.
Nonce []byte `protobuf:"bytes,1,opt,name=nonce,proto3" json:"nonce,omitempty"`
// The server's configured identifier, normally its public WebSocket URL, e.g. "wss://vfs.example/v1/ws". It is
// part of the signed transcript. A client that compares it with the URL it connected to detects a challenge that
// another server relays. Browsers do not expose TLS channel binding, so this is the only binding available.
// sqlite-remote-vfs does not compare it; it expects a separate key for each server instead.
ServerId string `protobuf:"bytes,2,opt,name=server_id,json=serverId,proto3" json:"server_id,omitempty"`
// Deadline for the `Proof`, in milliseconds since the Unix epoch.
ExpiresAtMs uint64 `protobuf:"varint,3,opt,name=expires_at_ms,json=expiresAtMs,proto3" json:"expires_at_ms,omitempty"`
// contains filtered or unexported fields
}
Answer to `Hello`, with the Hello's request_id. The client answers with a `Proof`.
func (*Challenge) Descriptor
deprecated
func (*Challenge) GetExpiresAtMs ¶
func (*Challenge) GetServerId ¶
func (*Challenge) ProtoMessage ¶
func (*Challenge) ProtoMessage()
func (*Challenge) ProtoReflect ¶
func (x *Challenge) ProtoReflect() protoreflect.Message
type Changed ¶
type Changed struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
// Version of the client's local copy. Must not be greater than the current version.
FromVersion uint64 `protobuf:"varint,2,opt,name=from_version,json=fromVersion,proto3" json:"from_version,omitempty"`
// contains filtered or unexported fields
}
Requests the indexes of all blocks changed since `from_version`. Answered with `Changes`.
Used to catch up a local copy that is a few commits behind. The client discards those blocks from the copy and keeps the rest, instead of fetching the whole database.
func (*Changed) Descriptor
deprecated
func (*Changed) GetFromVersion ¶
func (*Changed) ProtoMessage ¶
func (*Changed) ProtoMessage()
func (*Changed) ProtoReflect ¶
func (x *Changed) ProtoReflect() protoreflect.Message
type Changes ¶
type Changes struct {
FromVersion uint64 `protobuf:"varint,1,opt,name=from_version,json=fromVersion,proto3" json:"from_version,omitempty"`
// The current version.
ToVersion uint64 `protobuf:"varint,2,opt,name=to_version,json=toVersion,proto3" json:"to_version,omitempty"`
// Indexes of all blocks written by any commit after `from_version`, ascending and without duplicates.
Blocks []uint64 `protobuf:"varint,3,rep,packed,name=blocks,proto3" json:"blocks,omitempty"`
// False if the server's change log does not reach back to `from_version`, or the list does not fit in one frame.
// `blocks` is then empty and the client has to discard its local copy.
Complete bool `protobuf:"varint,4,opt,name=complete,proto3" json:"complete,omitempty"`
// contains filtered or unexported fields
}
Answer to `Changed`.
func (*Changes) Descriptor
deprecated
func (*Changes) GetComplete ¶
func (*Changes) GetFromVersion ¶
func (*Changes) GetToVersion ¶
func (*Changes) ProtoMessage ¶
func (*Changes) ProtoMessage()
func (*Changes) ProtoReflect ¶
func (x *Changes) ProtoReflect() protoreflect.Message
type ClaimSlot ¶ added in v0.3.0
type ClaimSlot struct {
// contains filtered or unexported fields
}
Makes the key of this connection the holder of its owner's slot. Answered with `Slot`.
Slots need access tokens: the owner is the token's `sub`. An owner has one slot. While the slot is held, opening a database with another key of the same owner fails with ERROR_CODE_SLOT_TAKEN, also when resuming a lease.
If another key holds the slot, the slot passes to this key with an empty label, and all databases of the other key are deleted completely, without the record that `Delete` keeps. Instances that have them open receive `LeaseRevoked` if they are connected to the same server instance; in any case their next request on them fails with ERROR_CODE_FENCED. Claiming a slot that this key already holds changes nothing. A server without access tokens answers with ERROR_CODE_BAD_REQUEST.
func (*ClaimSlot) Descriptor
deprecated
added in
v0.3.0
func (*ClaimSlot) ProtoMessage ¶ added in v0.3.0
func (*ClaimSlot) ProtoMessage()
func (*ClaimSlot) ProtoReflect ¶ added in v0.3.0
func (x *ClaimSlot) ProtoReflect() protoreflect.Message
type ClientFrame ¶
type ClientFrame struct {
// Chosen by the client. Must be greater than 0. Every answer to the request carries the same id.
RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
// 14 is reserved for recovery after a server restore.
//
// Types that are valid to be assigned to Body:
//
// *ClientFrame_Hello
// *ClientFrame_Open
// *ClientFrame_Fetch
// *ClientFrame_Commit
// *ClientFrame_Ping
// *ClientFrame_CloseDb
// *ClientFrame_Proof
// *ClientFrame_Delete
// *ClientFrame_Changed
// *ClientFrame_ClaimSlot
// *ClientFrame_DeleteSlot
// *ClientFrame_SetSlotLabel
Body isClientFrame_Body `protobuf_oneof:"body"`
// contains filtered or unexported fields
}
A frame from the client to the server.
func (*ClientFrame) Descriptor
deprecated
func (*ClientFrame) Descriptor() ([]byte, []int)
Deprecated: Use ClientFrame.ProtoReflect.Descriptor instead.
func (*ClientFrame) GetBody ¶
func (x *ClientFrame) GetBody() isClientFrame_Body
func (*ClientFrame) GetChanged ¶
func (x *ClientFrame) GetChanged() *Changed
func (*ClientFrame) GetClaimSlot ¶ added in v0.3.0
func (x *ClientFrame) GetClaimSlot() *ClaimSlot
func (*ClientFrame) GetCloseDb ¶
func (x *ClientFrame) GetCloseDb() *CloseDb
func (*ClientFrame) GetCommit ¶
func (x *ClientFrame) GetCommit() *Commit
func (*ClientFrame) GetDelete ¶
func (x *ClientFrame) GetDelete() *Delete
func (*ClientFrame) GetDeleteSlot ¶ added in v0.3.0
func (x *ClientFrame) GetDeleteSlot() *DeleteSlot
func (*ClientFrame) GetFetch ¶
func (x *ClientFrame) GetFetch() *Fetch
func (*ClientFrame) GetHello ¶
func (x *ClientFrame) GetHello() *Hello
func (*ClientFrame) GetOpen ¶
func (x *ClientFrame) GetOpen() *Open
func (*ClientFrame) GetPing ¶
func (x *ClientFrame) GetPing() *Ping
func (*ClientFrame) GetProof ¶
func (x *ClientFrame) GetProof() *Proof
func (*ClientFrame) GetRequestId ¶
func (x *ClientFrame) GetRequestId() uint64
func (*ClientFrame) GetSetSlotLabel ¶ added in v0.4.0
func (x *ClientFrame) GetSetSlotLabel() *SetSlotLabel
func (*ClientFrame) ProtoMessage ¶
func (*ClientFrame) ProtoMessage()
func (*ClientFrame) ProtoReflect ¶
func (x *ClientFrame) ProtoReflect() protoreflect.Message
func (*ClientFrame) Reset ¶
func (x *ClientFrame) Reset()
func (*ClientFrame) String ¶
func (x *ClientFrame) String() string
type ClientFrame_Changed ¶
type ClientFrame_Changed struct {
Changed *Changed `protobuf:"bytes,19,opt,name=changed,proto3,oneof"`
}
type ClientFrame_ClaimSlot ¶ added in v0.3.0
type ClientFrame_ClaimSlot struct {
ClaimSlot *ClaimSlot `protobuf:"bytes,20,opt,name=claim_slot,json=claimSlot,proto3,oneof"`
}
type ClientFrame_CloseDb ¶
type ClientFrame_CloseDb struct {
CloseDb *CloseDb `protobuf:"bytes,16,opt,name=close_db,json=closeDb,proto3,oneof"`
}
type ClientFrame_Commit ¶
type ClientFrame_Commit struct {
Commit *Commit `protobuf:"bytes,13,opt,name=commit,proto3,oneof"`
}
type ClientFrame_Delete ¶
type ClientFrame_Delete struct {
Delete *Delete `protobuf:"bytes,18,opt,name=delete,proto3,oneof"`
}
type ClientFrame_DeleteSlot ¶ added in v0.3.0
type ClientFrame_DeleteSlot struct {
DeleteSlot *DeleteSlot `protobuf:"bytes,21,opt,name=delete_slot,json=deleteSlot,proto3,oneof"`
}
type ClientFrame_Fetch ¶
type ClientFrame_Fetch struct {
Fetch *Fetch `protobuf:"bytes,12,opt,name=fetch,proto3,oneof"`
}
type ClientFrame_Hello ¶
type ClientFrame_Hello struct {
Hello *Hello `protobuf:"bytes,10,opt,name=hello,proto3,oneof"`
}
type ClientFrame_Open ¶
type ClientFrame_Open struct {
Open *Open `protobuf:"bytes,11,opt,name=open,proto3,oneof"`
}
type ClientFrame_Ping ¶
type ClientFrame_Ping struct {
Ping *Ping `protobuf:"bytes,15,opt,name=ping,proto3,oneof"`
}
type ClientFrame_Proof ¶
type ClientFrame_Proof struct {
Proof *Proof `protobuf:"bytes,17,opt,name=proof,proto3,oneof"`
}
type ClientFrame_SetSlotLabel ¶ added in v0.4.0
type ClientFrame_SetSlotLabel struct {
SetSlotLabel *SetSlotLabel `protobuf:"bytes,22,opt,name=set_slot_label,json=setSlotLabel,proto3,oneof"`
}
type CloseDb ¶
type CloseDb struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
LeaseEpoch uint64 `protobuf:"varint,2,opt,name=lease_epoch,json=leaseEpoch,proto3" json:"lease_epoch,omitempty"`
// contains filtered or unexported fields
}
Releases the lease of a database immediately. Answered with `Ok`.
func (*CloseDb) Descriptor
deprecated
func (*CloseDb) GetLeaseEpoch ¶
func (*CloseDb) ProtoMessage ¶
func (*CloseDb) ProtoMessage()
func (*CloseDb) ProtoReflect ¶
func (x *CloseDb) ProtoReflect() protoreflect.Message
type Commit ¶
type Commit struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
// 16 random bytes, the same in every part. Makes a repeated commit idempotent: if the last applied commit has this
// id and the version is base_version + 1, the server answers with that version again.
CommitId []byte `protobuf:"bytes,2,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"`
// Current lease epoch, otherwise ERROR_CODE_FENCED.
LeaseEpoch uint64 `protobuf:"varint,3,opt,name=lease_epoch,json=leaseEpoch,proto3" json:"lease_epoch,omitempty"`
// Version the commit is based on. Must be the current version, otherwise ERROR_CODE_VERSION_CONFLICT.
BaseVersion uint64 `protobuf:"varint,4,opt,name=base_version,json=baseVersion,proto3" json:"base_version,omitempty"`
// Length of the database file after the commit, in blocks. Blocks at or beyond it are removed.
PageCount uint64 `protobuf:"varint,5,opt,name=page_count,json=pageCount,proto3" json:"page_count,omitempty"`
Blocks []*Block `protobuf:"bytes,6,rep,name=blocks,proto3" json:"blocks,omitempty"`
// True if more parts of this commit follow.
More bool `protobuf:"varint,7,opt,name=more,proto3" json:"more,omitempty"`
// Number of this part within the commit, starting at 0. Part 0 starts a new commit and discards an incomplete one.
// Every further part must directly follow the previous part and repeat its commit_id, lease_epoch, base_version
// and page_count. Otherwise the server refuses it and discards the commit, so later parts cannot be applied on
// their own. This keeps a commit atomic although the client sends all parts without waiting for answers.
Part uint32 `protobuf:"varint,8,opt,name=part,proto3" json:"part,omitempty"`
// contains filtered or unexported fields
}
One frame (part) of a commit: blocks changed by one or more SQLite transactions. The server applies a commit atomically. Only the last part is answered, with `CommitAck` or `Error`. A refused part is answered with `Error` at once.
func (*Commit) Descriptor
deprecated
func (*Commit) GetBaseVersion ¶
func (*Commit) GetCommitId ¶
func (*Commit) GetLeaseEpoch ¶
func (*Commit) GetPageCount ¶
func (*Commit) ProtoMessage ¶
func (*Commit) ProtoMessage()
func (*Commit) ProtoReflect ¶
func (x *Commit) ProtoReflect() protoreflect.Message
type CommitAck ¶
type CommitAck struct {
CommitId []byte `protobuf:"bytes,1,opt,name=commit_id,json=commitId,proto3" json:"commit_id,omitempty"`
// Version after the commit.
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
// contains filtered or unexported fields
}
Answer to the last part of an applied `Commit`. The commit is durable when this is sent.
func (*CommitAck) Descriptor
deprecated
func (*CommitAck) GetCommitId ¶
func (*CommitAck) GetVersion ¶
func (*CommitAck) ProtoMessage ¶
func (*CommitAck) ProtoMessage()
func (*CommitAck) ProtoReflect ¶
func (x *CommitAck) ProtoReflect() protoreflect.Message
type Delete ¶
type Delete struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
// Deletes even if another instance holds a lease that has not expired. That instance receives `LeaseRevoked`.
// Without it, the request fails with ERROR_CODE_LEASE_HELD in that case.
Takeover bool `protobuf:"varint,2,opt,name=takeover,proto3" json:"takeover,omitempty"`
// contains filtered or unexported fields
}
Deletes a database: its blocks and its change log. Answered with `Ok`, also if the database does not exist or was already deleted, so that a repeated request succeeds.
The database must not be open on this connection. The server keeps a record of the deleted database with its lease epoch and version, and increases the epoch, so that no earlier lease can commit again. Opening the database again with `create_if_missing` creates it empty with any page size; the epoch and the version continue from the deleted database. Opening it without `create_if_missing` fails with ERROR_CODE_NOT_FOUND.
func (*Delete) Descriptor
deprecated
func (*Delete) GetTakeover ¶
func (*Delete) ProtoMessage ¶
func (*Delete) ProtoMessage()
func (*Delete) ProtoReflect ¶
func (x *Delete) ProtoReflect() protoreflect.Message
type DeleteSlot ¶ added in v0.3.0
type DeleteSlot struct {
// contains filtered or unexported fields
}
Releases the owner's slot and deletes all databases of the key of this connection completely, without the record that `Delete` keeps. Answered with `Ok`, also if the owner has no slot. If another key holds the slot, nothing is deleted and the request fails with ERROR_CODE_SLOT_TAKEN. No database may be open on this connection.
func (*DeleteSlot) Descriptor
deprecated
added in
v0.3.0
func (*DeleteSlot) Descriptor() ([]byte, []int)
Deprecated: Use DeleteSlot.ProtoReflect.Descriptor instead.
func (*DeleteSlot) ProtoMessage ¶ added in v0.3.0
func (*DeleteSlot) ProtoMessage()
func (*DeleteSlot) ProtoReflect ¶ added in v0.3.0
func (x *DeleteSlot) ProtoReflect() protoreflect.Message
func (*DeleteSlot) Reset ¶ added in v0.3.0
func (x *DeleteSlot) Reset()
func (*DeleteSlot) String ¶ added in v0.3.0
func (x *DeleteSlot) String() string
type Error ¶
type Error struct {
Code ErrorCode `protobuf:"varint,1,opt,name=code,proto3,enum=sqlite_remote.v1.ErrorCode" json:"code,omitempty"`
// Human-readable reason. For ERROR_CODE_INTERNAL it contains no details.
Detail string `protobuf:"bytes,2,opt,name=detail,proto3" json:"detail,omitempty"`
// Current version of the database. Set with ERROR_CODE_VERSION_CONFLICT.
CurrentVersion uint64 `protobuf:"varint,3,opt,name=current_version,json=currentVersion,proto3" json:"current_version,omitempty"`
// Time the current lease was granted, in milliseconds since the Unix epoch. Set with ERROR_CODE_LEASE_HELD.
LeaseHolderSinceMs uint64 `protobuf:"varint,4,opt,name=lease_holder_since_ms,json=leaseHolderSinceMs,proto3" json:"lease_holder_since_ms,omitempty"`
// contains filtered or unexported fields
}
Answer to a failed request.
func (*Error) Descriptor
deprecated
func (*Error) GetCurrentVersion ¶
func (*Error) GetLeaseHolderSinceMs ¶
func (*Error) ProtoMessage ¶
func (*Error) ProtoMessage()
func (*Error) ProtoReflect ¶
func (x *Error) ProtoReflect() protoreflect.Message
type ErrorCode ¶
type ErrorCode int32
const ( ErrorCode_ERROR_CODE_UNSPECIFIED ErrorCode = 0 // Login failed: no valid `Proof`, an expired challenge, or a request before the login. ErrorCode_ERROR_CODE_UNAUTHENTICATED ErrorCode = 1 // The database belongs to another subject. ErrorCode_ERROR_CODE_FORBIDDEN ErrorCode = 2 // The database does not exist or was deleted. ErrorCode_ERROR_CODE_NOT_FOUND ErrorCode = 3 // Another instance holds a lease that has not expired. ErrorCode_ERROR_CODE_LEASE_HELD ErrorCode = 4 // The lease epoch is not the current one: another instance acquired the lease, or it was released. ErrorCode_ERROR_CODE_FENCED ErrorCode = 5 // The request is based on a version other than the current one. See `Error.current_version`. ErrorCode_ERROR_CODE_VERSION_CONFLICT ErrorCode = 6 // The request is invalid and cannot succeed when repeated, e.g. a block of the wrong size, a block index at or // beyond page_count, or a commit part that does not continue the pending commit. ErrorCode_ERROR_CODE_BAD_REQUEST ErrorCode = 7 // The commit exceeds the server's size limit for one commit. ErrorCode_ERROR_CODE_TOO_LARGE ErrorCode = 8 ErrorCode_ERROR_CODE_QUOTA_EXCEEDED ErrorCode = 9 ErrorCode_ERROR_CODE_RATE_LIMITED ErrorCode = 10 // Unexpected error on the server. Details are only in the server's log. ErrorCode_ERROR_CODE_INTERNAL ErrorCode = 11 // The server requires an access token (`Hello.access_token`), and the token is missing, invalid, expired, or bound // to another key. ErrorCode_ERROR_CODE_ACCESS_DENIED ErrorCode = 12 // Another key holds the owner's slot. See `ClaimSlot`. ErrorCode_ERROR_CODE_SLOT_TAKEN ErrorCode = 13 )
func (ErrorCode) Descriptor ¶
func (ErrorCode) Descriptor() protoreflect.EnumDescriptor
func (ErrorCode) EnumDescriptor
deprecated
func (ErrorCode) Number ¶
func (x ErrorCode) Number() protoreflect.EnumNumber
func (ErrorCode) Type ¶
func (ErrorCode) Type() protoreflect.EnumType
type Fetch ¶
type Fetch struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
// Must be the current version. Otherwise the request fails with ERROR_CODE_VERSION_CONFLICT.
Version uint64 `protobuf:"varint,2,opt,name=version,proto3" json:"version,omitempty"`
// One range: `count` blocks starting at `first_block`. Ignored if `ranges` is set.
FirstBlock uint64 `protobuf:"varint,3,opt,name=first_block,json=firstBlock,proto3" json:"first_block,omitempty"`
Count uint64 `protobuf:"varint,4,opt,name=count,proto3" json:"count,omitempty"`
// Several ranges, in ascending order and without overlap. At most 4096. Blocks that were never written are
// returned as zeros.
Ranges []*Range `protobuf:"bytes,5,rep,name=ranges,proto3" json:"ranges,omitempty"`
// contains filtered or unexported fields
}
Requests blocks as of `version`. Either one range (`first_block` and `count`) or several (`ranges`). Answered with one or more `Pages` frames.
Several ranges in one request are for catching up a local copy. The blocks changed by a series of commits are spread across the file, and one request per range would cost one round trip each.
func (*Fetch) Descriptor
deprecated
func (*Fetch) GetFirstBlock ¶
func (*Fetch) GetVersion ¶
func (*Fetch) ProtoMessage ¶
func (*Fetch) ProtoMessage()
func (*Fetch) ProtoReflect ¶
func (x *Fetch) ProtoReflect() protoreflect.Message
type Hello ¶
type Hello struct {
// Protocol version of the client. The server rejects a version other than its own with ERROR_CODE_BAD_REQUEST.
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
// Id of the client instance, e.g. one browser tab or worker. 1 to 64 bytes. Usually random. A client that restarts
// may use the same id again to take back its own lease without takeover, see `Open.takeover`. Two instances that run
// at the same time must not use the same id.
InstanceId []byte `protobuf:"bytes,2,opt,name=instance_id,json=instanceId,proto3" json:"instance_id,omitempty"`
// Algorithm and public key of the client's key pair. The client proves possession of the private key with a
// `Proof`. The server derives the subject from the public key. The subject determines which databases the
// connection can access. A client has no other way to select a subject.
SigAlg SigAlg `protobuf:"varint,3,opt,name=sig_alg,json=sigAlg,proto3,enum=sqlite_remote.v1.SigAlg" json:"sig_alg,omitempty"`
PublicKey []byte `protobuf:"bytes,4,opt,name=public_key,json=publicKey,proto3" json:"public_key,omitempty"`
// Access token, for a server that admits only clients with one. A signed JWT whose `cnf` claim binds it to
// `public_key`, so that it is useless without the private key. The server checks it before the `Challenge` and
// rejects a missing, invalid or expired token, or one bound to another key, with ERROR_CODE_ACCESS_DENIED. A server
// without such a requirement ignores the field. See `HelloOk.access_token_ttl_ms`.
AccessToken string `protobuf:"bytes,5,opt,name=access_token,json=accessToken,proto3" json:"access_token,omitempty"` // 6 is reserved for a second signature algorithm.
// contains filtered or unexported fields
}
First frame on a connection. The server answers with a `Challenge`, or with an `Error` if the frame is invalid or the access token is rejected.
func (*Hello) Descriptor
deprecated
func (*Hello) GetAccessToken ¶
func (*Hello) GetInstanceId ¶
func (*Hello) GetProtocolVersion ¶
func (*Hello) GetPublicKey ¶
func (*Hello) ProtoMessage ¶
func (*Hello) ProtoMessage()
func (*Hello) ProtoReflect ¶
func (x *Hello) ProtoReflect() protoreflect.Message
type HelloOk ¶
type HelloOk struct {
// Protocol version of the server.
ProtocolVersion uint32 `protobuf:"varint,1,opt,name=protocol_version,json=protocolVersion,proto3" json:"protocol_version,omitempty"`
// Largest frame the server accepts, in bytes. The client splits a commit into parts that fit.
MaxFrameBytes uint32 `protobuf:"varint,2,opt,name=max_frame_bytes,json=maxFrameBytes,proto3" json:"max_frame_bytes,omitempty"`
// Interval at which the client sends a `Ping` while it is otherwise idle, in milliseconds.
PingIntervalMs uint32 `protobuf:"varint,3,opt,name=ping_interval_ms,json=pingIntervalMs,proto3" json:"ping_interval_ms,omitempty"`
// Time after the last renewal from which another instance can acquire the lease without `takeover`, in
// milliseconds. Commits and pings renew the lease.
LeaseTtlMs uint32 `protobuf:"varint,4,opt,name=lease_ttl_ms,json=leaseTtlMs,proto3" json:"lease_ttl_ms,omitempty"`
// Remaining lifetime of the access token in milliseconds, 0 without a token. Relative, so that the clocks of client
// and server need not agree. The client reconnects with a new token before this time has passed, between two
// requests. Shortly after it has passed, the server closes the connection at the next frame.
AccessTokenTtlMs uint64 `protobuf:"varint,5,opt,name=access_token_ttl_ms,json=accessTokenTtlMs,proto3" json:"access_token_ttl_ms,omitempty"`
// contains filtered or unexported fields
}
Answer to a valid `Proof`, with the Proof's request_id. Completes the login and carries the server's limits.
func (*HelloOk) Descriptor
deprecated
func (*HelloOk) GetAccessTokenTtlMs ¶
func (*HelloOk) GetLeaseTtlMs ¶
func (*HelloOk) GetMaxFrameBytes ¶
func (*HelloOk) GetPingIntervalMs ¶
func (*HelloOk) GetProtocolVersion ¶
func (*HelloOk) ProtoMessage ¶
func (*HelloOk) ProtoMessage()
func (*HelloOk) ProtoReflect ¶
func (x *HelloOk) ProtoReflect() protoreflect.Message
type LeaseRevoked ¶
type LeaseRevoked struct {
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
NewLeaseEpoch uint64 `protobuf:"varint,2,opt,name=new_lease_epoch,json=newLeaseEpoch,proto3" json:"new_lease_epoch,omitempty"`
// contains filtered or unexported fields
}
Sent unprompted (request_id 0) when another instance has acquired the lease of a database open on this connection. Delivery is not guaranteed. A client that missed it gets ERROR_CODE_FENCED on its next commit.
func (*LeaseRevoked) Descriptor
deprecated
func (*LeaseRevoked) Descriptor() ([]byte, []int)
Deprecated: Use LeaseRevoked.ProtoReflect.Descriptor instead.
func (*LeaseRevoked) GetDbId ¶
func (x *LeaseRevoked) GetDbId() string
func (*LeaseRevoked) GetNewLeaseEpoch ¶
func (x *LeaseRevoked) GetNewLeaseEpoch() uint64
func (*LeaseRevoked) ProtoMessage ¶
func (*LeaseRevoked) ProtoMessage()
func (*LeaseRevoked) ProtoReflect ¶
func (x *LeaseRevoked) ProtoReflect() protoreflect.Message
func (*LeaseRevoked) Reset ¶
func (x *LeaseRevoked) Reset()
func (*LeaseRevoked) String ¶
func (x *LeaseRevoked) String() string
type Ok ¶
type Ok struct {
// contains filtered or unexported fields
}
Answer to a request that returns no data, e.g. `CloseDb`.
func (*Ok) Descriptor
deprecated
func (*Ok) ProtoMessage ¶
func (*Ok) ProtoMessage()
func (*Ok) ProtoReflect ¶
func (x *Ok) ProtoReflect() protoreflect.Message
type Open ¶
type Open struct {
// Name of the database within the subject. 1 to 128 bytes of UTF-8.
DbId string `protobuf:"bytes,1,opt,name=db_id,json=dbId,proto3" json:"db_id,omitempty"`
// Page size of a new database. For an existing database it must be 0 or equal to the database's page size.
PageSize uint32 `protobuf:"varint,2,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Creates the database if it does not exist or was deleted. Without it, such a database fails with
// ERROR_CODE_NOT_FOUND.
CreateIfMissing bool `protobuf:"varint,3,opt,name=create_if_missing,json=createIfMissing,proto3" json:"create_if_missing,omitempty"`
// Acquires the lease even if another instance holds one that has not expired. Without it, the open fails with
// ERROR_CODE_LEASE_HELD in that case. The instance that holds the lease, identified by `Hello.instance_id`, gets a
// new lease without it: a client that restarted has lost its lease id and cannot resume. Its earlier lease is fenced.
Takeover bool `protobuf:"varint,4,opt,name=takeover,proto3" json:"takeover,omitempty"`
// Set only when reopening after a broken connection. Continues the previous lease instead of acquiring a new one.
Resume *Resume `protobuf:"bytes,5,opt,name=resume,proto3" json:"resume,omitempty"`
// contains filtered or unexported fields
}
Opens a database and acquires its lease, the exclusive right to commit to it. Answered with `Opened`.
func (*Open) Descriptor
deprecated
func (*Open) GetCreateIfMissing ¶
func (*Open) GetPageSize ¶
func (*Open) GetTakeover ¶
func (*Open) ProtoMessage ¶
func (*Open) ProtoMessage()
func (*Open) ProtoReflect ¶
func (x *Open) ProtoReflect() protoreflect.Message
type Opened ¶
type Opened struct {
LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
// Fencing token. Every new lease has a higher epoch. A `Commit` must carry the current epoch, otherwise it fails
// with ERROR_CODE_FENCED.
LeaseEpoch uint64 `protobuf:"varint,2,opt,name=lease_epoch,json=leaseEpoch,proto3" json:"lease_epoch,omitempty"`
// Current version. Every applied commit and every deletion increases it by 1.
Version uint64 `protobuf:"varint,3,opt,name=version,proto3" json:"version,omitempty"`
PageSize uint32 `protobuf:"varint,4,opt,name=page_size,json=pageSize,proto3" json:"page_size,omitempty"`
// Length of the database file, in blocks.
PageCount uint64 `protobuf:"varint,5,opt,name=page_count,json=pageCount,proto3" json:"page_count,omitempty"`
// commit_id of the last applied commit. A client whose commit was not acknowledged compares it with its own
// commit_id to find out whether the commit was applied.
LastCommitId []byte `protobuf:"bytes,6,opt,name=last_commit_id,json=lastCommitId,proto3" json:"last_commit_id,omitempty"`
// contains filtered or unexported fields
}
Answer to `Open`: the lease and the current state of the database.
func (*Opened) Descriptor
deprecated
func (*Opened) GetLastCommitId ¶
func (*Opened) GetLeaseEpoch ¶
func (*Opened) GetLeaseId ¶
func (*Opened) GetPageCount ¶
func (*Opened) GetPageSize ¶
func (*Opened) GetVersion ¶
func (*Opened) ProtoMessage ¶
func (*Opened) ProtoMessage()
func (*Opened) ProtoReflect ¶
func (x *Opened) ProtoReflect() protoreflect.Message
type Pages ¶
type Pages struct {
// Index of the first block in this frame.
FirstBlock uint64 `protobuf:"varint,1,opt,name=first_block,json=firstBlock,proto3" json:"first_block,omitempty"`
// Consecutive blocks from `first_block`, each exactly page_size bytes.
Blocks [][]byte `protobuf:"bytes,2,rep,name=blocks,proto3" json:"blocks,omitempty"`
// True on the last frame of the answer.
Last bool `protobuf:"varint,3,opt,name=last,proto3" json:"last,omitempty"`
// contains filtered or unexported fields
}
Blocks answering a `Fetch`, with the Fetch's request_id. The server sends the ranges in the requested order and splits them across as many frames as needed. A frame never contains blocks from two ranges.
func (*Pages) Descriptor
deprecated
func (*Pages) GetFirstBlock ¶
func (*Pages) ProtoMessage ¶
func (*Pages) ProtoMessage()
func (*Pages) ProtoReflect ¶
func (x *Pages) ProtoReflect() protoreflect.Message
type Ping ¶
type Ping struct {
// Client clock in milliseconds. Returned unchanged in the `Pong`.
ClientTimeMs uint64 `protobuf:"varint,1,opt,name=client_time_ms,json=clientTimeMs,proto3" json:"client_time_ms,omitempty"`
// contains filtered or unexported fields
}
Keeps the connection open and renews the leases of all databases open on it. The server renews a lease only if at least half of lease_ttl_ms has passed since its last renewal. Answered with `Pong`.
func (*Ping) Descriptor
deprecated
func (*Ping) GetClientTimeMs ¶
func (*Ping) ProtoMessage ¶
func (*Ping) ProtoMessage()
func (*Ping) ProtoReflect ¶
func (x *Ping) ProtoReflect() protoreflect.Message
type Pong ¶
type Pong struct {
ClientTimeMs uint64 `protobuf:"varint,1,opt,name=client_time_ms,json=clientTimeMs,proto3" json:"client_time_ms,omitempty"`
// contains filtered or unexported fields
}
Answer to `Ping`.
func (*Pong) Descriptor
deprecated
func (*Pong) GetClientTimeMs ¶
func (*Pong) ProtoMessage ¶
func (*Pong) ProtoMessage()
func (*Pong) ProtoReflect ¶
func (x *Pong) ProtoReflect() protoreflect.Message
type Proof ¶
type Proof struct {
Signature []byte `protobuf:"bytes,1,opt,name=signature,proto3" json:"signature,omitempty"`
// contains filtered or unexported fields
}
Answer to `Challenge`. The server answers with `HelloOk`, or with an `Error` (ERROR_CODE_UNAUTHENTICATED), both with the Proof's request_id.
`signature` is the signature over the following transcript. Each part is preceded by its length as a 4-byte big-endian integer:
"sqlite-remote-auth-v1" || server_id || nonce || instance_id || sig_alg || public_key
sig_alg is the enum value as a 4-byte big-endian integer.
func (*Proof) Descriptor
deprecated
func (*Proof) GetSignature ¶
func (*Proof) ProtoMessage ¶
func (*Proof) ProtoMessage()
func (*Proof) ProtoReflect ¶
func (x *Proof) ProtoReflect() protoreflect.Message
type Range ¶
type Range struct {
FirstBlock uint64 `protobuf:"varint,1,opt,name=first_block,json=firstBlock,proto3" json:"first_block,omitempty"`
Count uint64 `protobuf:"varint,2,opt,name=count,proto3" json:"count,omitempty"`
// contains filtered or unexported fields
}
A range of consecutive blocks.
func (*Range) Descriptor
deprecated
func (*Range) GetFirstBlock ¶
func (*Range) ProtoMessage ¶
func (*Range) ProtoMessage()
func (*Range) ProtoReflect ¶
func (x *Range) ProtoReflect() protoreflect.Message
type Resume ¶
type Resume struct {
// lease_id and lease_epoch from the previous `Opened`. If the lease is no longer current, the open fails with
// ERROR_CODE_FENCED.
LeaseId []byte `protobuf:"bytes,1,opt,name=lease_id,json=leaseId,proto3" json:"lease_id,omitempty"`
LeaseEpoch uint64 `protobuf:"varint,2,opt,name=lease_epoch,json=leaseEpoch,proto3" json:"lease_epoch,omitempty"`
// The last version the server acknowledged to this client.
KnownVersion uint64 `protobuf:"varint,3,opt,name=known_version,json=knownVersion,proto3" json:"known_version,omitempty"`
// commit_id of a commit that was sent but not acknowledged. Empty if there is none.
PendingCommitId []byte `protobuf:"bytes,4,opt,name=pending_commit_id,json=pendingCommitId,proto3" json:"pending_commit_id,omitempty"`
// contains filtered or unexported fields
}
The previous lease and state, for reopening after a broken connection.
func (*Resume) Descriptor
deprecated
func (*Resume) GetKnownVersion ¶
func (*Resume) GetLeaseEpoch ¶
func (*Resume) GetLeaseId ¶
func (*Resume) GetPendingCommitId ¶
func (*Resume) ProtoMessage ¶
func (*Resume) ProtoMessage()
func (*Resume) ProtoReflect ¶
func (x *Resume) ProtoReflect() protoreflect.Message
type ServerFrame ¶
type ServerFrame struct {
// The request_id of the request this frame answers. 0 for a frame the server sends unprompted (`LeaseRevoked`).
RequestId uint64 `protobuf:"varint,1,opt,name=request_id,json=requestId,proto3" json:"request_id,omitempty"`
// Types that are valid to be assigned to Body:
//
// *ServerFrame_HelloOk
// *ServerFrame_Opened
// *ServerFrame_Pages
// *ServerFrame_CommitAck
// *ServerFrame_Pong
// *ServerFrame_LeaseRevoked
// *ServerFrame_Error
// *ServerFrame_Ok
// *ServerFrame_Challenge
// *ServerFrame_Changes
// *ServerFrame_Slot
Body isServerFrame_Body `protobuf_oneof:"body"`
// contains filtered or unexported fields
}
A frame from the server to the client.
func (*ServerFrame) Descriptor
deprecated
func (*ServerFrame) Descriptor() ([]byte, []int)
Deprecated: Use ServerFrame.ProtoReflect.Descriptor instead.
func (*ServerFrame) GetBody ¶
func (x *ServerFrame) GetBody() isServerFrame_Body
func (*ServerFrame) GetChallenge ¶
func (x *ServerFrame) GetChallenge() *Challenge
func (*ServerFrame) GetChanges ¶
func (x *ServerFrame) GetChanges() *Changes
func (*ServerFrame) GetCommitAck ¶
func (x *ServerFrame) GetCommitAck() *CommitAck
func (*ServerFrame) GetError ¶
func (x *ServerFrame) GetError() *Error
func (*ServerFrame) GetHelloOk ¶
func (x *ServerFrame) GetHelloOk() *HelloOk
func (*ServerFrame) GetLeaseRevoked ¶
func (x *ServerFrame) GetLeaseRevoked() *LeaseRevoked
func (*ServerFrame) GetOk ¶
func (x *ServerFrame) GetOk() *Ok
func (*ServerFrame) GetOpened ¶
func (x *ServerFrame) GetOpened() *Opened
func (*ServerFrame) GetPages ¶
func (x *ServerFrame) GetPages() *Pages
func (*ServerFrame) GetPong ¶
func (x *ServerFrame) GetPong() *Pong
func (*ServerFrame) GetRequestId ¶
func (x *ServerFrame) GetRequestId() uint64
func (*ServerFrame) GetSlot ¶ added in v0.3.0
func (x *ServerFrame) GetSlot() *Slot
func (*ServerFrame) ProtoMessage ¶
func (*ServerFrame) ProtoMessage()
func (*ServerFrame) ProtoReflect ¶
func (x *ServerFrame) ProtoReflect() protoreflect.Message
func (*ServerFrame) Reset ¶
func (x *ServerFrame) Reset()
func (*ServerFrame) String ¶
func (x *ServerFrame) String() string
type ServerFrame_Challenge ¶
type ServerFrame_Challenge struct {
Challenge *Challenge `protobuf:"bytes,18,opt,name=challenge,proto3,oneof"`
}
type ServerFrame_Changes ¶
type ServerFrame_Changes struct {
Changes *Changes `protobuf:"bytes,19,opt,name=changes,proto3,oneof"`
}
type ServerFrame_CommitAck ¶
type ServerFrame_CommitAck struct {
CommitAck *CommitAck `protobuf:"bytes,13,opt,name=commit_ack,json=commitAck,proto3,oneof"`
}
type ServerFrame_Error ¶
type ServerFrame_Error struct {
Error *Error `protobuf:"bytes,16,opt,name=error,proto3,oneof"`
}
type ServerFrame_HelloOk ¶
type ServerFrame_HelloOk struct {
HelloOk *HelloOk `protobuf:"bytes,10,opt,name=hello_ok,json=helloOk,proto3,oneof"`
}
type ServerFrame_LeaseRevoked ¶
type ServerFrame_LeaseRevoked struct {
LeaseRevoked *LeaseRevoked `protobuf:"bytes,15,opt,name=lease_revoked,json=leaseRevoked,proto3,oneof"`
}
type ServerFrame_Ok ¶
type ServerFrame_Ok struct {
Ok *Ok `protobuf:"bytes,17,opt,name=ok,proto3,oneof"`
}
type ServerFrame_Opened ¶
type ServerFrame_Opened struct {
Opened *Opened `protobuf:"bytes,11,opt,name=opened,proto3,oneof"`
}
type ServerFrame_Pages ¶
type ServerFrame_Pages struct {
Pages *Pages `protobuf:"bytes,12,opt,name=pages,proto3,oneof"`
}
type ServerFrame_Pong ¶
type ServerFrame_Pong struct {
Pong *Pong `protobuf:"bytes,14,opt,name=pong,proto3,oneof"`
}
type ServerFrame_Slot ¶ added in v0.3.0
type ServerFrame_Slot struct {
Slot *Slot `protobuf:"bytes,20,opt,name=slot,proto3,oneof"`
}
type SetSlotLabel ¶ added in v0.4.0
type SetSlotLabel struct {
// At most 256 bytes. Empty clears the label.
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
// contains filtered or unexported fields
}
Sets the label of the owner's slot, e.g. the id of the device that holds it. Only the key that holds the slot can set it: for another key the request fails with ERROR_CODE_SLOT_TAKEN, without a slot with ERROR_CODE_NOT_FOUND. It never passes or deletes anything. Answered with `Slot`.
func (*SetSlotLabel) Descriptor
deprecated
added in
v0.4.0
func (*SetSlotLabel) Descriptor() ([]byte, []int)
Deprecated: Use SetSlotLabel.ProtoReflect.Descriptor instead.
func (*SetSlotLabel) GetLabel ¶ added in v0.4.0
func (x *SetSlotLabel) GetLabel() string
func (*SetSlotLabel) ProtoMessage ¶ added in v0.4.0
func (*SetSlotLabel) ProtoMessage()
func (*SetSlotLabel) ProtoReflect ¶ added in v0.4.0
func (x *SetSlotLabel) ProtoReflect() protoreflect.Message
func (*SetSlotLabel) Reset ¶ added in v0.4.0
func (x *SetSlotLabel) Reset()
func (*SetSlotLabel) String ¶ added in v0.4.0
func (x *SetSlotLabel) String() string
type SigAlg ¶
type SigAlg int32
Signature algorithm of the client's key pair.
func (SigAlg) Descriptor ¶
func (SigAlg) Descriptor() protoreflect.EnumDescriptor
func (SigAlg) EnumDescriptor
deprecated
func (SigAlg) Number ¶
func (x SigAlg) Number() protoreflect.EnumNumber
func (SigAlg) Type ¶
func (SigAlg) Type() protoreflect.EnumType
type Slot ¶ added in v0.3.0
type Slot struct {
Label string `protobuf:"bytes,1,opt,name=label,proto3" json:"label,omitempty"`
// Time the slot passed to its current key, in milliseconds since the Unix epoch.
ClaimedAtMs uint64 `protobuf:"varint,2,opt,name=claimed_at_ms,json=claimedAtMs,proto3" json:"claimed_at_ms,omitempty"`
// Label of the slot before this claim, if another key held it. Empty if the slot was free or already held by this
// key.
ReplacedLabel string `protobuf:"bytes,3,opt,name=replaced_label,json=replacedLabel,proto3" json:"replaced_label,omitempty"`
// contains filtered or unexported fields
}
The owner's slot, in answer to `ClaimSlot` and `SetSlotLabel`.
func (*Slot) Descriptor
deprecated
added in
v0.3.0
func (*Slot) GetClaimedAtMs ¶ added in v0.3.0
func (*Slot) GetReplacedLabel ¶ added in v0.3.0
func (*Slot) ProtoMessage ¶ added in v0.3.0
func (*Slot) ProtoMessage()
func (*Slot) ProtoReflect ¶ added in v0.3.0
func (x *Slot) ProtoReflect() protoreflect.Message