Documentation
¶
Index ¶
Constants ¶
const ( // DBFilename is the default filename of the session database. DBFilename = "session.db" // DefaultSessionDBTimeout is the default maximum time we wait for the // session bbolt database to be opened. If the database is already // opened by another process, the unique lock cannot be obtained. With // the timeout we error out after the given time instead of just // blocking for forever. DefaultSessionDBTimeout = 5 * time.Second )
const Subsystem = "SESS"
Variables ¶
var ( // ErrDBReversion is returned when detecting an attempt to revert to a // prior database version. ErrDBReversion = errors.New("cannot revert to prior version") )
var ( // ErrSessionNotFound is an error returned when we attempt to retrieve // information about a session but it is not found. ErrSessionNotFound = errors.New("session not found") )
Functions ¶
func SerializeSession ¶
SerializeSession binary serializes the given session to the writer using the tlv format.
Types ¶
type DB ¶
DB is a bolt-backed persistent store.
func (*DB) ListSessions ¶
ListSessions returns all sessions currently known to the store.
func (*DB) RevokeSession ¶
RevokeSession updates the state of the session with the given local public key to be revoked.
func (*DB) StoreSession ¶
StoreSession stores a session in the store. If a session with the same local public key already exists, the existing record is updated/ overwritten instead.
type GRPCServerCreator ¶
type GRPCServerCreator func(opts ...grpc.ServerOption) *grpc.Server
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func NewServer ¶
func NewServer(serverCreator GRPCServerCreator) *Server
func (*Server) StartSession ¶
type Session ¶
type Session struct { Label string State State Type Type Expiry time.Time ServerAddr string DevServer bool MacaroonRootKey uint64 Macaroon *macaroon.Macaroon PairingSecret [mailbox.NumPasswordBytes]byte LocalPrivateKey *btcec.PrivateKey LocalPublicKey *btcec.PublicKey RemotePublicKey *btcec.PublicKey }
Session is a struct representing a long-term Terminal Connect session.
func DeserializeSession ¶
DeserializeSession deserializes a session from the given reader, expecting the data to be encoded in the tlv format.
type Store ¶
type Store interface { // StoreSession stores a session in the store. If a session with the // same local public key already exists, the existing record is updated/ // overwritten instead. StoreSession(*Session) error // ListSessions returns all sessions currently known to the store. ListSessions() ([]*Session, error) // RevokeSession updates the state of the session with the given local // public key to be revoked. RevokeSession(*btcec.PublicKey) error }
Store is the interface a persistent storage must implement for storing and retrieving Terminal Connect sessions.