config

package
v0.0.0-...-b284157 Latest Latest
Warning

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

Go to latest
Published: Oct 7, 2020 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func WriteConfig

func WriteConfig(x *Type, fpath string, fname string, isWindows bool) error

Write config file fname to fpath, also writes fname.gob with the Go Binary representation of the config Creates directories for config, dbPath and log destination

Types

type Type

type Type struct {
	Storage struct {
		DbPath     string
		Engine     string // default is "wiredTiger" vs "inMemory"
		WiredTiger struct {
			EngineConfig struct {
				CacheSizeGB float32
			}
		}
	}

	SystemLog struct {
		Destination     string // default is syslog if not specified, use "file"
		Path            string // required if Destination = "file"
		TimeStampFormat string // default is "iso8601-local" vs "iso8601-utc"
		LogAppend       bool   // default is false
		Verbosity       uint   // default is zero
	}

	Security struct {
		Authorization     string // default is "disabled" vs. "enabled"
		JavascriptEnabled bool   `default:"true"` // default is true
	}

	Net struct {
		Port             uint   // default: 27017, 27018 if shard member, 27019 if CSRS member
		BindIp           string // default is "127.0.0.1"
		Ipv6             bool   // default is false
		UnixDomainSocket struct {
			Enabled bool `default:"true" omitwindows:"true"` // default is true
		}
	}

	ProcessManagement struct {
		Fork bool `omitwindows:"true"`
	}

	SetParameter struct {
		AuthenticationMechanisms string // default ?
	}
}
var MongoDBDefaults *Type

Config struct with MongoDB defaults applied

var OurDefaults *Type

Config struct with our opinionated defaults enabled

func FromGoB

func FromGoB(in []byte) (*Type, error)

Read a GoB config in

func (*Type) ToGoB

func (c *Type) ToGoB() (*bytes.Buffer, error)

write out a config in GoB (Go Binary)

func (*Type) ToYaml

func (c *Type) ToYaml(isWindows bool) *bytes.Buffer

write out a config in YAML

Jump to

Keyboard shortcuts

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