config

package
v0.0.0-...-12a504c Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2019 License: MIT Imports: 4 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadConfig

func LoadConfig(cfg Configer) error

LoadConfig loads the .ini file in specific path

Types

type Config

type Config struct {
	Prefix string `json:"-"`
	Path   string `json:"-"`
}

Config representing basic config parameters

func (*Config) GetPath

func (cfg *Config) GetPath() string

GetPath returns the path of the .ini file

func (*Config) GetPrefix

func (cfg *Config) GetPrefix() string

GetPrefix returns the current config prefix value

func (*Config) SetPath

func (cfg *Config) SetPath(path string) error

SetPath sets the path of the .ini file

func (*Config) SetPrefix

func (cfg *Config) SetPrefix(prefix string) error

SetPrefix sets the config prefix value

type Configer

type Configer interface {
	GetPrefix() string
	SetPrefix(prefix string) error
	GetPath() string
	SetPath(path string) error
}

Configer represeting the config interface of .ini file

Jump to

Keyboard shortcuts

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