gen

package
v0.0.0-...-36c55c0 Latest Latest
Warning

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

Go to latest
Published: Apr 11, 2026 License: MIT Imports: 9 Imported by: 0

Documentation

Overview

Package gen contains generated code for the log API.

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.

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 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 GetNodeLog200JSONResponse

type GetNodeLog200JSONResponse LogCollectionResponse

func (GetNodeLog200JSONResponse) VisitGetNodeLogResponse

func (response GetNodeLog200JSONResponse) VisitGetNodeLogResponse(w http.ResponseWriter) error

type GetNodeLog400JSONResponse

type GetNodeLog400JSONResponse externalRef0.ErrorResponse

func (GetNodeLog400JSONResponse) VisitGetNodeLogResponse

func (response GetNodeLog400JSONResponse) VisitGetNodeLogResponse(w http.ResponseWriter) error

type GetNodeLog401JSONResponse

type GetNodeLog401JSONResponse externalRef0.ErrorResponse

func (GetNodeLog401JSONResponse) VisitGetNodeLogResponse

func (response GetNodeLog401JSONResponse) VisitGetNodeLogResponse(w http.ResponseWriter) error

type GetNodeLog403JSONResponse

type GetNodeLog403JSONResponse externalRef0.ErrorResponse

func (GetNodeLog403JSONResponse) VisitGetNodeLogResponse

func (response GetNodeLog403JSONResponse) VisitGetNodeLogResponse(w http.ResponseWriter) error

type GetNodeLog500JSONResponse

type GetNodeLog500JSONResponse externalRef0.ErrorResponse

func (GetNodeLog500JSONResponse) VisitGetNodeLogResponse

func (response GetNodeLog500JSONResponse) VisitGetNodeLogResponse(w http.ResponseWriter) error

type GetNodeLogParams

type GetNodeLogParams struct {
	// Lines Maximum number of log lines to return.
	Lines *int `form:"lines,omitempty" json:"lines,omitempty" validate:"omitempty,min=1,max=10000"`

	// Since Return log entries since this time. Accepts systemd time specifications (e.g., "1h", "2026-01-01 00:00:00").
	Since *string `form:"since,omitempty" json:"since,omitempty" validate:"omitempty"`

	// Priority Filter by log priority level (e.g., "err", "warning", "info", "debug").
	Priority *string `form:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,oneof=emerg alert crit err warning notice info debug"`
}

GetNodeLogParams defines parameters for GetNodeLog.

type GetNodeLogRequestObject

type GetNodeLogRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Params   GetNodeLogParams
}

type GetNodeLogResponseObject

type GetNodeLogResponseObject interface {
	VisitGetNodeLogResponse(w http.ResponseWriter) error
}

type GetNodeLogSource200JSONResponse

type GetNodeLogSource200JSONResponse LogSourceCollectionResponse

func (GetNodeLogSource200JSONResponse) VisitGetNodeLogSourceResponse

func (response GetNodeLogSource200JSONResponse) VisitGetNodeLogSourceResponse(w http.ResponseWriter) error

type GetNodeLogSource400JSONResponse

type GetNodeLogSource400JSONResponse externalRef0.ErrorResponse

func (GetNodeLogSource400JSONResponse) VisitGetNodeLogSourceResponse

func (response GetNodeLogSource400JSONResponse) VisitGetNodeLogSourceResponse(w http.ResponseWriter) error

type GetNodeLogSource401JSONResponse

type GetNodeLogSource401JSONResponse externalRef0.ErrorResponse

func (GetNodeLogSource401JSONResponse) VisitGetNodeLogSourceResponse

func (response GetNodeLogSource401JSONResponse) VisitGetNodeLogSourceResponse(w http.ResponseWriter) error

type GetNodeLogSource403JSONResponse

type GetNodeLogSource403JSONResponse externalRef0.ErrorResponse

func (GetNodeLogSource403JSONResponse) VisitGetNodeLogSourceResponse

func (response GetNodeLogSource403JSONResponse) VisitGetNodeLogSourceResponse(w http.ResponseWriter) error

type GetNodeLogSource500JSONResponse

