components

package
v0.0.0-...-8e1e73d Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2024 License: MIT Imports: 15 Imported by: 0

Documentation

Overview

Package components provides bk component clients.

Index

Constants

View Source
const (

	// BKAPIRequestIDHeader 蓝鲸网关的请求ID
	BKAPIRequestIDHeader = "X-Bkapi-Request-Id"

	// RequestIDHeaderKey 请求ID的Header Key
	RequestIDHeaderKey = "X-Request-Id"
)

Variables

This section is empty.

Functions

func GetClient

func GetClient() *resty.Client

GetClient : 新建Client, 设置公共参数,每次新建,cookies不复用

func RequestIDValue

func RequestIDValue(ctx context.Context) string

RequestIDValue 获取 RequestId 值

func SetRequestIDHeaderValue

func SetRequestIDHeaderValue(req *http.Request, id string)

SetRequestIDHeaderValue 设置 RequestId 值到头部

func UnmarshalBKResult

func UnmarshalBKResult(resp *resty.Response, data interface{}) error

UnmarshalBKResult 反序列化为蓝鲸返回规范

func WithRequestIDValue

func WithRequestIDValue(ctx context.Context, id string) context.Context

WithRequestIDValue 设置 RequestId 值

Types

type BKResult

type BKResult struct {
	Code    interface{} `json:"code"`
	Message string      `json:"message"`
	Data    interface{} `json:"data"`
}

BKResult 蓝鲸返回规范的结构体

func (*BKResult) ValidateCode

func (r *BKResult) ValidateCode() error

ValidateCode 返回结果是否OK

Directories

Path Synopsis
Package bcs provides bcs api client.
Package bcs provides bcs api client.
Package bkcmdb provides bkcmdb client.
Package bkcmdb provides bkcmdb client.
Package bknotice provides bknotice client.
Package bknotice provides bknotice client.
Package bkpaas provides bkpaas auth client.
Package bkpaas provides bkpaas auth client.
Package gse provides gse api client.
Package gse provides gse api client.
Package itsm xxx
Package itsm xxx

Jump to

Keyboard shortcuts

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