configs

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2020 License: Apache-2.0 Imports: 10 Imported by: 1

README

configs


config 项目是用来读取及配置应用程序的配置文件的,目前支持yaml、yml、json、toml格式的配置文件。 个人的项目严格来说不是原创,是来至参考资料①的源码。感谢qianlnk

server:
  name: config.yaml
server:
  name: config.yml
{
  "server": {
    "name": "config.json"
  }
}
[server]
name="config.toml"

程序案例请查看demo

参考资料

Documentation

Overview

*

  • Project Name:configs
  • File Name:configs.go
  • Package Name:configs
  • Date:2019年07月16日 17:10
  • Function:
  • Copyright (c) 2019, Jason.Wang All Rights Reserved.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetConfigAbsolutePath

func GetConfigAbsolutePath(file string) string

获取配置文件的相对路径

func Parse

func Parse(cfg interface{}, file string) error

Types

type Error

type Error struct {
	Message string
}

func (*Error) Error

func (h *Error) Error() string

Directories

Path Synopsis
* * Project Name:configs * File Name:main.go * Package Name:example * Date:2019年07月16日 17:32 * Function: * Copyright (c) 2019, Jason.Wang All Rights Reserved.
* * Project Name:configs * File Name:main.go * Package Name:example * Date:2019年07月16日 17:32 * Function: * Copyright (c) 2019, Jason.Wang All Rights Reserved.

Jump to

Keyboard shortcuts

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