type GetNodeLogSource500JSONResponse externalRef0.ErrorResponse

func (GetNodeLogSource500JSONResponse) VisitGetNodeLogSourceResponse

func (response GetNodeLogSource500JSONResponse) VisitGetNodeLogSourceResponse(w http.ResponseWriter) error

type GetNodeLogSourceRequestObject

type GetNodeLogSourceRequestObject struct {
	Hostname Hostname `json:"hostname"`
}

type GetNodeLogSourceResponseObject

type GetNodeLogSourceResponseObject interface {
	VisitGetNodeLogSourceResponse(w http.ResponseWriter) error
}

type GetNodeLogUnit200JSONResponse

type GetNodeLogUnit200JSONResponse LogCollectionResponse

func (GetNodeLogUnit200JSONResponse) VisitGetNodeLogUnitResponse

func (response GetNodeLogUnit200JSONResponse) VisitGetNodeLogUnitResponse(w http.ResponseWriter) error

type GetNodeLogUnit400JSONResponse

type GetNodeLogUnit400JSONResponse externalRef0.ErrorResponse

func (GetNodeLogUnit400JSONResponse) VisitGetNodeLogUnitResponse

func (response GetNodeLogUnit400JSONResponse) VisitGetNodeLogUnitResponse(w http.ResponseWriter) error

type GetNodeLogUnit401JSONResponse

type GetNodeLogUnit401JSONResponse externalRef0.ErrorResponse

func (GetNodeLogUnit401JSONResponse) VisitGetNodeLogUnitResponse

func (response GetNodeLogUnit401JSONResponse) VisitGetNodeLogUnitResponse(w http.ResponseWriter) error

type GetNodeLogUnit403JSONResponse

type GetNodeLogUnit403JSONResponse externalRef0.ErrorResponse

func (GetNodeLogUnit403JSONResponse) VisitGetNodeLogUnitResponse

func (response GetNodeLogUnit403JSONResponse) VisitGetNodeLogUnitResponse(w http.ResponseWriter) error

type GetNodeLogUnit500JSONResponse

type GetNodeLogUnit500JSONResponse externalRef0.ErrorResponse

func (GetNodeLogUnit500JSONResponse) VisitGetNodeLogUnitResponse

func (response GetNodeLogUnit500JSONResponse) VisitGetNodeLogUnitResponse(w http.ResponseWriter) error

type GetNodeLogUnitParams

type GetNodeLogUnitParams struct {
	// Lines Maximum number of log lines to return.
	Lines *int `form:"lines,omitempty" json:"lines,omitempty" validate:"omitempty,min=1,max=10000"`

	// Since Return log entries since this time. Accepts systemd time specifications (e.g., "1h", "2026-01-01 00:00:00").
	Since *string `form:"since,omitempty" json:"since,omitempty" validate:"omitempty"`

	// Priority Filter by log priority level (e.g., "err", "warning", "info", "debug").
	Priority *string `form:"priority,omitempty" json:"priority,omitempty" validate:"omitempty,oneof=emerg alert crit err warning notice info debug"`
}

GetNodeLogUnitParams defines parameters for GetNodeLogUnit.

type GetNodeLogUnitRequestObject

type GetNodeLogUnitRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Name     UnitName `json:"name"`
	Params   GetNodeLogUnitParams
}

type GetNodeLogUnitResponseObject

type GetNodeLogUnitResponseObject interface {
	VisitGetNodeLogUnitResponse(w http.ResponseWriter) error
}

type Hostname

type Hostname = string

Hostname defines model for Hostname.

type LogCollectionResponse

type LogCollectionResponse struct {
	// JobId The job ID used to process this request.
	JobId   *openapi_types.UUID `json:"job_id,omitempty"`
	Results []LogResultEntry    `json:"results"`
}

LogCollectionResponse defines model for LogCollectionResponse.

type LogEntryInfo

type LogEntryInfo struct {
	// Hostname Hostname of the system that produced this entry.
	Hostname *string `json:"hostname,omitempty"`

	// Message Log message text.
	Message *string `json:"message,omitempty"`

	// Pid Process identifier that produced this entry.
	Pid *int `json:"pid,omitempty"`

	// Priority Log priority level.
	Priority *string `json:"priority,omitempty"`

	// Timestamp Log entry timestamp.
	Timestamp *string `json:"timestamp,omitempty"`

	// Unit Systemd unit that produced this entry.
	Unit *string `json:"unit,omitempty"`
}

