mdbutils

package module
v0.0.3-0...-d79a22f Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2020 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TypeIsDBGrid    = "isdbgrid"
	TypeMongos      = "mongos"
	TypeMongod      = "mongod"
	TypeShardServer = "shardsvr"
)

Variables

View Source
var (
	ErrCannotGetProcess   = fmt.Errorf("cannot get process")
	ErrCannotGetClusterID = fmt.Errorf("cannot get cluster ID")
	ErrNotYetInitialized  = int32(94)
)

Functions

func ClusterID

func ClusterID(ctx context.Context, client *mongo.Client) (string, error)

func MyState

func MyState(ctx context.Context, client *mongo.Client) (int, error)

func ReplicasetConfig

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

Types

type HostInfo

type HostInfo struct {
	Hostname          string
	HostOsType        string
	HostSystemCPUArch string
	HostDatabases     int
	HostCollections   int
	DBPath            string

	ProcPath         string
	ProcUserName     string
	ProcCreateTime   time.Time
	ProcProcessCount int

	// Server Status
	ProcessName    string
	ReplicasetName string
	Version        string
	NodeType       string
}

func GetHostInfo

func GetHostInfo(ctx context.Context, client *mongo.Client) (*HostInfo, error)

type ProcInfo

type ProcInfo struct {
	CreateTime time.Time
	Path       string
	UserName   string
	Error      error
}

Directories

Path Synopsis
internal
tu
Package tu has Test Util functions
Package tu has Test Util functions

Jump to

Keyboard shortcuts

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