gconfig

package
v0.0.0-...-04ff805 Latest Latest
Warning

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

Go to latest
Published: May 22, 2022 License: MIT Imports: 12 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func NewClient

func NewClient(customConfigDir string) (*Client, error)

NewClient creates new config client.

func (*Client) ConfigDir

func (c *Client) ConfigDir() string

func (*Client) ConfigFileExists

func (c *Client) ConfigFileExists(configFileName string) bool

ConfigFileExists returns true if config file exists. configFileName is config file short name with suffix, for example `myapp.json`.

func (*Client) ConfigFilePath

func (c *Client) ConfigFilePath(configFileName string) string

ConfigFilePath returns config file full path.

func (*Client) Load

func (c *Client) Load(configFileName string, v interface{}, allowEmpty bool) error

Load loads config and Unmarshal it into `v`. configFileName is config file short name with suffix, for example `myapp.json`.

func (*Client) LoadAndStore

func (c *Client) LoadAndStore(configFileName string, v interface{}, allowEmpty bool) error

LoadAndStore loads config from config file first, then encrypt and store config to disk. configFileName is config file short name with suffix, for example `myapp.json`.

func (*Client) SetPassword

func (c *Client) SetPassword(password, salt string)

SetPassword sets password for config.

func (*Client) Store

func (c *Client) Store(configFileName string, v interface{}) error

Store writes config content `v` into file `configFileName`. configFileName is config file short name with suffix, for example `myapp.json`.

type MgrCenter

type MgrCenter struct {
}

func NewConfigCenter

func NewConfigCenter() (*MgrCenter, error)

Jump to

Keyboard shortcuts

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