core

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Mar 14, 2023 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ErrCodeOK                 = 0
	ErrCodeInvalidCredential  = 40001 // access_token 过期错误码
	ErrCodeAccessTokenExpired = 42001 // access_token 过期错误码(maybe!!!)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	*core.Client
	ServiceId  uint64
	SpecificId string
}

func NewClient

func NewClient(srv core.AccessTokenServer, clt *http.Client) *Client

NewClient 创建一个新的 Client.

如果 clt == nil 则默认用 util.DefaultHttpClient

func NewClientWithToken

func NewClientWithToken(token string, clt *http.Client) *Client

func (*Client) GetJSON

func (clt *Client) GetJSON(incompleteURL string, response interface{}) (err error)

func (*Client) PostJSON

func (clt *Client) PostJSON(incompleteURL string, request interface{}, response interface{}) (err error)

func (*Client) SetService

func (clt *Client) SetService(serviceId uint64, specificId string)

type Error

type Error struct {
	ErrCode int64  `json:"errcode"`
	ErrMsg  string `json:"errmsg"`
}

func (*Error) Error

func (err *Error) Error() string

Jump to

Keyboard shortcuts

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