types

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Mar 10, 2021 License: MIT Imports: 7 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ConvertibleBoolean

type ConvertibleBoolean bool

ConvertibleBoolean is a custom boolean struct used for manipulating booleans of string, integer, and boolean to/from JSON and SQL

func (*ConvertibleBoolean) Scan

func (bit *ConvertibleBoolean) Scan(src interface{}) error

Scan re-implements the database/sql Scan() method. It will map the integer found in the response to its boolean equivalent

func (*ConvertibleBoolean) UnmarshalJSON

func (bit *ConvertibleBoolean) UnmarshalJSON(data []byte) error

UnmarshalJSON re-implements the encoding/json Unmarshal method. It will cast the any of the truthy/falsy variants to boolean

type IntString added in v0.2.0

type IntString int

IntString is a custom int struct used for manipulating ints of string to/from JSON. NOT NEEDED use `json:",string"`

func (IntString) MarshalJSON added in v0.2.1

func (i IntString) MarshalJSON() ([]byte, error)

MarshalJSON re-implements the encoding/json Marshal method. It will return a quote-enclosed int as []byte

func (*IntString) UnmarshalJSON added in v0.2.0

func (i *IntString) UnmarshalJSON(data []byte) error

UnmarshalJSON re-implements the encoding/json Unmarshal method. It will cast the string to int type

type URLString added in v0.2.3

type URLString url.URL

URLString is a custom url.URL struct used for converting URLs to/from string for sql

func (*URLString) Scan added in v0.2.3

func (u *URLString) Scan(src interface{}) error

Scan re-implements the database/sql Scan() method. It will convert the url string found in the response to a URLString struct

func (*URLString) String added in v0.2.3

func (u *URLString) String() string

String is a wrapper function of the base url.Url type

func (URLString) Value added in v0.2.3

func (u URLString) Value() (driver.Value, error)

Value re-implements the database/sql Value() method. It will convert the custom struct to string

type UnixTimestamp added in v0.1.1

type UnixTimestamp time.Time

UnixTimestamp is a custom time.Time struct used for manipulating unix timestamps to/from JSON, XML, and SQL

func (UnixTimestamp) MarshalJSON added in v0.1.1

func (t UnixTimestamp) MarshalJSON() ([]byte, error)

MarshalJSON re-implements the encoding/json Marshal method. It will return a quote-enclosed RFC3339 string as []byte

func (*UnixTimestamp) Scan added in v0.1.1

func (t *UnixTimestamp) Scan(src interface{}) error

Scan re-implements the database/sql Scan() method. It will convert the "almost" RFC3339 string found in the response to a UnixTimestamp struct

func (*UnixTimestamp) String added in v0.1.1

func (t *UnixTimestamp) String(format ...string) string

String is a convenience function to get a string response based on format. time.RFC3339 is the default

func (*UnixTimestamp) UnmarshalXMLAttr added in v0.1.1

func (t *UnixTimestamp) UnmarshalXMLAttr(attr xml.Attr) error

UnmarshalXMLAttr re-implements the database/xml Unmarshal() method for attributes. It will map the unix timestamp integer found in the response to a UnixTimestamp struct

func (UnixTimestamp) Value added in v0.1.1

func (t UnixTimestamp) Value() (driver.Value, error)

Value re-implements the database/sql Value() method. It will convert the custom struct to the standard time.Time struct

Jump to

Keyboard shortcuts

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