util

package
v3.2.1+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 12, 2020 License: GPL-2.0 Imports: 8 Imported by: 5

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CannotGetQueryError     = errors.New("cannot get query field from the profile document (it is not a map)")
	ShardingNotEnabledError = errors.New("sharding not enabled")
)

Functions

func GetClientForHost

func GetClientForHost(co *options.ClientOptions, newHost string) (*mongo.Client, error)

GetClientForHost returns a new *mongo.Client using a copy of the original connection options where the host is being replaced by the newHost and the connection is set to be direct to the instance.

func GetHostnames

func GetHostnames(ctx context.Context, client *mongo.Client) ([]string, error)

func GetQueryField

func GetQueryField(doc proto.SystemProfile) (primitive.M, error)

func GetReplicasetMembers

func GetReplicasetMembers(ctx context.Context, clientOptions *options.ClientOptions) ([]proto.Members, error)

func GetServerStatus

func GetServerStatus(ctx context.Context, client *mongo.Client) (proto.ServerStatus, error)

GetServerStatus returns the server status by running serverStatus and recordStats

func GetShardedHosts

func GetShardedHosts(ctx context.Context, client *mongo.Client) ([]string, error)

GetShardedHosts is like GetHostnames but it uses listShards instead of getShardMap so it won't include config servers in the returned list

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL