capability

package
v1.2.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Oct 22, 2026 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Overview

Package capability 提供当前服务端操作能力查询。 Package capability provides discovery of operations supported by the current server.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func List

func List(c *gin.Context)

List 返回服务端登记操作及其针对当前用户的权限结果。 List returns registered server operations and their permission result for the current user. @Tags capability @Produce json @Success 200 {object} Response @Router /api/v1/capabilities [get]

func Version added in v1.0.0

func Version(c *gin.Context)

Version 返回当前服务端产品版本,无需登录(版本非敏感)。 Version returns the current server product version without authentication (version is non-sensitive). @Tags capability @Produce json @Success 200 {object} VersionResponse @Router /api/v1/version [get]

Types

type Data

type Data struct {
	APIVersion       string      `json:"api_version"`
	ServerVersion    string      `json:"server_version"`
	GitCommit        string      `json:"git_commit"`
	BuildTime        string      `json:"build_time"`
	MinCLIVersion    string      `json:"min_cli_version"`
	RegistryRevision string      `json:"registry_revision"`
	Operations       []Operation `json:"operations"`
}

Data 是能力查询返回的版本和操作列表。 Data contains server versions and the supported operation list.

type Operation

type Operation struct {
	OperationID string                  `json:"operation_id"`
	Revision    int                     `json:"revision"`
	Allowed     bool                    `json:"allowed"`
	DenialCode  string                  `json:"denial_code,omitempty"`
	Mode        operation.OperationMode `json:"mode"`
	Risk        operation.RiskLevel     `json:"risk"`
	Impact      *operation.ImpactSpec   `json:"impact,omitempty"`
}

Operation 描述一个操作对当前用户是否可用。 Operation describes whether an operation is available to the current user.

type Response

type Response struct {
	ErrorMsg string `json:"error_msg"`
	Data     Data   `json:"data"`
}

Response 是能力查询的标准 API 响应。 Response is the standard API response for capability discovery.

type VersionData added in v1.0.0

type VersionData struct {
	Version       string `json:"version"`
	GitCommit     string `json:"git_commit"`
	BuildTime     string `json:"build_time"`
	MinCLIVersion string `json:"min_cli_version"`
}

VersionData 是公开的产品版本信息(不含操作能力列表)。 VersionData is public product version info without the operation capability list.

type VersionResponse added in v1.0.0

type VersionResponse struct {
	ErrorMsg string      `json:"error_msg"`
	Data     VersionData `json:"data"`
}

VersionResponse 是产品版本查询的标准 API 响应。 VersionResponse is the standard API response for product version discovery.

Jump to

Keyboard shortcuts

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