gddata

package
v1.0.89 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2023 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

View Source
const (
	LogTable = "gddata"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

Client 实例

func NewClient

func NewClient(config *ClientConfig) (*Client, error)

NewClient 创建实例化

func (*Client) Config

func (c *Client) Config(token string) *Client

func (*Client) ConfigApiClientFun

func (c *Client) ConfigApiClientFun(apiClientFun golog.ApiClientFun)

ConfigApiClientFun 日志配置

func (*Client) GdpIndex

func (c *Client) GdpIndex(ctx context.Context, year string) *GdpIndexResult

GdpIndex 地区生产总值指数(1978=100)接口 https://gddata.gd.gov.cn/opdata/index?chooseValue=apiForm&id=29000%2F03600017&sourceType

func (*Client) GetToken

func (c *Client) GetToken() string

type ClientConfig

type ClientConfig struct {
	Token string
}

ClientConfig 实例配置

type GdpIndexResponse

type GdpIndexResponse struct {
	Errcode   int64  `json:"errcode"`
	Errmsg    string `json:"errmsg"`
	Type      string `json:"type"`
	MediaId   string `json:"media_id"`
	CreatedAt string `json:"created_at"`
}

type GdpIndexResult

type GdpIndexResult struct {
	Result GdpIndexResponse   // 结果
	Body   []byte             // 内容
	Http   gorequest.Response // 请求
	Err    error              // 错误
}

Jump to

Keyboard shortcuts

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