node

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 6, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Create

func Create(c *gin.Context, in *CreateRequest)

Create 创建节点

func Delete

func Delete(c *gin.Context, in *DeleteRequest)

Delete 删除节点

func Detail

func Detail(c *gin.Context, in *DetailRequest)

Detail 获取节点详情(含密钥,仅超管)

func List

func List(c *gin.Context)

List 获取节点列表(不含密钥)

func Update

func Update(c *gin.Context, in *UpdateRequest)

Update 更新节点

Types

type CreateRequest

type CreateRequest struct {
	Name      string `json:"name" binding:"required"`
	Address   string `json:"address" binding:"required"`
	SecretKey string `json:"secret_key" binding:"required"`
	Enabled   *bool  `json:"enabled"`
}

CreateRequest 创建节点请求

type DeleteRequest

type DeleteRequest struct {
	Uuid string `json:"uuid" binding:"required"`
}

DeleteRequest 删除节点请求

type DetailRequest

type DetailRequest struct {
	Uuid string `json:"uuid" binding:"required"`
}

DetailRequest 节点详情请求

type DetailResponse

type DetailResponse = NodeDetailItem

DetailResponse 节点详情响应

type ListRequest

type ListRequest struct{}

ListRequest 节点列表请求

type ListResponse

type ListResponse struct {
	List []NodeItem `json:"list"`
}

ListResponse 节点列表响应

type NodeDetailItem

type NodeDetailItem struct {
	Uuid      string `json:"uuid"`
	Name      string `json:"name"`
	Address   string `json:"address"`
	SecretKey string `json:"secret_key"`
	Enabled   bool   `json:"enabled"`
	IsLocal   bool   `json:"is_local"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

NodeDetailItem 节点详情项(含密钥,仅超管可查看)

type NodeItem

type NodeItem struct {
	Uuid      string `json:"uuid"`
	Name      string `json:"name"`
	Address   string `json:"address"`
	Enabled   bool   `json:"enabled"`
	IsLocal   bool   `json:"is_local"`
	CreatedAt int64  `json:"created_at"`
	UpdatedAt int64  `json:"updated_at"`
}

NodeItem 节点列表项(不含密钥)

type UpdateRequest

type UpdateRequest struct {
	Uuid      string `json:"uuid" binding:"required"`
	Name      string `json:"name" binding:"required"`
	Address   string `json:"address" binding:"required"`
	SecretKey string `json:"secret_key" binding:"required"`
	Enabled   *bool  `json:"enabled"`
}

UpdateRequest 更新节点请求

Jump to

Keyboard shortcuts

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