utils

package
v0.0.0-...-197a5f8 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2015 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BoolP

func BoolP(v bool) *bool

func Boot2DocketIp

func Boot2DocketIp() (string, error)

func GetGravatar

func GetGravatar(id string, size int, dtype AvatarType) string

Generate gravatar url Read more about gravatar: http://en.gravatar.com/site/implement/images/

func GetHostname

func GetHostname() (string, error)

func IsBoot2Docker

func IsBoot2Docker() bool

func JustTimeout

func JustTimeout(parent context.Context, duration time.Duration) context.Context

func Promise

func Promise(f func() error) chan error

Promise is a basic promise implementation: it wraps calls a function in a goroutine, and returns a channel which will later return the function's return value.

func RandomColor

func RandomColor() [3]byte

func RandomColorString

func RandomColorString() string

func UuidV4String

func UuidV4String() string

Types

type AvatarType

type AvatarType string
const (
	//	a simple, cartoon-style silhouetted outline of a person (does not vary by email hash)
	AvatarMysteryMan AvatarType = "mm"
	//	a geometric pattern based on an email hash
	AvatarIdenticon AvatarType = "identicon"
	//	a generated 'monster' with different colors, faces, etc
	AvatarMonster AvatarType = "monsterid"
	//	generated faces with differing features and backgrounds
	AvatarWavatar AvatarType = "wavatar"
	//	awesome generated, 8-bit arcade-style pixelated faces
	AvatarRetro AvatarType = "retro"
	//	do not load any image if none is associated with the email hash, instead return an HTTP 404 (File Not Found) response
	Avatar404 AvatarType = "404"
	//	a transparent PNG image (border added to HTML below for demonstration purposes)
	Avatar AvatarType = "blank"
)

type MultiLine

type MultiLine []string

func (MultiLine) String

func (m MultiLine) String() string

func (*MultiLine) UnmarshalJSON

func (m *MultiLine) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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