component

package
v0.0.0-...-c91c74a Latest Latest
Warning

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

Go to latest
Published: Apr 30, 2024 License: MIT Imports: 19 Imported by: 0

Documentation

Overview

Package component get client

Index

Constants

View Source
const (

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

Variables

This section is empty.

Functions

func GetAuditClient

func GetAuditClient() *audit.Client

GetAuditClient 获取审计客户端

func GetBKAPIAuthorization

func GetBKAPIAuthorization() (string, error)

GetBKAPIAuthorization generate bk api auth header, X-Bkapi-Authorization

func GetClient

func GetClient() *resty.Client

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

func GetNoTraceClient

func GetNoTraceClient() *resty.Client

GetNoTraceClient 监控平台使用 trace id 做了缓存,在并发情况下,相同 trace id 的请求数据可能相同,导致数据不准确, 这种情况不传递 trace id,待监控平台解决后,再传递 trace id

func UnmarshalBKResult

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

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

Types

type AuthInfo

type AuthInfo struct {
	BkAppCode   string `json:"bk_app_code"`
	BkAppSecret string `json:"bk_app_secret"`
	BkUserName  string `json:"bk_username"`
}

AuthInfo auth info, issue https://github.com/TencentBlueKing/blueking-apigateway/issues/325

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 集群操作
Package bcs 集群操作
Package bcsmonitor monitor query
Package bcsmonitor monitor query
Package bklog log
Package bklog log
Package bkmonitor bk_monitor query
Package bkmonitor bk_monitor query
Package iam client
Package iam client
Package k8sclient get k8s client
Package k8sclient get k8s client
Package promclient prom client
Package promclient prom client
Package suanliclient suanli client
Package suanliclient suanli client

Jump to

Keyboard shortcuts

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