Versions in this module Expand all Collapse all v1 v1.4.1 Sep 27, 2020 Changes in this version + const Unknown + const UnsetRTT + func MaxStalenessSupported(wireVersion *VersionRange) error + func ScramSHA1Supported(wireVersion *VersionRange) error + func SessionsSupported(wireVersion *VersionRange) bool + type HostlistDiff struct + Added []string + Removed []string + type SelectedServer struct + Kind TopologyKind + type Server struct + Addr address.Address + AverageRTT time.Duration + AverageRTTSet bool + CanonicalAddr address.Address + Compression []string + ElectionID primitive.ObjectID + HeartbeatInterval time.Duration + Kind ServerKind + LastError error + LastUpdateTime time.Time + LastWriteTime time.Time + MaxBatchCount uint32 + MaxDocumentSize uint32 + MaxMessageSize uint32 + Members []address.Address + ReadOnly bool + SaslSupportedMechs []string + SessionTimeoutMinutes uint32 + SetName string + SetVersion uint32 + Tags tag.Set + WireVersion *VersionRange + func NewServer(addr address.Address, response bsoncore.Document) Server + func (s Server) DataBearing() bool + func (s Server) SelectServer(_ Topology, candidates []Server) ([]Server, error) + func (s Server) SetAverageRTT(rtt time.Duration) Server + type ServerKind uint32 + const Mongos + const RSArbiter + const RSGhost + const RSMember + const RSPrimary + const RSSecondary + const Standalone + func (kind ServerKind) String() string + type ServerSelector interface + SelectServer func(Topology, []Server) ([]Server, error) + func CompositeSelector(selectors []ServerSelector) ServerSelector + func LatencySelector(latency time.Duration) ServerSelector + func ReadPrefSelector(rp *readpref.ReadPref) ServerSelector + func WriteSelector() ServerSelector + type ServerSelectorFunc func(Topology, []Server) ([]Server, error) + func (ssf ServerSelectorFunc) SelectServer(t Topology, s []Server) ([]Server, error) + type Topology struct + Kind TopologyKind + Servers []Server + SessionTimeoutMinutes uint32 + func (t Topology) DiffHostlist(hostlist []string) HostlistDiff + func (t Topology) Server(addr address.Address) (Server, bool) + type TopologyDiff struct + Added []Server + Removed []Server + func DiffTopology(old, new Topology) TopologyDiff + type TopologyKind uint32 + const ReplicaSet + const ReplicaSetNoPrimary + const ReplicaSetWithPrimary + const Sharded + const Single + func (kind TopologyKind) String() string + type Version struct + Desc string + Parts []uint8 + func (v Version) AtLeast(other ...uint8) bool + func (v Version) String() string + type VersionRange struct + Max int32 + Min int32 + func NewVersionRange(min, max int32) VersionRange + func (vr VersionRange) Includes(v int32) bool + func (vr VersionRange) String() string