autocfg

package module
v0.0.0-...-3159351 Latest Latest
Warning

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

Go to latest
Published: Mar 20, 2019 License: MIT Imports: 7 Imported by: 0

README

autocfg

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GuessFileType

func GuessFileType(path string) string

func MarshalConfig

func MarshalConfig(c *Config, auto *AutoCFG) ([]byte, error)

func PathExists

func PathExists(path string) (bool, error)

func WriteFile

func WriteFile(cfgname string, c *Config, auto *AutoCFG) error

Types

type AutoCFG

type AutoCFG struct {
	Generate func() *Config
	Verify   func(*Config) error
}

type Config

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

func LoadConfig

func LoadConfig(cfgname string, auto *AutoCFG) (*Config, error)

func NewConfig

func NewConfig(datas ...map[interface{}]interface{}) *Config

func ReadFile

func ReadFile(cfgname string, auto *AutoCFG) (*Config, error)

func UnmarshalConfig

func UnmarshalConfig(buf []byte, auto *AutoCFG) (*Config, error)

func (*Config) Get

func (cfg *Config) Get(name string) interface{}

func (*Config) GetBool

func (cfg *Config) GetBool(name string) bool

func (*Config) GetFloat64

func (cfg *Config) GetFloat64(name string) float64

func (*Config) GetInt

func (cfg *Config) GetInt(name string) int

func (*Config) GetString

func (cfg *Config) GetString(name string) string

func (*Config) ToStringSlice

func (cfg *Config) ToStringSlice(name string) []string

Jump to

Keyboard shortcuts

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