util

package
v0.11.1 Latest Latest
Warning

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

Go to latest
Published: Nov 10, 2016 License: MIT Imports: 5 Imported by: 12

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NowMilli

func NowMilli() int64

NowMilli returns now in milliseconds since epoch

Types

type Level

type Level struct {
	Key   string
	Value int
}

Level maps levels

type LevelsList

type LevelsList []Level

LevelsList allows sorting levels by the int value

func SortLevels

func SortLevels(levels map[string]interface{}) LevelsList

SortLevels sorts levels

func (LevelsList) Len

func (l LevelsList) Len() int

func (LevelsList) Less

func (l LevelsList) Less(i, j int) bool

func (LevelsList) Swap

func (l LevelsList) Swap(i, j int)

type TypeConverter

type TypeConverter struct{}

TypeConverter type

func (TypeConverter) FromDb

func (tc TypeConverter) FromDb(target interface{}) (gorp.CustomScanner, bool)

FromDb converts target from string to json

func (TypeConverter) ToDb

func (tc TypeConverter) ToDb(val interface{}) (interface{}, error)

ToDb converts val from json to string

Jump to

Keyboard shortcuts

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