runtime

package
v0.0.0-...-417840b Latest Latest
Warning

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

Go to latest
Published: Jun 16, 2021 License: AGPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ContentTypeJSON = "application/json"
)

Variables

View Source
var (
	ErrLoginNeeded = errors.New("需要登录")
)
View Source
var (
	NumberCodec = &numberCodec{}
)

Functions

func RegisterDecoder

func RegisterDecoder(d Decoder)

Types

type Decoder

type Decoder interface {
	// Typically: ContentType
	MineType() string
	Decode(data []byte, into Object) (err error)
}

func NegotiateDecoder

func NegotiateDecoder(mineType string) Decoder

type Int

type Int jsoniter.Number

an Int representation

func (Int) Int

func (n Int) Int() int

type Object

type Object interface {
	Retcode() Retcode
	RetMessage() string
}

type ObjectMeta

type ObjectMeta struct {
	Code    Retcode `json:"retcode"`
	Message string  `json:"message"`
}

func (ObjectMeta) Error

func (rm ObjectMeta) Error() string

func (ObjectMeta) RetMessage

func (rm ObjectMeta) RetMessage() string

func (ObjectMeta) Retcode

func (rm ObjectMeta) Retcode() Retcode

type Retcode

type Retcode int
const (
	OK        Retcode = 0
	NeedLogin Retcode = -100
)

type TimeRFC3339

type TimeRFC3339 string

"2006-01-02T15:04:05Z07:00"

func (TimeRFC3339) Time

func (t TimeRFC3339) Time() time.Time

type UnixTimestamp

type UnixTimestamp jsoniter.Number

unixTimeStamp in second

func (UnixTimestamp) Time

func (ut UnixTimestamp) Time() time.Time

Jump to

Keyboard shortcuts

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