config

package
v0.0.0-...-ff68fb7 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2021 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

type Auth struct {
	Type     string `json:"type,omitempty" yaml:"type,omitempty"`
	LdapHost string `json:"ldap_host,omitempty" yaml:"ldap_host,omitempty"`
	LdapPort int    `json:"ldap_port,omitempty" yaml:"ldap_port,omitempty"`
	LdapDn   string `json:"ldap_dn,omitempty" yaml:"ldap_dn,omitempty"`
}

type Badger

type Badger struct {
	Path         string `json:"path,omitempty"`
	MaxTableSize int64  `json:"max_table_size,omitempty"`
	NumTables    int    `json:"num_tables,omitempty"`
}

type Config

type Config struct {
	Server *Server `json:"server,omitempty" yaml:"server,omitempty"`
}

Config is the root config

func ParseConfig

func ParseConfig(configFilePath string) (*Config, error)

ParseConfig parses a file path and returns a config

If the file is remote, it is downloaded via HTTP (proxy settings are respected) If file is local, is it opened in readonly mode.

type Persistence

type Persistence struct {
	Type string `json:"type" yaml:"type"`

	Badger *Badger `json:"badger" yaml:"badger"`
	Redis  *Redis  `json:"redis" yaml:"redis"`
}

type Redis

type Redis struct {
	Url      string `json:"url" yaml:"url"`
	Password string `json:"password" yaml:"password"`
}

type Server

type Server struct {
	Tls         *Tls         `json:"tls" yaml:"tls"`
	TcpAddress  string       `json:"tcp,omitempty" yaml:"tcp,omitempty"`
	HttpAddress string       `json:"http,omitempty" yaml:"http,omitempty"`
	MaxQos      byte         `json:"max_qos,omitempty" yaml:"max_qos,omitempty"`
	Auth        *Auth        `json:"auth,omitempty" yaml:"auth,omitempty"`
	Persistence *Persistence `json:"persistence,omitempty" yaml:"persistence,omitempty"`
}

Server stores all server related configuration

type Tls

type Tls struct {
	CertFile string `json:"cert,omitempty" yaml:"cert,omitempty"`
	KeyFile  string `json:"key,omitempty" yaml:"key,omitempty"`
}

Tls stores the TLS config for the server

Jump to

Keyboard shortcuts

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