config

package
v1.9.1 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2023 License: GPL-3.0 Imports: 22 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AddSearchPath

func AddSearchPath(path string) error

AddSearchPath adds a path to the list of folders scanned in order to search the config file. When opening the config file paths are scanned the order they are added

func Get

func Get(key string) interface{}

Get returns a value from the current config

func GetStruct

func GetStruct(key string, output interface{}, hooks ...mapstructure.DecodeHookFunc) error

GetStruct populates data of the given struct with config file content

func ParseConfig

func ParseConfig() error

ParseConfig reads the config file

func Set

func Set(key string, value interface{}) error

Set sets or modifies a value in the config file.

func SetConfigFileName

func SetConfigFileName(name string)

SetConfigFileName sets the configuration file name. The default value is "config"

func Sync

func Sync() error

Sync writes the config back to file

func TLSConfig added in v1.5.0

func TLSConfig(ctx context.Context, token string) (*tls.Config, error)

Types

type FileNotFoundError

type FileNotFoundError struct {
}

FileNotFoundError defines a config file not found

func (*FileNotFoundError) Error

func (*FileNotFoundError) Error() string

Jump to

Keyboard shortcuts

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