gddata

package
v1.0.215 Latest Latest
Warning

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

Go to latest
Published: Nov 11, 2023 License: MIT Imports: 5 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) DefaultHttp added in v1.0.177

func (c *Client) DefaultHttp()

DefaultHttp 默认请求

func (*Client) GdpIndex

func (c *Client) GdpIndex(ctx context.Context, year string, notMustParams ...gorequest.Params) (*GdpIndexResult, error)

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

func (*Client) GetToken

func (c *Client) GetToken() string

func (*Client) SetHttp added in v1.0.177

func (c *Client) SetHttp(app *gorequest.App)

SetHttp 配置请求

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 // 请求
}

Jump to

Keyboard shortcuts

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