Documentation ¶
Index ¶
- Constants
- func ConvertBool(value string) reflect.Value
- func NullBoolConverter(i string) reflect.Value
- func NullFloat64Converter(i string) reflect.Value
- func NullInt64Converter(i string) reflect.Value
- func NullStringConverter(s string) reflect.Value
- func NullTimeConverter(b string) reflect.Value
- type NullBool
- type NullFloat64
- type NullInt64
- type NullString
- type NullTime
Constants ¶
const ( HTMLFormTime24Hr = "15:04" HTMLFormTime12Hr = "3:04 PM" HTMLFormDate = "2006-01-02" NZHTMLFormDate = "02-01-2006" NZHTMLFormDateTime12Hr = "02-01-2006 3:04 PM" DBTime = "15:04:05:000" HTMLFormDateTime24Hr = "2006-01-02 15:04" DBDateTime = "2006-01-02 15:04:05:000" TimeWithSeconds = "15:04:05" )
Variables ¶
This section is empty.
Functions ¶
func ConvertBool ¶
func NullBoolConverter ¶
func NullFloat64Converter ¶
func NullInt64Converter ¶
func NullStringConverter ¶
This function is used to convert an HTML form value (returned from a create or edit, for instance) to a NullTime. It will first try parse it as a Time, if that does not work it will parse it as a Date.
func NullTimeConverter ¶
This function is used to convert an HTML form value (returned from a create or edit, for instance) to a NullTime. It will first try parse it as a Time, if that does not work it will parse it as a Date, if that doesn't work it will parse it as a datetime
Types ¶
type NullBool ¶
func (NullBool) MarshalJSON ¶
this function is used when JSON tries to marshal this struct. Without it it will be marshalled into a JSON object with fields Time and Valid. This is far more elegant.
func (*NullBool) UnmarshalJSON ¶
type NullFloat64 ¶
func (NullFloat64) MarshalJSON ¶
func (nt NullFloat64) MarshalJSON() ([]byte, error)
this function is used when JSON tries to marshal this struct. Without it it will be marshalled into a JSON object with fields Time and Valid. This is far more elegant.
func (*NullFloat64) Scan ¶
func (nt *NullFloat64) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*NullFloat64) UnmarshalJSON ¶
func (nt *NullFloat64) UnmarshalJSON(b []byte) error
type NullInt64 ¶
func (NullInt64) MarshalJSON ¶
this function is used when JSON tries to marshal this struct. Without it it will be marshalled into a JSON object with fields Time and Valid. This is far more elegant.
func (*NullInt64) UnmarshalJSON ¶
type NullString ¶
func (NullString) MarshalJSON ¶
func (nt NullString) MarshalJSON() ([]byte, error)
this function is used when JSON tries to marshal this struct. Without it it will be marshalled into a JSON object with fields Time and Valid. This is far more elegant.
func (*NullString) Scan ¶
func (nt *NullString) Scan(value interface{}) error
Scan implements the Scanner interface.
func (*NullString) UnmarshalJSON ¶
func (nt *NullString) UnmarshalJSON(b []byte) error
type NullTime ¶
func (NullTime) GetHTMLDateTime ¶
func (NullTime) MarshalJSON ¶
this function is used when JSON tries to marshal this struct. Without it it will be marshalled into a JSON object with fields Time and Valid. This is far more elegant.
func (*NullTime) Scan ¶
Scan implements the Scanner interface. Can scan from both time.Time and NullTime interfaces