package sessionopt
import "go.mongodb.org/mongo-driver/mongo/sessionopt"
Index ¶
- type OptCausalConsistency
- func CausalConsistency(b bool) OptCausalConsistency
- func (opt OptCausalConsistency) ConvertSessionOption() session.ClientOptioner
- type OptDefaultReadConcern
- func DefaultReadConcern(rc *readconcern.ReadConcern) OptDefaultReadConcern
- func (opt OptDefaultReadConcern) ConvertSessionOption() session.ClientOptioner
- type OptDefaultReadPreference
- func DefaultReadPreference(rp *readpref.ReadPref) OptDefaultReadPreference
- func (opt OptDefaultReadPreference) ConvertSessionOption() session.ClientOptioner
- type OptDefaultWriteConcern
- func DefaultWriteConcern(wc *writeconcern.WriteConcern) OptDefaultWriteConcern
- func (opt OptDefaultWriteConcern) ConvertSessionOption() session.ClientOptioner
- type Session
- type SessionBundle
- func BundleSession(opts ...Session) *SessionBundle
- func (sb *SessionBundle) CausalConsistency(b bool) *SessionBundle
- func (sb *SessionBundle) ConvertSessionOption() session.ClientOptioner
- func (sb *SessionBundle) DefaultReadConcern(rc *readconcern.ReadConcern) *SessionBundle
- func (sb *SessionBundle) DefaultReadPreference(rp *readpref.ReadPref) *SessionBundle
- func (sb *SessionBundle) DefaultWriteConcern(wc *writeconcern.WriteConcern) *SessionBundle
- func (sb *SessionBundle) Unbundle(deduplicate bool) ([]session.ClientOptioner, error)
Types ¶
type OptCausalConsistency ¶
type OptCausalConsistency session.OptCausalConsistency
OptCausalConsistency specifies if a client session should be causally consistent.
func CausalConsistency ¶
func CausalConsistency(b bool) OptCausalConsistency
CausalConsistency specifies if a client session should be causally consistent. Causally consistent reads are not causally consistent with unacknowledged writes.
func (OptCausalConsistency) ConvertSessionOption ¶
func (opt OptCausalConsistency) ConvertSessionOption() session.ClientOptioner
ConvertSessionOption implements the Session interface.
type OptDefaultReadConcern ¶
type OptDefaultReadConcern session.OptDefaultReadConcern
OptDefaultReadConcern specifies the default read concern for transactions started from this session.
func DefaultReadConcern ¶
func DefaultReadConcern(rc *readconcern.ReadConcern) OptDefaultReadConcern
DefaultReadConcern specifies the default read concern for transactions started from this session.
func (OptDefaultReadConcern) ConvertSessionOption ¶
func (opt OptDefaultReadConcern) ConvertSessionOption() session.ClientOptioner
ConvertSessionOption implements the Session interface.
type OptDefaultReadPreference ¶
type OptDefaultReadPreference session.OptDefaultReadPreference
OptDefaultReadPreference specifies the default read preference for transactions started from this session.
func DefaultReadPreference ¶
func DefaultReadPreference(rp *readpref.ReadPref) OptDefaultReadPreference
DefaultReadPreference specifies the default read preference for transactions started from this session.
func (OptDefaultReadPreference) ConvertSessionOption ¶
func (opt OptDefaultReadPreference) ConvertSessionOption() session.ClientOptioner
ConvertSessionOption implements the Session interface.
type OptDefaultWriteConcern ¶
type OptDefaultWriteConcern session.OptDefaultWriteConcern
OptDefaultWriteConcern specifies the default write concern for transactions started from this session.
func DefaultWriteConcern ¶
func DefaultWriteConcern(wc *writeconcern.WriteConcern) OptDefaultWriteConcern
DefaultWriteConcern specifies the default write concern for transactions started from this session.
func (OptDefaultWriteConcern) ConvertSessionOption ¶
func (opt OptDefaultWriteConcern) ConvertSessionOption() session.ClientOptioner
ConvertSessionOption implements the Session interface.
type Session ¶
type Session interface { ConvertSessionOption() session.ClientOptioner // contains filtered or unexported methods }
Session represents options for creating client sessions.
type SessionBundle ¶
type SessionBundle struct {
// contains filtered or unexported fields
}
SessionBundle bundles session options
func BundleSession ¶
func BundleSession(opts ...Session) *SessionBundle
BundleSession bundles session options
func (*SessionBundle) CausalConsistency ¶
func (sb *SessionBundle) CausalConsistency(b bool) *SessionBundle
CausalConsistency specifies if a session should be causally consistent. Defaults to true. Causally consistent reads are not causally consistent with unacknowledged writes.
func (*SessionBundle) ConvertSessionOption ¶
func (sb *SessionBundle) ConvertSessionOption() session.ClientOptioner
ConvertSessionOption implements the Session interface
func (*SessionBundle) DefaultReadConcern ¶
func (sb *SessionBundle) DefaultReadConcern(rc *readconcern.ReadConcern) *SessionBundle
DefaultReadConcern specifies the default read concern for transactions started from this session.
func (*SessionBundle) DefaultReadPreference ¶
func (sb *SessionBundle) DefaultReadPreference(rp *readpref.ReadPref) *SessionBundle
DefaultReadPreference specifies the default read preference for transactions started from this session.
func (*SessionBundle) DefaultWriteConcern ¶
func (sb *SessionBundle) DefaultWriteConcern(wc *writeconcern.WriteConcern) *SessionBundle
DefaultWriteConcern specifies the default write concern for transactions started from this session.
func (*SessionBundle) Unbundle ¶
func (sb *SessionBundle) Unbundle(deduplicate bool) ([]session.ClientOptioner, error)
Unbundle transforms a bundle into a slice of options, optionally deduplicating.
Source Files ¶
sessionopt.go
- Version
- v0.0.17
- Published
- Oct 25, 2018
- Platform
- linux/amd64
- Imports
- 5 packages
- Last checked
- 2 minutes ago –
Tools for package owners.