util

package
v0.0.0-...-57214d0 Latest Latest
Warning

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

Go to latest
Published: Nov 2, 2015 License: Apache-2.0 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Compute

func Compute(input string) string

func Cover

func Cover(s, converV string, length int) string

cover 字符串补长度

func GetClientIP

func GetClientIP(req *http.Request) string

func GetIP

func GetIP() string

func GetImageSizeDistribution

func GetImageSizeDistribution(size int) string

func GetPartitionKey

func GetPartitionKey(t time.Time) int16

func GetRunningEnv

func GetRunningEnv() string

get running environment from environment variable 'NEPHELE_ENV' only support env 'uat' and 'prod'

func GetStatus

func GetStatus() map[string]string

func InitCat

func InitCat()

initial cat based on env

func JoinString

func JoinString(args ...string) string

func LogErrorEvent

func LogErrorEvent(cat cat.Cat, name string, err string)

func LogEvent

func LogEvent(cat cat.Cat, title string, name string, data map[string]string)

func Substr

func Substr(str string, start, length int) string

Types

type Error

type Error struct {
	Err      interface{}
	Type     string
	IsNormal bool
}

func Zip

func Zip(files map[string][]byte) ([]byte, Error)

type RegexpExt

type RegexpExt struct {
	*regexp.Regexp
}

func (*RegexpExt) FindStringSubmatchMap

func (r *RegexpExt) FindStringSubmatchMap(s string) (map[string]string, bool)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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