http_handler

package
v0.0.0-...-ecc5721 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	SuccessCode = iota
	AuthFailedErrorCode
	ParamInvalidErrorCode
	UnknownErrorCode
)
View Source
const (
	ConnResetRandom = "random"
	ConnResetStrict = "strict"
)
View Source
const (
	AuditEventDataType = "9003"
)

Variables

View Source
var ErrorDescriptions = map[int]string{
	SuccessCode:           "success",
	AuthFailedErrorCode:   "auth failed",
	ParamInvalidErrorCode: "param invalid",
	UnknownErrorCode:      "some errors occurred",
}

Functions

func ClusterList

func ClusterList(c *gin.Context)

func ConnCount

func ConnCount(c *gin.Context)

func ConnList

func ConnList(c *gin.Context)

func ConnReset

func ConnReset(c *gin.Context)

func ConnStat

func ConnStat(c *gin.Context)

func CreateResponse

func CreateResponse(c *gin.Context, code int, data interface{})

func PostCommand

func PostCommand(c *gin.Context)

func RDAudit

func RDAudit(c *gin.Context)

Types

type AuditEvent

type AuditEvent struct {
	ClusterID string    `json:"cluster_id"` // 集群 uuid,来自客户端证书中的 Subject CN(客户集群 uuid 及其证书由 console 生成和签发)
	Event     *v1.Event `json:"event"`      // k8s Event

	// 以下字段为 AgentCenter 追加的字段
	DataType string `json:"data_type"`
}

AuditEvent

type AuditLogWriter

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

func (*AuditLogWriter) Add

func (w *AuditLogWriter) Add(v *AuditEvent)

func (*AuditLogWriter) Init

func (w *AuditLogWriter) Init()

func (*AuditLogWriter) Run

func (w *AuditLogWriter) Run()

type CommandDetail

type CommandDetail struct {
	AgentCtrl int32       `json:"agent_ctrl,omitempty"`
	Task      *TaskMsg    `json:"task,omitempty"`
	Config    []ConfigMsg `json:"config,omitempty"`
}

type CommandRequest

type CommandRequest struct {
	AgentID string        `json:"agent_id" bson:"agent_id" binding:"required"`
	Command CommandDetail `json:"command" bson:"command" binding:"required"`
}

type ConfigMsg

type ConfigMsg struct {
	Name        string   `json:"name,omitempty"`
	Type        string   `json:"type,omitempty"`
	Version     string   `json:"version,omitempty"`
	SHA256      string   `json:"sha256,omitempty"`
	Signature   string   `json:"signature,omitempty"`
	DownloadURL []string `json:"download_url,omitempty"`
	Detail      string   `json:"detail,omitempty"`
}

type ConnStatRsp

type ConnStatRsp struct {
	AgentInfo   map[string]interface{}   `json:"agent_info"`
	PluginsInfo []map[string]interface{} `json:"plugins_info"`
}

type Res

type Res struct {
	Code    int      `json:"code"`
	Message string   `json:"msg"`
	Data    []string `json:"data"`
}

type ResetRequest

type ResetRequest struct {
	IDList []string `json:"id_list"`
	Type   string   `json:"type" binding:"required" `
	Count  int      `json:"count"`
}

type Response

type Response struct {
	Code    int         `json:"code"`
	Message string      `json:"msg"`
	Data    interface{} `json:"data"`
}

func (*Response) SetError

func (response *Response) SetError(code int)

type TaskMsg

type TaskMsg struct {
	DataType int32  `json:"data_type,omitempty"`
	Name     string `json:"name,omitempty"`
	Data     string `json:"data,omitempty"`
	Token    string `json:"token,omitempty"`
}

Jump to

Keyboard shortcuts

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