types

package
v2.0.4 Latest Latest
Warning

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

Go to latest
Published: Dec 5, 2023 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

func Float32

func Float32(f float32) *float32

func Float64

func Float64(f float64) *float64

func Int

func Int(i int) *int

func Int64

func Int64(i int64) *int64

func MustNewBigIntFromString

func MustNewBigIntFromString(s string) *big.Int

MustNewBigIntFromString returns an instance of big.Int from a string The string is assumed to be base 10 and if it is not a valid big.Int then the function panics. Avoid using this function in production code.

func MustNewDecimalFromString

func MustNewDecimalFromString(s string) *decimal.Big

MustNewDecimalFromString returns an instance of Decimal from a string Avoid using this function in production code.

func MustNewTimeFromString

func MustNewTimeFromString(str string) *time.Time

MustNewTimeFromString returns an instance of time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. Avoid using this function in production code.

func MustTimeFromString

func MustTimeFromString(str string) time.Time

MustTimeFromString returns a time.Time from a string formatted as "2006-01-02T15:04:05Z07:00" or panics. Avoid using this function in production code.

func String

func String(s string) *string

Types

type Date

type Date struct {
	time.Time
}

Date is a wrapper around time.Time that allows for JSON marshaling a date string formatted as "2006-01-02".

func DateFromString

func DateFromString(str string) (Date, error)

DateFromString returns a Date from a string formatted as "2006-01-02".

func DateFromTime

func DateFromTime(t time.Time) Date

DateFromTime returns a Date from a time.Time.

func MustDateFromString

func MustDateFromString(str string) Date

MustDateFromString returns a Date from a string formatted as "2006-01-02" or panics. Avoid using this function in production code.

func MustNewDateFromString

func MustNewDateFromString(str string) *Date

MustNewDateFromString returns an instance of Date from a string formatted as "2006-01-02" or panics. Avoid using this function in production code.

func NewDate

func NewDate(t time.Time) *Date

NewDate returns an instance of Date from a time.Time.

func NewDateFromString

func NewDateFromString(str string) (*Date, error)

NewDateFromString returns an instance of Date from a string formatted as "2006-01-02".

func (Date) GetTime

func (d Date) GetTime() time.Time

func (Date) MarshalJSON

func (d Date) MarshalJSON() ([]byte, error)

func (Date) String

func (d Date) String() string

func (*Date) UnmarshalJSON

func (d *Date) UnmarshalJSON(data []byte) error

Jump to

Keyboard shortcuts

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