gen

package
v0.0.0-...-60df2ce Latest Latest
Warning

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

Go to latest
Published: Feb 28, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gen provides primitives to interact with the openapi HTTP API.

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.1 DO NOT EDIT.

Package gen contains generated code for the agent API.

Index

Constants

View Source
const (
	BearerAuthScopes = "BearerAuth.Scopes"
)

Variables

This section is empty.

Functions

func RegisterHandlers

func RegisterHandlers(router EchoRouter, si ServerInterface)

RegisterHandlers adds each server route to the EchoRouter.

func RegisterHandlersWithBaseURL

func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)

Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.

Types

type AgentInfo

type AgentInfo struct {
	// Hostname The hostname of the agent.
	Hostname string `json:"hostname"`

	// Labels Key-value labels configured on the agent.
	Labels *map[string]string `json:"labels,omitempty"`

	// LoadAverage The system load averages for 1, 5, and 15 minutes.
	LoadAverage *LoadAverageResponse `json:"load_average,omitempty"`

	// Memory Memory usage information.
	Memory *MemoryResponse `json:"memory,omitempty"`

	// OsInfo Operating system information.
	OsInfo *OSInfoResponse `json:"os_info,omitempty"`

	// RegisteredAt When the agent last refreshed its heartbeat.
	RegisteredAt *time.Time `json:"registered_at,omitempty"`

	// StartedAt When the agent process started.
	StartedAt *time.Time `json:"started_at,omitempty"`

	// Status The current status of the agent.
	Status AgentInfoStatus `json:"status"`

	// Uptime The system uptime.
	Uptime *string `json:"uptime,omitempty"`
}

AgentInfo defines model for AgentInfo.

type AgentInfoStatus

type AgentInfoStatus string

AgentInfoStatus The current status of the agent.

const (
	NotReady AgentInfoStatus = "NotReady"
	Ready    AgentInfoStatus = "Ready"
)

Defines values for AgentInfoStatus.

type EchoRouter

type EchoRouter interface {
	CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
	TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}

This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration

type ErrorResponse

type ErrorResponse = externalRef0.ErrorResponse

ErrorResponse defines model for ErrorResponse.

type GetAgent200JSONResponse

type GetAgent200JSONResponse ListAgentsResponse

func (GetAgent200JSONResponse) VisitGetAgentResponse

func (response GetAgent200JSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error

type GetAgent401JSONResponse

type GetAgent401JSONResponse externalRef0.ErrorResponse

func (GetAgent401JSONResponse) VisitGetAgentResponse

func (response GetAgent401JSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error

type GetAgent403JSONResponse

type GetAgent403JSONResponse externalRef0.ErrorResponse

func (GetAgent403JSONResponse) VisitGetAgentResponse

func (response GetAgent403JSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error

type GetAgent500JSONResponse

type GetAgent500JSONResponse externalRef0.ErrorResponse

func (GetAgent500JSONResponse) VisitGetAgentResponse

func (response GetAgent500JSONResponse) VisitGetAgentResponse(w http.ResponseWriter) error

type GetAgentDetails200JSONResponse

type GetAgentDetails200JSONResponse AgentInfo

func (GetAgentDetails200JSONResponse) VisitGetAgentDetailsResponse

func (response GetAgentDetails200JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error

type GetAgentDetails401JSONResponse

type GetAgentDetails401JSONResponse externalRef0.ErrorResponse

func (GetAgentDetails401JSONResponse) VisitGetAgentDetailsResponse

func (response GetAgentDetails401JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error

type GetAgentDetails403JSONResponse

type GetAgentDetails403JSONResponse externalRef0.ErrorResponse

func (GetAgentDetails403JSONResponse) VisitGetAgentDetailsResponse

func (response GetAgentDetails403JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error

type GetAgentDetails404JSONResponse

type GetAgentDetails404JSONResponse externalRef0.ErrorResponse

func (GetAgentDetails404JSONResponse) VisitGetAgentDetailsResponse

func (response GetAgentDetails404JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error

type GetAgentDetails500JSONResponse

type GetAgentDetails500JSONResponse externalRef0.ErrorResponse

func (GetAgentDetails500JSONResponse) VisitGetAgentDetailsResponse

func (response GetAgentDetails500JSONResponse) VisitGetAgentDetailsResponse(w http.ResponseWriter) error

type GetAgentDetailsRequestObject

type GetAgentDetailsRequestObject struct {
	Hostname string `json:"hostname"`
}

type GetAgentDetailsResponseObject

type GetAgentDetailsResponseObject interface {
	VisitGetAgentDetailsResponse(w http.ResponseWriter) error
}

type GetAgentRequestObject

type GetAgentRequestObject struct {
}

type GetAgentResponseObject

type GetAgentResponseObject interface {
	VisitGetAgentResponse(w http.ResponseWriter) error
}

type ListAgentsResponse

type ListAgentsResponse struct {
	Agents []AgentInfo `json:"agents"`

	// Total Total number of active agents.
	Total int `json:"total"`
}

ListAgentsResponse defines model for ListAgentsResponse.

type LoadAverageResponse

type LoadAverageResponse struct {
	// N15min Load average for the last 15 minutes.
	N15min float32 `json:"15min"`

	// N1min Load average for the last 1 minute.
	N1min float32 `json:"1min"`

	// N5min Load average for the last 5 minutes.
	N5min float32 `json:"5min"`
}

LoadAverageResponse The system load averages for 1, 5, and 15 minutes.

type MemoryResponse

type MemoryResponse struct {
	// Free Free memory in bytes.
	Free int `json:"free"`

	// Total Total memory in bytes.
	Total int `json:"total"`

	// Used Used memory in bytes.
	Used int `json:"used"`
}

MemoryResponse Memory usage information.

type OSInfoResponse

type OSInfoResponse struct {
	// Distribution The name of the Linux distribution.
	Distribution string `json:"distribution"`

	// Version The version of the Linux distribution.
	Version string `json:"version"`
}

OSInfoResponse Operating system information.

type ServerInterface

type ServerInterface interface {
	// List active agents
	// (GET /agent)
	GetAgent(ctx echo.Context) error
	// Get agent details
	// (GET /agent/{hostname})
	GetAgentDetails(ctx echo.Context, hostname string) error
}

ServerInterface represents all server handlers.

func NewStrictHandler

func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface

type ServerInterfaceWrapper

type ServerInterfaceWrapper struct {
	Handler ServerInterface
}

ServerInterfaceWrapper converts echo contexts to parameters.

func (*ServerInterfaceWrapper) GetAgent

func (w *ServerInterfaceWrapper) GetAgent(ctx echo.Context) error

GetAgent converts echo context to params.

func (*ServerInterfaceWrapper) GetAgentDetails

func (w *ServerInterfaceWrapper) GetAgentDetails(ctx echo.Context) error

GetAgentDetails converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// List active agents
	// (GET /agent)
	GetAgent(ctx context.Context, request GetAgentRequestObject) (GetAgentResponseObject, error)
	// Get agent details
	// (GET /agent/{hostname})
	GetAgentDetails(ctx context.Context, request GetAgentDetailsRequestObject) (GetAgentDetailsResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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