util

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Nov 16, 2018 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Log for localhsot

Functions

func AppendIfMissing

func AppendIfMissing(slice []string, s string) []string

AppendIfMissing append to the slice if missing

func Distinct added in v0.4.0

func Distinct(ss []string) (distincted []string)

Distinct a slice

func GenWorkers

func GenWorkers(num int) chan<- func()

GenWorkers generates goroutine http://qiita.com/na-o-ys/items/65373132b1c5bc973cca

func GetDefaultLogDir added in v0.3.0

func GetDefaultLogDir() string

GetDefaultLogDir returns default log directory

func NewCustomLogger

func NewCustomLogger(c config.ServerInfo) *logrus.Entry

NewCustomLogger creates logrus

func PrependProxyEnv

func PrependProxyEnv(cmd string) string

PrependProxyEnv prepends proxy environment variable

func ProxyEnv

func ProxyEnv() string

ProxyEnv returns shell environment variables to set proxy

func Truncate added in v0.1.6

func Truncate(str string, length int) string

Truncate truncates string to the length

func URLPathJoin

func URLPathJoin(baseURL string, paths ...string) (string, error)

URLPathJoin make URL

func URLPathParamJoin

func URLPathParamJoin(baseURL string, paths []string, params map[string]string) (string, error)

URLPathParamJoin make URL

Types

This section is empty.

Jump to

Keyboard shortcuts

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