Documentation ¶
Index ¶
- Constants
- Variables
- func ArrayToMap(array []string) map[int]string
- func ExtMatchType(ext string, configType int) bool
- func FileExists(file string) bool
- func GetBytes(key interface{}) ([]byte, error)
- func GetServerPath() string
- func GetTimeString() string
- func HandleError(err error)
- func IntToString(int int) string
- func InterfaceToInt(i interface{}) int
- func InterfaceToString(i interface{}) string
- func MapToArray(m map[int]string) []string
- func SetLogFile(path string)
- type Config
- func (c *Config) CheckDefault(key string, value interface{})
- func (c *Config) Config() Content
- func (c *Config) ConfigType() int
- func (c *Config) Exist(key string) bool
- func (c *Config) File() string
- func (c *Config) Get(key string) interface{}
- func (c *Config) Marshal() ([]byte, error)
- func (c *Config) Remove(key string)
- func (c *Config) Save()
- func (c *Config) Set(key string, value interface{})
- func (c *Config) SetConfig(config Content)
- func (c *Config) SetConfigType(configType int)
- func (c *Config) SetFile(file string)
- func (c *Config) Unmarshal() Content
- type Content
- type Logger
Constants ¶
View Source
const ( TypeJson = iota // .json TypeYaml // .yml & .yaml )
View Source
const ( Prefix = "[SpecterGO] " ErrorPrefix = "[Error] " DebugPrefix = "[Debug] " WarnPrefix = "[Warn] " FatalPrefix = "[Fatal] " NewLine = "\n" )
View Source
const (
DirectorySeparator = "/"
)
Variables ¶
View Source
var (
LogFile string
)
Functions ¶
func ArrayToMap ¶
func ExtMatchType ¶
func FileExists ¶
func GetServerPath ¶
func GetServerPath() string
func GetTimeString ¶
func GetTimeString() string
func HandleError ¶
func HandleError(err error)
func IntToString ¶
func InterfaceToInt ¶
func InterfaceToInt(i interface{}) int
func InterfaceToString ¶
func InterfaceToString(i interface{}) string
func MapToArray ¶
func SetLogFile ¶
func SetLogFile(path string)
Types ¶
type Config ¶
type Config struct {
// contains filtered or unexported fields
}
func (*Config) CheckDefault ¶
func (*Config) ConfigType ¶
func (*Config) SetConfigType ¶
Click to show internal directories.
Click to hide internal directories.