configuration

package
v0.0.0-...-53a2e65 Latest Latest
Warning

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

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

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Mongo  MongoConf  `json:"mongodb"`
	Server ServerConf `json:"server"`
}

func NewConfiguration

func NewConfiguration() *Configuration

func (*Configuration) Read

func (c *Configuration) Read() error

type MongoCompressorsConf

type MongoCompressorsConf struct {
	Snappy bool `json:"snappy"`
	Zlib   bool `json:"zlib"`
	Zstd   bool `json:"zstd"`
}

type MongoConf

type MongoConf struct {
	ClientID                 string                  `json:"clientId"`
	Uri                      string                  `json:"uri"`
	Database                 string                  `json:"database"`
	Username                 string                  `json:"username"`
	Password                 string                  `json:"password"`
	TimeoutMS                int                     `json:"timeoutMS"`
	ConnectTimeoutMS         int                     `json:"connectTimeoutMS"`
	MaxPoolSize              int                     `json:"maxPoolSize"`
	ReplicaSet               string                  `json:"replicaSet"`
	MaxIdleTimeMS            int                     `json:"maxIdleTimeMS"`
	MinPoolSize              int                     `json:"minPoolSize"`
	SocketTimeoutMS          int                     `json:"socketTimeoutMS"`
	ServerSelectionTimeoutMS int                     `json:"serverSelectionTimeoutMS"`
	HeartbeatFrequencyMS     int                     `json:"heartbeatFrequencyMS"`
	Tls                      TLSConf                 `json:"tls"`
	Compressors              MongoCompressorsConf    `json:"compressors"`
	WriteConcern             MongoWriteConcernConf   `json:"writeConcern"`
	ReadPreference           MongoReadPreferenceConf `json:"readPreference"`
	DirectConnection         bool                    `json:"directConnection"`
}

type MongoReadPreferenceConf

type MongoReadPreferenceConf struct {
	ReadPreference string `json:"readPreference"`
}

type MongoWriteConcernConf

type MongoWriteConcernConf struct {
	W          int  `json:"w"`
	WTimeoutMS int  `json:"wTimeoutMS"`
	Journal    bool `json:"journal"`
}

type ServerConf

type ServerConf struct {
	Address string `json:"address"`
	Port    int    `json:"port"`
	JwtKey  string `json:"jwtKey"`
}

type TLSConf

type TLSConf struct {
	Use  bool   `json:"use"`
	Root string `json:"root"`
	Crt  string `json:"ctr"`
	Key  string `json:"key"`
}

Jump to

Keyboard shortcuts

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