config

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Jun 5, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	RequestLengthLimit: 1024,
}

DefaultConfig is a base default config

Functions

This section is empty.

Types

type Config

type Config struct {
	BindAddr    string         `bson:"bindAddr"`
	Plugins     []PluginConfig `bson:"plugins"`
	Compressors []string       `bson:"compressors"`
	// IdleCursorTimeoutMillis
	IdleCursorTimeoutMillis *string `bson:"idleCursorTimeoutMillis"`
	IdleCursorTimeout       time.Duration

	InternalIdentity *plugins.StaticIdentity `bson:"internalIdentity"`

	RequestLengthLimit int `bson:"requestLengthLimit"`
}

Config is the configuration struct for mongoproxy

func ConfigFromFile

func ConfigFromFile(path string) (*Config, error)

ConfigFromFile loads a config (based on DefaultConfig) from the given path

func (*Config) GetPlugins

func (c *Config) GetPlugins() ([]plugins.Plugin, error)

GetPlugins returns a list of plugin instances for the given config

func (*Config) Load

func (c *Config) Load() error

Load will load all configuration

type PluginConfig

type PluginConfig struct {
	Name   string `bson:"name"`
	Config bson.D `bson:"config"`
}

Jump to

Keyboard shortcuts

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