utils

package
v0.0.0-...-ec45d75 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2014 License: BSD-2-Clause Imports: 8 Imported by: 1

Documentation

Index

Constants

View Source
const (
	ONE_MINUTE  = 60
	TWO_MINUTES = 120
	ONE_HOUR    = ONE_MINUTE * 60
	TWO_HOURS   = ONE_HOUR * 2
	ONE_DAY     = ONE_HOUR * 24
	TWO_DAYS    = ONE_DAY * 2
	ONE_MONTH   = ONE_DAY * 30
	TWO_MONTHS  = ONE_MONTH * 2
	ONE_YEAR    = ONE_DAY * 365
)

Variables

This section is empty.

Functions

func ParseThingFuSerialData

func ParseThingFuSerialData(data string) (p map[string]interface{}, e error)

func RandomString

func RandomString(str_size int) string

func SendEmail

func SendEmail(host string, port uint16, userName string, password string, to []string, subject string, message string) (err error)

func TimeWithinThreshold

func TimeWithinThreshold(last time.Time, threshold int, defaultThreshold int) bool

Types

type GoTime

type GoTime struct {
	// contains filtered or unexported fields
}

func NewGoTime

func NewGoTime(o time.Time) *GoTime

func Now

func Now() *GoTime

func (GoTime) Ago

func (t GoTime) Ago() string

func (GoTime) Elapsed

func (t GoTime) Elapsed(secs int) bool

func (GoTime) GetTime

func (t GoTime) GetTime() time.Time

func (*GoTime) SetTime

func (t *GoTime) SetTime(time time.Time)

Jump to

Keyboard shortcuts

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