config

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

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

Go to latest
Published: May 30, 2018 License: BSD-3-Clause Imports: 4 Imported by: 3

README

config

base on toml's golang config library

Install config

go get github.com/forease/config

Import config

import "github.com/forease/config"

Use config

See config_test.go

About

北京实易时代科技有限公司
Beijing ForEase Times Technology Co., Ltd.
http://www.forease.net

Contact me

Jonsen Yang
im16hot#gmail.com (replace # with @)

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	ConfFile  string
	Version   string
	PathLevel int
	Item      map[string]interface{}
	// contains filtered or unexported fields
}

func NewConfig

func NewConfig(file string, level int) (*Config, error)

func (*Config) Array

func (c *Config) Array(key string) ([]interface{}, error)

func (*Config) Array2String

func (c *Config) Array2String(key, sep string) (string, error)

func (*Config) ArrayString

func (c *Config) ArrayString(key string) ([]string, error)

func (*Config) Bool

func (c *Config) Bool(key string, def bool) (bool, error)

func (*Config) Float64

func (c *Config) Float64(key string, def float64) (float64, error)

func (*Config) Int

func (c *Config) Int(key string, def int) (int, error)

func (*Config) Int64

func (c *Config) Int64(key string, def int64) (int64, error)

func (*Config) Map

func (c *Config) Map(key string) (map[string]interface{}, error)

func (*Config) ReloadConfig

func (c *Config) ReloadConfig() error

func (*Config) String

func (c *Config) String(key string, def string) (string, error)

Jump to

Keyboard shortcuts

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