Documentation ¶
Index ¶
Constants ¶
const SessionIDSize = 33
SessionIDSize is 33-bytes; it is a serialized, compressed public key.
Variables ¶
var ( // ErrUninitializedDB signals that top-level buckets for the database // have not been initialized. ErrUninitializedDB = errors.New("db not initialized") )
Functions ¶
func MigrateCompleteTowerToSessionIndex ¶
MigrateCompleteTowerToSessionIndex ensures that the tower-to-session index contains entries for all towers in the db. This is necessary because migration1 only created entries in the index for towers that the client had at least one session with. This migration thus makes sure that there is always a tower-to-sessions index entry for a tower even if there are no sessions with that tower.
Types ¶
type SessionID ¶
type SessionID [SessionIDSize]byte
SessionID is created from the remote public key of a client, and serves as a unique identifier and authentication for sending state updates.
type TowerID ¶
type TowerID uint64
TowerID is a unique 64-bit identifier allocated to each unique watchtower. This allows the client to conserve on-disk space by not needing to always reference towers by their pubkey.
func TowerIDFromBytes ¶
TowerIDFromBytes constructs a TowerID from the provided byte slice. The argument must have at least 8 bytes, and should contain the TowerID in big-endian byte order.