Documentation ¶
Index ¶
Constants ¶
const UUIDSubtype byte = 4
UUIDSubtype is the BSON binary subtype that a UUID should be encoded as
Variables ¶
var ErrSessionEnded = errors.New("ended session was used")
ErrSessionEnded is returned when a client session is used after a call to endSession().
Functions ¶
Types ¶
type Client ¶
type Client struct { ClientID uuid.UUID ClusterTime *bson.Document SessionID *bson.Document SessionType Type Terminated bool // contains filtered or unexported fields }
Client is a session for clients to run commands.
func NewClientSession ¶
NewClientSession creates a Client.
func (*Client) AdvanceClusterTime ¶
AdvanceClusterTime updates the session's cluster time.
func (*Client) UpdateUseTime ¶
UpdateUseTime updates the session's last used time. Must be called whenver this session is used to send a command to the server.
type ClusterClock ¶
type ClusterClock struct {
// contains filtered or unexported fields
}
ClusterClock represents a logical clock for keeping track of cluster time.
func (*ClusterClock) AdvanceClusterTime ¶
func (cc *ClusterClock) AdvanceClusterTime(clusterTime *bson.Document)
AdvanceClusterTime updates the cluster's current time.
func (*ClusterClock) GetClusterTime ¶
func (cc *ClusterClock) GetClusterTime() *bson.Document
GetClusterTime returns the cluster's current time.
type Node ¶
type Node struct { *Server // contains filtered or unexported fields }
Node represents a server session in a linked list
type Pool ¶
type Pool struct {
// contains filtered or unexported fields
}
Pool is a pool of server sessions that can be reused.
func NewPool ¶
func NewPool(descChan <-chan description.Topology) *Pool
NewPool creates a new server session pool
func (*Pool) CheckedOut ¶
CheckedOut returns number of sessions checked out from pool.
func (*Pool) GetSession ¶
GetSession retrieves an unexpired session from the pool.
func (*Pool) ReturnSession ¶
ReturnSession returns a session to the pool if it has not expired.