util

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2014 License: AGPL-3.0 Imports: 3 Imported by: 32

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	FmtMonthDay      = "Jan _2"    /* yahoo finance often returns these types of dates */
	FmtDayTMonthYear = "_2-Jan-06" /* yahoo finance is quite inconsisten sometimes */
	FmtYearMonthDay  = "2006-01-02"
)

Functions

func Fmaybe

func Fmaybe(f *float64) float64

func MapStr

func MapStr(mapping func(string) string, xs []string) []string

Types

type JsonTime

type JsonTime time.Time

func (*JsonTime) JsonParse

func (dt *JsonTime) JsonParse(data []byte, formats ...string) error

type MonthDay

type MonthDay JsonTime

shortime

func (*MonthDay) GetTime

func (jt *MonthDay) GetTime() time.Time

func (*MonthDay) UnmarshalJSON

func (jt *MonthDay) UnmarshalJSON(data []byte) error

type NullFloat64

type NullFloat64 float64
use this type instead of plain float64 if you have a JSON stream which

* sometimes sends quoted floats and sometimes null's for the same field

func (*NullFloat64) UnmarshalJSON

func (n *NullFloat64) UnmarshalJSON(b []byte) error

type NullInt64

type NullInt64 int64
use this type instead of plain int64 if you have a JSON stream which

* sometimes sends quoted floats and sometimes null's for the same field

func (*NullInt64) UnmarshalJSON

func (n *NullInt64) UnmarshalJSON(b []byte) error

type YearMonthDay

type YearMonthDay JsonTime

func (*YearMonthDay) GetTime

func (jt *YearMonthDay) GetTime() time.Time

func (*YearMonthDay) UnmarshalJSON

func (jt *YearMonthDay) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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