util

package
v0.0.0-...-fb119ec Latest Latest
Warning

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

Go to latest
Published: Feb 12, 2018 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	IS_DEBUG = true
	NO_DEBUG = false
)
View Source
const (
	IS_FATAL  = true
	NON_FATAL = false
)

Variables

This section is empty.

Functions

func DataToJson

func DataToJson(rawData interface{}, debug bool) (string, error)

func GenerateUid

func GenerateUid() string

func GetCliArguments

func GetCliArguments(usage, name, version string) map[string]interface{}

func GetGameOptions

func GetGameOptions(arguments map[string]interface{}) (string, string)

func GetServerOptions

func GetServerOptions(arguments map[string]interface{}) (bool, int, bool)

func HasSuffixAny

func HasSuffixAny(s string, suffixes []string) bool

func HexToObjectId

func HexToObjectId(wordId string) *bson.ObjectId

func JoinLimited

func JoinLimited(parts []string, joinBy string, maxCount int) string

func JsonToStringMap

func JsonToStringMap(bytes []byte) (map[string]string, error)

func LogErr

func LogErr(err error, debug bool)

func LogErrMsg

func LogErrMsg(err error, msg string, debug bool)

func LogFatalErr

func LogFatalErr(err error, debug bool)

func LogFatalMsg

func LogFatalMsg(err error, msg string, debug bool)

func LogFatalfMsg

func LogFatalfMsg(err error, msg string, debug bool)

func LogMsg

func LogMsg(msg string, debug bool, fatal bool)

func MgoDb

func MgoDb(mgoDb *mgo.Database) gin.HandlerFunc

func ParseTimeNow

func ParseTimeNow(timeForm, toParse string) time.Time

func ReadStdInput

func ReadStdInput() ([]byte, error)

func SliceAppend

func SliceAppend(stringSlice []string, stringToAppend string) []string

func StringIn

func StringIn(s string, options []string) bool

func TrimSplit

func TrimSplit(s, sep string) []string

Types

This section is empty.

Jump to

Keyboard shortcuts

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