utils

package
v0.1.2 Latest Latest
Warning

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

Go to latest
Published: Jun 14, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Overview

加载json(可配置扩展字段)配置文件

{ "Debug": true, "Log": "@extend:./log.json" }

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func LoadExtendConf

func LoadExtendConf(filePath string, v interface{}) error

加载json(可配置扩展字段)配置文件

func LocalIP

func LocalIP() (net.IP, error)

获取本机 ip 获取第一个非 loopback ip

func SetExtendTag

func SetExtendTag(tag string)

设置扩展标识,如果不设置,默认为 '@extend:'

func SetPathTag

func SetPathTag(tag string)

设置当前路径标识,如果不设置,默认为 '@pwd@' @pwd@ 会被替换成当前文件的路径, 至于是绝对路径还是相对路径,取决于读取文件时,传入的是绝对路径还是相对路径

func SetRoot

func SetRoot(r string)

Types

This section is empty.

Jump to

Keyboard shortcuts

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