util

package
v0.0.0-...-a89b161 Latest Latest
Warning

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

Go to latest
Published: Apr 15, 2016 License: MPL-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FloatOrNull

func FloatOrNull(n float64) sql.NullFloat64

FloatOrNull returns properly configured sql.NullFloat64

func IntOrNull

func IntOrNull(n int64) sql.NullInt64

IntOrNull returns properly configured sql.NullInt64

func NewSecure

func NewSecure(isDevelopment bool) *secure.Secure

NewSecure returns instance of secure.Secure to redirect http to https

func ParseBearerToken

func ParseBearerToken(r *http.Request) ([]byte, error)

ParseBearerToken parses Bearer token from Authorization header

func PositiveFloatOrNull

func PositiveFloatOrNull(n float64) sql.NullFloat64

PositiveFloatOrNull returns properly configured sql.NullFloat64 for a positive number

func PositiveIntOrNull

func PositiveIntOrNull(n int64) sql.NullInt64

PositiveIntOrNull returns properly configured sql.NullInt64 for a positive number

func SpaceDelimitedStringNotGreater

func SpaceDelimitedStringNotGreater(first, second string) bool

SpaceDelimitedStringNotGreater returns true if the first string is the same as the second string or does not contain any substring not contained in the second string (when split by space)

func StringInSlice

func StringInSlice(a string, list []string) bool

StringInSlice is a function similar to "x in y" Python construct

func StringOrNull

func StringOrNull(str string) sql.NullString

StringOrNull returns properly configured sql.NullString

func TimeOrNull

func TimeOrNull(t *time.Time) pq.NullTime

TimeOrNull returns properly confiigured pq.TimeNull

Types

This section is empty.

Jump to

Keyboard shortcuts

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