types

package
v0.0.0-...-795c791 Latest Latest
Warning

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

Go to latest
Published: Aug 13, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode   = 0
	ErrorCode     = 1
	ForbiddenCode = 2
	ExpireCode    = 3
)

code for common response type

Variables

This section is empty.

Functions

This section is empty.

Types

type CommonList

type CommonList struct {
	Total int         `json:"total"`
	List  interface{} `json:"list"`
}

type CommonResp

type CommonResp struct {
	Code  int         `json:"code"`
	Msg   string      `json:"msg"`
	Data  interface{} `json:"data"`
	Error interface{} `json:"error"`
}

CommonResp - api common response type success - {"code": 0, "msg": "", "data": {}, "error": null} error - {"code": 1, "msg": "", "data": {}, "error": null} forbidden - {"code": 2, "msg": "", "data": {}, "error": null} expire - {"code": 3, "msg": "", "data": {}, "error": null}

type NormalTime

type NormalTime struct {
	time.Time
}

func NewNormalTime

func NewNormalTime(t time.Time) NormalTime

func NewNormalTimeFromUnix

func NewNormalTimeFromUnix(timestamp int64) NormalTime

func NewUnixTime

func NewUnixTime(t time.Time) NormalTime

func NewUnixTimeFromUnix

func NewUnixTimeFromUnix(timestamp int64) NormalTime

func (*NormalTime) IsEmpty

func (t *NormalTime) IsEmpty() bool

func (NormalTime) MarshalJSON

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

func (*NormalTime) Scan

func (t *NormalTime) Scan(v interface{}) error

func (*NormalTime) String

func (t *NormalTime) String() string

func (*NormalTime) UnmarshalJSON

func (t *NormalTime) UnmarshalJSON(data []byte) error

func (NormalTime) Value

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

func (*NormalTime) YearMonthDate

func (t *NormalTime) YearMonthDate() string

type PaginationParams

type PaginationParams struct {
	Page     int `json:"page"`
	PageSize int `json:"page_size"`
}

type ProportionOfSomething

type ProportionOfSomething struct {
	Name  string          `json:"name"`
	Value decimal.Decimal `json:"value"`
}

type UnixTime

type UnixTime struct {
	time.Time
}

func (*UnixTime) IsEmpty

func (t *UnixTime) IsEmpty() bool

func (UnixTime) MarshalJSON

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

func (*UnixTime) Scan

func (t *UnixTime) Scan(v interface{}) error

func (*UnixTime) String

func (t *UnixTime) String() string

func (*UnixTime) UnmarshalJSON

func (t *UnixTime) UnmarshalJSON(data []byte) error

func (UnixTime) Value

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

func (*UnixTime) YearMonthDate

func (t *UnixTime) YearMonthDate() string

Jump to

Keyboard shortcuts

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