conf

package
v1.5.5 Latest Latest
Warning

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

Go to latest
Published: Jul 13, 2021 License: GPL-3.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DefaultConfigFilename

func DefaultConfigFilename() (string, error)

Default location of the config file on the user's system.

func DefaultLogFilename

func DefaultLogFilename(logName string) (string, error)

Default location of a log file on the user's system.

func NewLogger

func NewLogger(hostType string, cfg *Config) *zap.Logger

func ReadConfig

func ReadConfig(filename string, cfg *Config) error

ReadConfig reads the given config file into the Config data structure.

func WriteDefaultConfig

func WriteDefaultConfig(filename string) error

Writes a default config if one does not exist already. It will also create any necessary nested parent directories.

Types

type AliasEntry

type AliasEntry struct {
	Username string `mapstructure:"username"`
	Hostname string `mapstructure:"hostname"`
	RedisURI string `mapstructure:"redisuri"`
}

Represents a unique alias identifying a user remotely accessible through drsh.

type Config

type Config struct {
	Server struct {
		LogFile  string `mapstructure:"logfile"`
		Hostname string `mapstructure:"hostname"`
		RedisURI string `mapstructure:"redisuri"`
	} `mapstructure:"server"`
	Client struct {
		LogFile string                `mapstructure:"logfile"`
		Aliases map[string]AliasEntry `mapstructure:"aliases"`
	} `mapstructure:"client"`
}

Mapped directly by viper on to a config file.

Jump to

Keyboard shortcuts

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