Versions in this module Expand all Collapse all v0 v0.0.2 Mar 6, 2018 v0.0.1 Feb 13, 2018 Changes in this version + var ErrInvalidTagSet = errors.New("an even number of tags must be specified") + func Selector(rp *ReadPref) func(c *model.Cluster, candidates []*model.Server) ([]*model.Server, error) + type Mode uint8 + const NearestMode + const PrimaryMode + const PrimaryPreferredMode + const SecondaryMode + const SecondaryPreferredMode + func ModeFromString(mode string) (Mode, error) + type Option func(*ReadPref) error + func WithMaxStaleness(ms time.Duration) Option + func WithTagSets(tagSets ...model.TagSet) Option + func WithTags(tags ...string) Option + type ReadPref struct + func Nearest(opts ...Option) *ReadPref + func New(mode Mode, opts ...Option) (*ReadPref, error) + func Primary() *ReadPref + func PrimaryPreferred(opts ...Option) *ReadPref + func Secondary(opts ...Option) *ReadPref + func SecondaryPreferred(opts ...Option) *ReadPref + func (r *ReadPref) MaxStaleness() (time.Duration, bool) + func (r *ReadPref) Mode() Mode + func (r *ReadPref) TagSets() []model.TagSet