config

package
v0.0.2 Latest Latest
Warning

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

Go to latest
Published: Aug 6, 2019 License: MPL-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type EngineConfig

type EngineConfig struct {
	CacheSizeGB float64 `yaml:"cacheSizeGB,omitempty"`
}

EngineConfig Wired Tiger engine configuration params

type Journal

type Journal struct {
	Enabled bool `yaml:"enabled,omitempty"`
}

Journal MongoDB configuration for storage.journal parameters

type MongoDB

type MongoDB struct {
	Net               *Net               `yaml:"net,omitempty"`
	ProcessManagement *ProcessManagement `yaml:"processManagement,omitempty"`
	Replication       *Replication       `yaml:"replication,omitempty"`
	SetParameter      map[string]string  `yaml:"setParameter,omitempty"`
	Storage           *Storage           `yaml:"storage,omitempty"`
	SystemLog         *SystemLog         `yaml:"systemLog,omitempty"`
}

MongoDB MongoDB configuration file struct (https://docs.mongodb.com/manual/reference/configuration-options/)

func LoadFromFile

func LoadFromFile(path string) (*MongoDB, error)

LoadFromFile loads a MongoDB config from the specified file

func LoadFromString

func LoadFromString(data string) (*MongoDB, error)

LoadFromString loads a MongoDB config from the specified string

func NewMongoDBConfig

func NewMongoDBConfig() *MongoDB

NewMongoDBConfig Construct a new MongoDB configuration struct

func (*MongoDB) SaveToTempFile

func (mdb *MongoDB) SaveToTempFile(path string) (*os.File, error)

SaveToTempFile saves the MongoDB config to a temporary file and returns an open file pointer

type Net

type Net struct {
	BindIP string `yaml:"bindIp"`
	Port   int    `yaml:"port"`
}

Net MongoDB configuration for network parameters

type ProcessManagement

type ProcessManagement struct {
	Fork bool `yaml:"fork"`
}

ProcessManagement MongoDB configuration for how the process is managed

type Replication

type Replication struct {
	EnableMajorityReadConcern bool   `yaml:"enableMajorityReadConcern,omitempty"`
	LocalPingThresholdMs      int    `yaml:"localPingThresholdMs,omitempty"`
	OplogSizeMB               int    `yaml:"oplogSizeMb,omitempty"`
	ReplSetName               string `yaml:"replSetName,omitempty"`
	SecondaryIndexPrefetch    string `yaml:"secondaryIndexPrefetch,omitempty"`
}

Replication MongoDB configuration for replication options

type Storage

type Storage struct {
	DBPath     string      `yaml:"dbPath"`
	Engine     string      `yaml:"engine"`
	Journal    *Journal    `yaml:"journal"`
	WiredTiger *WiredTiger `yaml:"wiredTiger"`
}

Storage MongoDB configuration for storage parameters

type SystemLog

type SystemLog struct {
	Destination string `yaml:"destination,omitempty"`
	Path        string `yaml:"path"`
	LogAppend   bool   `yaml:"logAppend"`
}

SystemLog MongoDB configuration for logging

type WiredTiger

type WiredTiger struct {
	EngineConfig *EngineConfig `yaml:"engineConfig,omitempty"`
}

WiredTiger Wired Tiger configuration params

Jump to

Keyboard shortcuts

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