LogEntryInfo A single log entry from the system journal.

type LogResultEntry

type LogResultEntry struct {
	// Entries Log entries from this agent.
	Entries *[]LogEntryInfo `json:"entries,omitempty"`

	// Error Error message if the agent failed.
	Error *string `json:"error,omitempty"`

	// Hostname The hostname of the agent.
	Hostname string `json:"hostname"`

	// Status The status of the operation for this host.
	Status LogResultEntryStatus `json:"status"`
}

LogResultEntry Log result for a single agent.

type LogResultEntryStatus

type LogResultEntryStatus string

LogResultEntryStatus The status of the operation for this host.

const (
	LogResultEntryStatusFailed  LogResultEntryStatus = "failed"
	LogResultEntryStatusOk      LogResultEntryStatus = "ok"
	LogResultEntryStatusSkipped LogResultEntryStatus = "skipped"
)

Defines values for LogResultEntryStatus.

type LogSourceCollectionResponse

type LogSourceCollectionResponse struct {
	// JobId The job ID used to process this request.
	JobId   *openapi_types.UUID `json:"job_id,omitempty"`
	Results []LogSourceEntry    `json:"results"`
}

LogSourceCollectionResponse defines model for LogSourceCollectionResponse.

type LogSourceEntry

type LogSourceEntry struct {
	// Error Error message if the agent failed.
	Error *string `json:"error,omitempty"`

	// Hostname The hostname of the agent.
	Hostname string `json:"hostname"`

	// Sources Unique syslog identifiers on this agent.
	Sources *[]string `json:"sources,omitempty"`

	// Status The status of the operation for this host.
	Status LogSourceEntryStatus `json:"status"`
}

LogSourceEntry Log source result for a single agent.

type LogSourceEntryStatus

type LogSourceEntryStatus string

LogSourceEntryStatus The status of the operation for this host.

const (
	LogSourceEntryStatusFailed  LogSourceEntryStatus = "failed"
	LogSourceEntryStatusOk      LogSourceEntryStatus = "ok"
	LogSourceEntryStatusSkipped LogSourceEntryStatus = "skipped"
)

Defines values for LogSourceEntryStatus.

type ServerInterface

type ServerInterface interface {
	// Get system log entries
	// (GET /api/node/{hostname}/log)
	GetNodeLog(ctx echo.Context, hostname Hostname, params GetNodeLogParams) error
	// List log sources
	// (GET /api/node/{hostname}/log/source)
	GetNodeLogSource(ctx echo.Context, hostname Hostname) error
	// Get log entries for a systemd unit
	// (GET /api/node/{hostname}/log/unit/{name})
	GetNodeLogUnit(ctx echo.Context, hostname Hostname, name UnitName, params GetNodeLogUnitParams) 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) GetNodeLog

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

GetNodeLog converts echo context to params.

func (*ServerInterfaceWrapper) GetNodeLogSource

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

GetNodeLogSource converts echo context to params.

func (*ServerInterfaceWrapper) GetNodeLogUnit

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

GetNodeLogUnit converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// Get system log entries
	// (GET /api/node/{hostname}/log)
	GetNodeLog(ctx context.Context, request GetNodeLogRequestObject) (GetNodeLogResponseObject, error)
	// List log sources
	// (GET /api/node/{hostname}/log/source)
	GetNodeLogSource(ctx context.Context, request GetNodeLogSourceRequestObject) (GetNodeLogSourceResponseObject, error)
	// Get log entries for a systemd unit
	// (GET /api/node/{hostname}/log/unit/{name})
	GetNodeLogUnit(ctx context.Context, request GetNodeLogUnitRequestObject) (GetNodeLogUnitResponseObject, error)
}

StrictServerInterface represents all server handlers.

type UnitName

type UnitName = string

UnitName defines model for UnitName.

Jump to

Keyboard shortcuts

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