utils

package
v0.3.2 Latest Latest
Warning

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

Go to latest
Published: Jun 10, 2018 License: Apache-2.0 Imports: 11 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 ParseCmdArguments added in v0.2.2

func ParseCmdArguments(s string) (arguments []string)

func RandString added in v0.2.1

func RandString(length int, characters ...byte) string

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