Documentation ¶
Index ¶
- type Bool
- func (b Bool) IsZero() bool
- func (b Bool) MarshalJSON() ([]byte, error)
- func (b Bool) MarshalText() ([]byte, error)
- func (b Bool) Ptr() *bool
- func (b *Bool) Scan(value interface{}) error
- func (b *Bool) SetValid(v bool)
- func (b Bool) String() string
- func (b *Bool) UnmarshalJSON(data []byte) error
- func (b *Bool) UnmarshalText(text []byte) error
- func (b Bool) Value() (driver.Value, error)
- type Date
- func (t Date) IsZero() bool
- func (t Date) MarshalJSON() ([]byte, error)
- func (t Date) MarshalText() ([]byte, error)
- func (t Date) Ptr() *time.Time
- func (t *Date) Scan(value interface{}) error
- func (t *Date) SetValid(v time.Time)
- func (t Date) String() string
- func (t *Date) UnmarshalJSON(b []byte) error
- func (t *Date) UnmarshalText(b []byte) error
- func (t Date) Value() (driver.Value, error)
- type DateTime
- func (t DateTime) IsZero() bool
- func (t DateTime) MarshalJSON() ([]byte, error)
- func (t DateTime) MarshalText() ([]byte, error)
- func (t DateTime) Ptr() *time.Time
- func (t *DateTime) Scan(value interface{}) error
- func (t *DateTime) SetValid(v time.Time)
- func (t DateTime) String() string
- func (t *DateTime) UnmarshalJSON(b []byte) error
- func (t *DateTime) UnmarshalText(b []byte) error
- func (t DateTime) Value() (driver.Value, error)
- type Float
- func (f Float) IsZero() bool
- func (f Float) MarshalJSON() ([]byte, error)
- func (f Float) MarshalText() ([]byte, error)
- func (f Float) Ptr() *float64
- func (f *Float) Scan(value interface{}) error
- func (f *Float) SetValid(n float64)
- func (f Float) String() string
- func (f *Float) UnmarshalJSON(data []byte) error
- func (f *Float) UnmarshalText(text []byte) error
- func (f Float) Value() (driver.Value, error)
- type Int
- func (i Int) IsZero() bool
- func (i Int) MarshalJSON() ([]byte, error)
- func (i Int) MarshalText() ([]byte, error)
- func (i Int) Ptr() *int64
- func (i *Int) Scan(value interface{}) error
- func (i *Int) SetValid(n int64)
- func (i Int) String() string
- func (i *Int) UnmarshalJSON(data []byte) error
- func (i *Int) UnmarshalText(text []byte) error
- func (i Int) Value() (driver.Value, error)
- type String
- func (s String) IsZero() bool
- func (s String) MarshalJSON() ([]byte, error)
- func (s String) MarshalText() ([]byte, error)
- func (s String) Ptr() *string
- func (s *String) Scan(value interface{}) error
- func (s *String) SetValid(v string)
- func (s String) String() string
- func (s *String) UnmarshalJSON(data []byte) error
- func (s *String) UnmarshalText(text []byte) error
- func (s *String) Value() (driver.Value, error)
- type Time
- func (t Time) MarshalJSON() ([]byte, error)
- func (t Time) MarshalText() ([]byte, error)
- func (t Time) Ptr() *time.Time
- func (t *Time) Scan(value interface{}) error
- func (t *Time) SetValid(v time.Time)
- func (t *Time) UnmarshalJSON(data []byte) error
- func (t *Time) UnmarshalText(text []byte) error
- func (t Time) Value() (driver.Value, error)
- type Uint
- func (i Uint) IsZero() bool
- func (i Uint) MarshalJSON() ([]byte, error)
- func (i Uint) MarshalText() ([]byte, error)
- func (i Uint) Ptr() *uint64
- func (i *Uint) Scan(value interface{}) error
- func (i *Uint) SetValid(n uint64)
- func (i Uint) String() string
- func (i *Uint) UnmarshalJSON(data []byte) error
- func (i *Uint) UnmarshalText(text []byte) error
- func (i Uint) Value() (driver.Value, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Bool ¶
Bool represents a bool that may be null. Bool implements the Scanner interface so it can be used as a scan destination, similar to NullString.
func BoolFromPtr ¶
BoolFromPtr creates a new Bool that will be null if f is nil.
func (Bool) IsZero ¶
IsZero returns true for invalid Bools, for future omitempty support (Go 1.4?) A non-null Bool with a 0 value will not be considered zero.
func (Bool) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Bool is null.
func (Bool) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Bool is null.
func (Bool) Ptr ¶
Ptr returns a pointer to this Bool's value, or a nil pointer if this Bool is null.
func (*Bool) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Bool. It also supports unmarshalling a sql.NullBool.
func (*Bool) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Bool if the input is a blank or not an integer. It will return an error if the input is not an integer, blank, or "null".
type Date ¶
Date is a nullable time.Time with ISO8601 format. It supports SQL and JSON serialization. It will marshal to null if null. swagger:strfmt date-time
func DateFromPtr ¶
DateFromPtr creates a new Date that will be null if t is nil.
func (Date) IsZero ¶
IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC.
func (Date) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (Date) MarshalText ¶
MarshalText implement the json.Marshaler interface
func (Date) Ptr ¶
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*Date) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Date) UnmarshalText ¶
UnmarshalText allows ISO8601Time to implement the TextUnmarshaler interface
type DateTime ¶
DateTime is a nullable time.Time with ISO8601 format. It supports SQL and JSON serialization. It will marshal to null if null. swagger:strfmt date-time
func DateTimeFrom ¶
DateTimeFrom creates a new Time that will always be valid.
func DateTimeFromPtr ¶
DateTimeFromPtr creates a new DateTime that will be null if t is nil.
func NewDateTime ¶
NewDateTime creates a new DateTime.
func (DateTime) IsZero ¶
IsZero reports whether t represents the zero time instant, January 1, year 1, 00:00:00 UTC.
func (DateTime) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (DateTime) MarshalText ¶
MarshalText implement the json.Marshaler interface
func (DateTime) Ptr ¶
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*DateTime) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*DateTime) UnmarshalText ¶
UnmarshalText allows ISO8601Time to implement the TextUnmarshaler interface
type Float ¶
Float is a nullable float64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func FloatFromPtr ¶
FloatFromPtr creates a new Float that be null if f is nil.
func (Float) IsZero ¶
IsZero returns true for invalid Floats, for future omitempty support (Go 1.4?) A non-null Float with a 0 value will not be considered zero.
func (Float) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Float is null.
func (Float) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Float is null.
func (Float) Ptr ¶
Ptr returns a pointer to this Float's value, or a nil pointer if this Float is null.
func (*Float) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Float. It also supports unmarshalling a sql.NullFloat64.
func (*Float) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Float if the input is a blank or not an integer. It will return an error if the input is not an integer, blank, or "null".
type Int ¶
Int is an nullable int64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func IntFromPtr ¶
IntFromPtr creates a new Int that be null if i is nil.
func (Int) IsZero ¶
IsZero returns true for invalid Ints, for future omitempty support (Go 1.4?) A non-null Int with a 0 value will not be considered zero.
func (Int) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Int is null.
func (Int) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Int is null.
func (*Int) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Int. It also supports unmarshalling a sql.NullInt64.
func (*Int) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Int if the input is a blank or not an integer. It will return an error if the input is not an integer, blank, or "null".
type String ¶
String is a nullable string. It supports SQL and JSON serialization. It will marshal to null if null. Blank string input will be considered null.
func StringFrom ¶
StringFrom creates a new String that will never be blank.
func StringFromPtr ¶
StringFromPtr creates a new String that be null if s is nil.
func (String) IsZero ¶
IsZero returns true for null strings, for potential future omitempty support.
func (String) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this String is null.
func (String) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string when this String is null.
func (String) Ptr ¶
Ptr returns a pointer to this String's value, or a nil pointer if this String is null.
func (*String) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string and null input. Blank string input does not produce a null String. It also supports unmarshalling a sql.NullString.
func (*String) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null String if the input is a blank string.
type Time ¶
Time is a nullable time.Time. It supports SQL and JSON serialization. It will marshal to null if null.
func TimeFromPtr ¶
TimeFromPtr creates a new Time that will be null if t is nil.
func (Time) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this time is null.
func (Time) MarshalText ¶
MarshalText implements TextMarshaler
func (Time) Ptr ¶
Ptr returns a pointer to this Time's value, or a nil pointer if this Time is null.
func (*Time) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports string, object (e.g. pq.NullTime and friends) and null input.
func (*Time) UnmarshalText ¶
UnmarshalText implements TextUnmarshaler
type Uint ¶
Uint is an nullable int64. It does not consider zero values to be null. It will decode to null, not zero, if null.
func UintFromPtr ¶
UintFromPtr creates a new Uint that be null if i is nil.
func (Uint) IsZero ¶
IsZero returns true for invalid Uints, for future omitempty support (Go 1.4?) A non-null Uint with a 0 value will not be considered zero.
func (Uint) MarshalJSON ¶
MarshalJSON implements json.Marshaler. It will encode null if this Uint is null.
func (Uint) MarshalText ¶
MarshalText implements encoding.TextMarshaler. It will encode a blank string if this Uint is null.
func (Uint) Ptr ¶
Ptr returns a pointer to this Uint's value, or a nil pointer if this Uint is null.
func (*Uint) UnmarshalJSON ¶
UnmarshalJSON implements json.Unmarshaler. It supports number and null input. 0 will not be considered a null Uint. It also supports unmarshalling a sql.NullInt64.
func (*Uint) UnmarshalText ¶
UnmarshalText implements encoding.TextUnmarshaler. It will unmarshal to a null Uint if the input is a blank or not an integer. It will return an error if the input is not an integer, blank, or "null".