Documentation
¶
Overview ¶
Package node provides DTOs for node-related API operations.
Index ¶
- type Handler
- func (h *Handler) Commands(c *gin.Context)
- func (h *Handler) Drain(c *gin.Context)
- func (h *Handler) GetMeta(c *gin.Context)
- func (h *Handler) List(c *gin.Context)
- func (h *Handler) ListCommands(c *gin.Context)
- func (h *Handler) Restart(c *gin.Context)
- func (h *Handler) Undrain(c *gin.Context)
- func (h *Handler) UpdateMeta(c *gin.Context)
- type Node
- type NodeActionRequest
- type NodeCommand
- type NodeCommandsRequest
- type NodeCommandsResponse
- type NodeDrainRequest
- type NodeMetaRequest
- type NodeMetaResponse
- type NodeMetaUpdateRequest
- type NodesListRequest
- type NodesListResponse
- type ObjectInfo
- type ObjectsData
- type Service
- func (s *Service) Drain(ctx context.Context, req *NodeDrainRequest) error
- func (s *Service) GetMeta(ctx context.Context, req *NodeMetaRequest) (*NodeMetaResponse, error)
- func (s *Service) List(ctx context.Context, req *NodesListRequest) (*NodesListResponse, error)
- func (s *Service) ListCommands(ctx context.Context, req *NodeCommandsRequest) (*NodeCommandsResponse, error)
- func (s *Service) Restart(ctx context.Context, req *NodeActionRequest) error
- func (s *Service) Undrain(ctx context.Context, req *NodeActionRequest) error
- func (s *Service) UpdateMeta(ctx context.Context, req *NodeMetaUpdateRequest) (*NodeMetaResponse, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Handler ¶
type Handler struct {
// contains filtered or unexported fields
}
func NewHandler ¶
func (*Handler) ListCommands ¶
ListCommands handles the request to list node commands
func (*Handler) UpdateMeta ¶
UpdateMeta handles the request to update node metadata
type Node ¶
type Node struct {
ID string `json:"id"`
Name string `json:"name"`
Type string `json:"type"` // server, agent
Status string `json:"status"`
IP string `json:"ip"`
Port int `json:"port"`
Resources interface{} `json:"resources"`
UpdatedAt string `json:"updatedAt"`
}
Node represents a node in the system.
type NodeActionRequest ¶
type NodeActionRequest struct {
ID string `uri:"id"`
}
NodeActionRequest represents a request for node action.
type NodeCommand ¶
NodeCommand represents a command that can be executed on a node.
type NodeCommandsRequest ¶
type NodeCommandsRequest struct {
}
NodeCommandsRequest represents a request to list node commands.
type NodeCommandsResponse ¶
type NodeCommandsResponse struct {
Items []NodeCommand `json:"items"`
}
NodeCommandsResponse represents the response for listing node commands.
type NodeDrainRequest ¶
NodeDrainRequest represents a request to drain a node.
type NodeMetaRequest ¶
type NodeMetaRequest struct {
ID string `uri:"id"`
}
NodeMetaRequest represents a request to get node metadata.
type NodeMetaResponse ¶
type NodeMetaResponse struct {
Meta interface{} `json:"meta"`
}
NodeMetaResponse represents the response for getting node metadata.
type NodeMetaUpdateRequest ¶
type NodeMetaUpdateRequest struct {
ID string `uri:"id"`
Meta interface{} `json:"meta"`
}
NodeMetaUpdateRequest represents a request to update node metadata.
type NodesListRequest ¶
NodesListRequest represents a request to list nodes.
type NodesListResponse ¶
type NodesListResponse struct {
Items []Node `json:"items"`
}
NodesListResponse represents the response for listing nodes.
type ObjectInfo ¶
type ObjectInfo struct {
Key string `json:"key"`
Size int64 `json:"size"`
LastModified string `json:"last_modified"`
ETag string `json:"etag"`
StorageClass string `json:"storage_class"`
}
ObjectInfo represents information about a storage object.
type ObjectsData ¶
type ObjectsData struct {
Objects []ObjectInfo `json:"objects"`
Prefixes []string `json:"prefixes"`
IsTruncated bool `json:"is_truncated"`
NextMarker string `json:"next_marker"`
}
ObjectsData represents a paginated list of storage objects.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func NewService ¶
func NewService(svcCtx *svc.ServiceContext) *Service
func (*Service) Drain ¶
func (s *Service) Drain(ctx context.Context, req *NodeDrainRequest) error
Drain drains a node
func (*Service) GetMeta ¶
func (s *Service) GetMeta(ctx context.Context, req *NodeMetaRequest) (*NodeMetaResponse, error)
GetMeta returns the metadata of a node
func (*Service) List ¶
func (s *Service) List(ctx context.Context, req *NodesListRequest) (*NodesListResponse, error)
List returns the list of nodes
func (*Service) ListCommands ¶
func (s *Service) ListCommands(ctx context.Context, req *NodeCommandsRequest) (*NodeCommandsResponse, error)
ListCommands returns the list of available node commands
func (*Service) Restart ¶
func (s *Service) Restart(ctx context.Context, req *NodeActionRequest) error
Restart restarts a node
func (*Service) Undrain ¶
func (s *Service) Undrain(ctx context.Context, req *NodeActionRequest) error
Undrain undrains a node
func (*Service) UpdateMeta ¶
func (s *Service) UpdateMeta(ctx context.Context, req *NodeMetaUpdateRequest) (*NodeMetaResponse, error)
UpdateMeta updates the metadata of a node