ovopark

package module
v0.0.0-...-e698987 Latest Latest
Warning

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

Go to latest
Published: Feb 16, 2022 License: Apache-2.0 Imports: 17 Imported by: 0

README

go sdk for ovopark

Documentation

Index

Constants

View Source
const (
	ErrCodeOK = 0
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client interface {
	Do(ctx context.Context, req *http.Request) (*http.Response, error)
}

func NewClient

func NewClient(timeout time.Duration) Client

type CommonReqFields

type CommonReqFields struct {
	APIName      string `json:"_mt" url:"_mt"`
	APIVersion   string `json:"_version" url:"_version"`
	ReqMethod    string `json:"_requestMode" url:"_requestMode"`
	PlatformID   string `json:"_aid" url:"_aid"`
	AccessKeyId  string `json:"_akey" url:"_akey"`
	CryptoMethod string `json:"_sm" url:"_sm"`
	RequestTime  string `json:"_timestamp" url:"_timestamp"`
	ReqToken     string `json:"_sig" url:"-"`
	RespFormat   string `json:"_format" url:"_format"`
}

type CommonResp

type CommonResp struct {
	CommonRespFields
	Data string `json:"data,omitempty"`
}

type CommonRespFields

type CommonRespFields struct {
	Status struct {
		ReqId        string `json:"cid"`
		ErrCode      int    `json:"code"`
		ErrCodeStr   string `json:"codename"`
		ServerTime   int64  `json:"systime"`
		GatewayParam struct {
			IsGatewayReturn bool `json:"isGatewayReturn"`
		} `json:"gatewayParam"`
	} `json:"stat"`
	ErrMsg string `json:"result"`
}

type OVOPark

type OVOPark struct {
	// contains filtered or unexported fields
}

func NewOVOPark

func NewOVOPark(corpId int, aid, aKeyId, aKeySec string) *OVOPark

func (*OVOPark) APIRequest

func (s *OVOPark) APIRequest(ctx context.Context, apiName string, req, response interface{}, optional ...string) (err error)

func (*OVOPark) SetAuthenticator

func (s *OVOPark) SetAuthenticator(token string)

SetAuthenticator 设置auth token

func (*OVOPark) SetDomain

func (s *OVOPark) SetDomain(domain string)

Jump to

Keyboard shortcuts

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