Versions in this module Expand all Collapse all v1 v1.4.1 Sep 27, 2020 Changes in this version + const Aborted + const Committed + const InProgress + const None + const Starting + const UUIDSubtype + var ErrAbortAfterCommit = errors.New("cannot call abortTransaction after calling commitTransaction") + var ErrAbortTwice = errors.New("cannot call abortTransaction twice") + var ErrCommitAfterAbort = errors.New("cannot call commitTransaction after calling abortTransaction") + var ErrNoTransactStarted = errors.New("no transaction started") + var ErrSessionEnded = errors.New("ended session was used") + var ErrTransactInProgress = errors.New("transaction already in progress") + var ErrUnackWCUnsupported = errors.New("transactions do not support unacknowledged write concerns") + func MaxClusterTime(ct1, ct2 bson.Raw) bson.Raw + type Client struct + Aborting bool + ClientID uuid.UUID + ClusterTime bson.Raw + Committing bool + Consistent bool + CurrentMct *time.Duration + CurrentRc *readconcern.ReadConcern + CurrentRp *readpref.ReadPref + CurrentWc *writeconcern.WriteConcern + OperationTime *primitive.Timestamp + PinnedServer *description.Server + RecoveryToken bson.Raw + RetryRead bool + RetryWrite bool + RetryingCommit bool + SessionType Type + Terminated bool + func NewClientSession(pool *Pool, clientID uuid.UUID, sessionType Type, opts ...*ClientOptions) (*Client, error) + func (c *Client) AbortTransaction() error + func (c *Client) AdvanceClusterTime(clusterTime bson.Raw) error + func (c *Client) AdvanceOperationTime(opTime *primitive.Timestamp) error + func (c *Client) ApplyCommand(desc description.Server) + func (c *Client) CheckAbortTransaction() error + func (c *Client) CheckCommitTransaction() error + func (c *Client) CheckStartTransaction() error + func (c *Client) ClearPinnedServer() + func (c *Client) CommitTransaction() error + func (c *Client) EndSession() + func (c *Client) GetState() uint8 + func (c *Client) SetState(s uint8) + func (c *Client) StartTransaction(opts *TransactionOptions) error + func (c *Client) TransactionCommitted() bool + func (c *Client) TransactionInProgress() bool + func (c *Client) TransactionRunning() bool + func (c *Client) TransactionStarting() bool + func (c *Client) UpdateCommitTransactionWriteConcern() + func (c *Client) UpdateRecoveryToken(response bson.Raw) + func (c *Client) UpdateUseTime() error + type ClientOptions struct + CausalConsistency *bool + DefaultMaxCommitTime *time.Duration + DefaultReadConcern *readconcern.ReadConcern + DefaultReadPreference *readpref.ReadPref + DefaultWriteConcern *writeconcern.WriteConcern + type ClusterClock struct + func (cc *ClusterClock) AdvanceClusterTime(clusterTime bson.Raw) + func (cc *ClusterClock) GetClusterTime() bson.Raw + type Node struct + type Pool struct + func NewPool(descChan <-chan description.Topology) *Pool + func (p *Pool) CheckedOut() int + func (p *Pool) GetSession() (*Server, error) + func (p *Pool) IDSlice() []bsonx.Doc + func (p *Pool) ReturnSession(ss *Server) + func (p *Pool) String() string + type Server struct + Dirty bool + LastUsed time.Time + SessionID bsonx.Doc + TxnNumber int64 + func (ss *Server) IncrementTxnNumber() + func (ss *Server) MarkDirty() + type TransactionOptions struct + MaxCommitTime *time.Duration + ReadConcern *readconcern.ReadConcern + ReadPreference *readpref.ReadPref + WriteConcern *writeconcern.WriteConcern + type Type uint8 + const Explicit + const Implicit