Documentation
¶
Index ¶
- Constants
- func Checksum(a string) string
- func ElapsedTimeSince(t time.Time) int64
- func Exists(env string) bool
- func Fingerprint(a string) string
- func GetBool(env string, def bool) bool
- func GetInt(env string, def int64) int64
- func GetString(env, def string) string
- func IncT(t int64, m int) int64
- func Marshal(v interface{}) ([]byte, error)
- func MarshalToString(v interface{}) (string, error)
- func Nano() int64
- func Now() int64
- func RandString() string
- func RandStringId() string
- func RandStringN(n int) string
- func RandomToken(prefix string) (string, error)
- func Seed(seed int64)
- func SetLogLevel()
- func ShortUUID() (string, error)
- func SimpleUUID() (string, error)
- func ToHour(t int64) int
- func ToHourUTC(t int64) int
- func ToUTC(t int64) string
- func ToWeekday(t int64) int
- func UUID() (string, error)
- func Unmarshal(data []byte, v interface{}) error
- func UnmarshalFromReader(reader io.Reader, v interface{}) error
- func UnmarshalFromString(str string, v interface{}) error
- type AnyType
- type PlaceholderType
Constants ¶
const (
LOG_LEVEL = "LOG_LEVEL"
)
Variables ¶
This section is empty.
Functions ¶
func ElapsedTimeSince ¶
ElapsedTimeSince returns the difference between t and now.
func Exists ¶
Exists verifies that the environment variable 'env' is defined and returns a non-empty value.
func Fingerprint ¶
Fingerprint creates a unique ID (MD5) from a string
func GetBool ¶ added in v2.5.0
GetBool returns the environment variable ENV['env'] as boolean or def if 'env' is not set.
func GetInt ¶
GetInt returns the environment variable ENV['env'] as an int64 or def if 'env' is not set.
func GetString ¶
GetString returns the environment variable ENV['env'] or def if 'env' is not set. Note: def is only returned if the 'env' is not set, i.e. an EMPTY 'env' is still returned !
func MarshalToString ¶
MarshalToString marshals v into a string.
func RandomToken ¶
RandomToken generates a random token similar to a to a RFC 4122 UID
func SetLogLevel ¶ added in v2.5.0
func SetLogLevel()
func SimpleUUID ¶
SimpleUUID generates a random UUID according to RFC 4122, without any dashes
func UnmarshalFromReader ¶
UnmarshalFromReader unmarshals v from reader.
func UnmarshalFromString ¶
UnmarshalFromString unmarshals v from str.
Types ¶
type PlaceholderType ¶
type PlaceholderType = struct{}
PlaceholderType represents a placeholder type.
var Placeholder PlaceholderType
Placeholder is a placeholder object that can be used globally.