model

package
v1.0.7 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseRequest

type BaseRequest struct {
	// AppID 应用ID
	AppID uint64 `json:"app_id,omitempty"`
	// Secret 应用secret
	Secret string `json:"secret,omitempty"`
}

type BaseResponse

type BaseResponse struct {
	// Success 是否成功
	Success bool `json:"success,omitempty"`
	// Code 返回码
	Code int `json:"code,omitempty"`
	// Message 返回信息
	Message string `json:"message,omitempty"`
	// ErrorCode 返回码
	ErrorCode int `json:"errorCode"`
	// ErrorMsg 返回信息
	ErrorMsg string `json:"errorMsg"`
	// RequestID 请求的日志id,唯一标识一个请求
	RequestID string `json:"request_id,omitempty"`
}

BaseResponse shared api response data fields

func (BaseResponse) Error

func (r BaseResponse) Error() string

Error implement Response interface

func (BaseResponse) IsError

func (r BaseResponse) IsError() bool

IsError implement Response interface

type Bool added in v1.0.2

type Bool bool

Bool support number/string in json

func (Bool) String added in v1.0.2

func (b Bool) String() string

func (*Bool) UnmarshalJSON added in v1.0.2

func (bl *Bool) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Bool) Value added in v1.0.2

func (b Bool) Value() bool

type CodeNamePair added in v1.0.2

type CodeNamePair struct {
	// Code code
	Code string `json:"code,omitempty"`
	// Name 名称
	Name string `json:"name,omitempty"`
	// Children 子节点
	Children []CodeNamePair `json:"children,omitempty"`
}

type CommonRequest added in v1.0.2

type CommonRequest struct {
	// AdvertiserID 广告主ID
	AdvertiserID uint64 `json:"advertiser_id,omitempty"`
	// Method 请求方法
	Method string `json:"method,omitempty"`
}

CommonRequest 通用 API Request

func (CommonRequest) Encode added in v1.0.2

func (r CommonRequest) Encode() []byte

Encode implement PostRequest interface

type Float64 added in v1.0.2

type Float64 float64

Float64 support string quoted number in json

func (Float64) String added in v1.0.2

func (f64 Float64) String(prec int) string

func (*Float64) UnmarshalJSON added in v1.0.2

func (f64 *Float64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Float64) Value added in v1.0.2

func (f64 Float64) Value() float64

type GetRequest

type GetRequest interface {
	Request
	// Encode encode request to string
	Encode() string
}

GetRequest get request interface

type Int added in v1.0.2

type Int int

Int support string quoted number in json

func (Int) String added in v1.0.2

func (i Int) String() string

func (*Int) UnmarshalJSON added in v1.0.2

func (i *Int) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Int) Value added in v1.0.2

func (i Int) Value() int

type Int64 added in v1.0.2

type Int64 int64

Int64 support string quoted number in json

func (Int64) String added in v1.0.2

func (i64 Int64) String() string

func (*Int64) UnmarshalJSON added in v1.0.2

func (i64 *Int64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Int64) Value added in v1.0.2

func (i64 Int64) Value() int64

type JSONInt added in v1.0.2

type JSONInt int

JSONInt support string quoted number in json and marshal to string

func JSONIntFromInt added in v1.0.2

func JSONIntFromInt(v int) JSONInt

func (JSONInt) MarshalJSON added in v1.0.2

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

func (*JSONInt) UnmarshalJSON added in v1.0.2

func (i *JSONInt) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONInt) Value added in v1.0.2

func (i JSONInt) Value() int

type JSONInt64 added in v1.0.2

type JSONInt64 int64

JSONInt64 support string quoted number in json and marshal to string

func JSONInt64FromInt64 added in v1.0.2

func JSONInt64FromInt64(v int64) JSONInt64

func (JSONInt64) MarshalJSON added in v1.0.2

func (i64 JSONInt64) MarshalJSON() ([]byte, error)

func (*JSONInt64) UnmarshalJSON added in v1.0.2

func (i64 *JSONInt64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONInt64) Value added in v1.0.2

func (i64 JSONInt64) Value() int64

type JSONUint64 added in v1.0.2

type JSONUint64 uint64

JSONUint64 support string quoted number in json and marshal to string

func JSONUint64FromUint64 added in v1.0.2

func JSONUint64FromUint64(v uint64) JSONUint64

func (JSONUint64) MarshalJSON added in v1.0.2

func (u64 JSONUint64) MarshalJSON() ([]byte, error)

func (JSONUint64) String added in v1.0.2

func (u64 JSONUint64) String() string

func (*JSONUint64) UnmarshalJSON added in v1.0.2

func (u64 *JSONUint64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (JSONUint64) Value added in v1.0.2

func (u64 JSONUint64) Value() uint64

type PageRespDTO added in v1.0.2

type PageRespDTO struct {
	// PageIndex 页码
	PageIndex int64 `json:"page_index,omitempty"`
	// TotalCount 总数量
	TotalCount int64 `json:"total_count,omitempty"`
}

PageRespDTO 分页信息

type PostRequest

type PostRequest interface {
	Request
	// Encode encode request to bytes
	Encode() []byte
}

PostRequest post request interface

type Request

type Request interface {
}

type Response

type Response interface {
	// IsError 是否返回错误
	IsError() bool
	// Error implement error interface
	Error() string
}

Response api response interface

type Uint64 added in v1.0.2

type Uint64 uint64

Uint64 support string quoted number in json

func (Uint64) String added in v1.0.2

func (u64 Uint64) String() string

func (*Uint64) UnmarshalJSON added in v1.0.2

func (u64 *Uint64) UnmarshalJSON(b []byte) (err error)

UnmarshalJSON implement json Unmarshal interface

func (Uint64) Value added in v1.0.2

func (u64 Uint64) Value() uint64

type UploadField

type UploadField struct {
	// Key field key
	Key string
	// Value field value
	Value string
	// Reader upload file reader
	Reader io.Reader
}

UploadField multipart/form-data post request field struct

type UploadRequest

type UploadRequest interface {
	Request
	// Encode encode request to UploadFields
	Encode() []UploadField
}

UploadRequest multipart/form-data reqeust interface

Directories

Path Synopsis
Package advertiser 广告主相关
Package advertiser 广告主相关
Package conversion 转化追踪相关
Package conversion 转化追踪相关
Package oauth 授权相关
Package oauth 授权相关
Package report 报表相关
Package report 报表相关
offline
Package offline 离线报表
Package offline 离线报表
realtime
Package realtime 实时报表
Package realtime 实时报表
Package unit 广告单元相关
Package unit 广告单元相关

Jump to

Keyboard shortcuts

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