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 process 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 GetNodeProcess200JSONResponse

type GetNodeProcess200JSONResponse ProcessCollectionResponse

func (GetNodeProcess200JSONResponse) VisitGetNodeProcessResponse

func (response GetNodeProcess200JSONResponse) VisitGetNodeProcessResponse(w http.ResponseWriter) error

type GetNodeProcess400JSONResponse

type GetNodeProcess400JSONResponse externalRef0.ErrorResponse

func (GetNodeProcess400JSONResponse) VisitGetNodeProcessResponse

func (response GetNodeProcess400JSONResponse) VisitGetNodeProcessResponse(w http.ResponseWriter) error

type GetNodeProcess401JSONResponse

type GetNodeProcess401JSONResponse externalRef0.ErrorResponse

func (GetNodeProcess401JSONResponse) VisitGetNodeProcessResponse

func (response GetNodeProcess401JSONResponse) VisitGetNodeProcessResponse(w http.ResponseWriter) error

type GetNodeProcess403JSONResponse

type GetNodeProcess403JSONResponse externalRef0.ErrorResponse

func (GetNodeProcess403JSONResponse) VisitGetNodeProcessResponse

func (response GetNodeProcess403JSONResponse) VisitGetNodeProcessResponse(w http.ResponseWriter) error

type GetNodeProcess500JSONResponse

type GetNodeProcess500JSONResponse externalRef0.ErrorResponse

func (GetNodeProcess500JSONResponse) VisitGetNodeProcessResponse

func (response GetNodeProcess500JSONResponse) VisitGetNodeProcessResponse(w http.ResponseWriter) error

type GetNodeProcessByPid200JSONResponse

type GetNodeProcessByPid200JSONResponse ProcessGetResponse

func (GetNodeProcessByPid200JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid200JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPid400JSONResponse

type GetNodeProcessByPid400JSONResponse externalRef0.ErrorResponse

func (GetNodeProcessByPid400JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid400JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPid401JSONResponse

type GetNodeProcessByPid401JSONResponse externalRef0.ErrorResponse

func (GetNodeProcessByPid401JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid401JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPid403JSONResponse

type GetNodeProcessByPid403JSONResponse externalRef0.ErrorResponse

func (GetNodeProcessByPid403JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid403JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPid404JSONResponse

type GetNodeProcessByPid404JSONResponse externalRef0.ErrorResponse

func (GetNodeProcessByPid404JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid404JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPid500JSONResponse

type GetNodeProcessByPid500JSONResponse externalRef0.ErrorResponse

func (GetNodeProcessByPid500JSONResponse) VisitGetNodeProcessByPidResponse

func (response GetNodeProcessByPid500JSONResponse) VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error

type GetNodeProcessByPidRequestObject

type GetNodeProcessByPidRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Pid      Pid      `json:"pid"`
}

type GetNodeProcessByPidResponseObject

type GetNodeProcessByPidResponseObject interface {
	VisitGetNodeProcessByPidResponse(w http.ResponseWriter) error
}

type GetNodeProcessRequestObject

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

type GetNodeProcessResponseObject

type GetNodeProcessResponseObject interface {
	VisitGetNodeProcessResponse(w http.ResponseWriter) error
}

type Hostname

type Hostname = string

Hostname defines model for Hostname.

type Pid

type Pid = int

Pid defines model for Pid.

type PostNodeProcessSignal200JSONResponse

type PostNodeProcessSignal200JSONResponse ProcessSignalResponse

func (PostNodeProcessSignal200JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal200JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignal400JSONResponse

type PostNodeProcessSignal400JSONResponse externalRef0.ErrorResponse

func (PostNodeProcessSignal400JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal400JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignal401JSONResponse

type PostNodeProcessSignal401JSONResponse externalRef0.ErrorResponse

func (PostNodeProcessSignal401JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal401JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignal403JSONResponse

type PostNodeProcessSignal403JSONResponse externalRef0.ErrorResponse

func (PostNodeProcessSignal403JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal403JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignal404JSONResponse

type PostNodeProcessSignal404JSONResponse externalRef0.ErrorResponse

func (PostNodeProcessSignal404JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal404JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignal500JSONResponse

type PostNodeProcessSignal500JSONResponse externalRef0.ErrorResponse

func (PostNodeProcessSignal500JSONResponse) VisitPostNodeProcessSignalResponse

func (response PostNodeProcessSignal500JSONResponse) VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error

type PostNodeProcessSignalJSONRequestBody

type PostNodeProcessSignalJSONRequestBody = ProcessSignalRequest

PostNodeProcessSignalJSONRequestBody defines body for PostNodeProcessSignal for application/json ContentType.

type PostNodeProcessSignalRequestObject

type PostNodeProcessSignalRequestObject struct {
	Hostname Hostname `json:"hostname"`
	Pid      Pid      `json:"pid"`
	Body     *PostNodeProcessSignalJSONRequestBody
}

type PostNodeProcessSignalResponseObject

type PostNodeProcessSignalResponseObject interface {
	VisitPostNodeProcessSignalResponse(w http.ResponseWriter) error
}

type ProcessCollectionResponse

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

ProcessCollectionResponse defines model for ProcessCollectionResponse.

type ProcessEntry

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

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

	// Processes List of processes on this agent.
	Processes *[]ProcessInfo `json:"processes,omitempty"`

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

ProcessEntry Process list result for a single agent.

type ProcessEntryStatus

type ProcessEntryStatus string

ProcessEntryStatus The status of the operation for this host.

const (
	ProcessEntryStatusFailed  ProcessEntryStatus = "failed"
	ProcessEntryStatusOk      ProcessEntryStatus = "ok"
	ProcessEntryStatusSkipped ProcessEntryStatus = "skipped"
)

Defines values for ProcessEntryStatus.

type ProcessGetEntry

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

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

	// Process Information about a running process.
	Process *ProcessInfo `json:"process,omitempty"`

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

ProcessGetEntry Process get result for a single agent.

type ProcessGetEntryStatus

type ProcessGetEntryStatus string

ProcessGetEntryStatus The status of the operation for this host.

const (
	ProcessGetEntryStatusFailed  ProcessGetEntryStatus = "failed"
	ProcessGetEntryStatusOk      ProcessGetEntryStatus = "ok"
	ProcessGetEntryStatusSkipped ProcessGetEntryStatus = "skipped"
)

Defines values for ProcessGetEntryStatus.

type ProcessGetResponse

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

ProcessGetResponse defines model for ProcessGetResponse.

type ProcessInfo

type ProcessInfo struct {
	// Command Full command line.
	Command *string `json:"command,omitempty"`

	// CpuPercent CPU usage percentage.
	CpuPercent *float64 `json:"cpu_percent,omitempty"`

	// MemPercent Memory usage percentage.
	MemPercent *float32 `json:"mem_percent,omitempty"`

	// MemRss Resident set size in bytes.
	MemRss *int64 `json:"mem_rss,omitempty"`

	// Name Process name.
	Name *string `json:"name,omitempty"`

	// Pid Process identifier.
	Pid *int `json:"pid,omitempty"`

	// StartTime Process start time.
	StartTime *string `json:"start_time,omitempty"`

	// State Process state.
	State *string `json:"state,omitempty"`

	// User User running the process.
	User *string `json:"user,omitempty"`
}

ProcessInfo Information about a running process.

type ProcessSignalRequest

type ProcessSignalRequest struct {
	// Signal Signal name to send to the process.
	Signal ProcessSignalRequestSignal `json:"signal" validate:"required,oneof=TERM KILL HUP INT USR1 USR2"`
}

ProcessSignalRequest defines model for ProcessSignalRequest.

type ProcessSignalRequestSignal

type ProcessSignalRequestSignal string

ProcessSignalRequestSignal Signal name to send to the process.

Defines values for ProcessSignalRequestSignal.

type ProcessSignalResponse

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

ProcessSignalResponse defines model for ProcessSignalResponse.

type ProcessSignalResult

type ProcessSignalResult struct {
	// Changed Whether the operation modified system state.
	Changed *bool `json:"changed,omitempty"`

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

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

	// Pid Process identifier.
	Pid *int `json:"pid,omitempty"`

	// Signal Signal that was sent.
	Signal *string `json:"signal,omitempty"`

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

ProcessSignalResult Result of sending a signal to a process.

type ProcessSignalResultStatus

type ProcessSignalResultStatus string

ProcessSignalResultStatus The status of the operation for this host.

const (
	Failed  ProcessSignalResultStatus = "failed"
	Ok      ProcessSignalResultStatus = "ok"
	Skipped ProcessSignalResultStatus = "skipped"
)

Defines values for ProcessSignalResultStatus.

type ServerInterface

type ServerInterface interface {
	// List processes
	// (GET /api/node/{hostname}/process)
	GetNodeProcess(ctx echo.Context, hostname Hostname) error
	// Get process by PID
	// (GET /api/node/{hostname}/process/{pid})
	GetNodeProcessByPid(ctx echo.Context, hostname Hostname, pid Pid) error
	// Send signal to process
	// (POST /api/node/{hostname}/process/{pid}/signal)
	PostNodeProcessSignal(ctx echo.Context, hostname Hostname, pid Pid) 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) GetNodeProcess

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

GetNodeProcess converts echo context to params.

func (*ServerInterfaceWrapper) GetNodeProcessByPid

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

GetNodeProcessByPid converts echo context to params.

func (*ServerInterfaceWrapper) PostNodeProcessSignal

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

PostNodeProcessSignal converts echo context to params.

type StrictHandlerFunc

type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc

type StrictMiddlewareFunc

type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc

type StrictServerInterface

type StrictServerInterface interface {
	// List processes
	// (GET /api/node/{hostname}/process)
	GetNodeProcess(ctx context.Context, request GetNodeProcessRequestObject) (GetNodeProcessResponseObject, error)
	// Get process by PID
	// (GET /api/node/{hostname}/process/{pid})
	GetNodeProcessByPid(ctx context.Context, request GetNodeProcessByPidRequestObject) (GetNodeProcessByPidResponseObject, error)
	// Send signal to process
	// (POST /api/node/{hostname}/process/{pid}/signal)
	PostNodeProcessSignal(ctx context.Context, request PostNodeProcessSignalRequestObject) (PostNodeProcessSignalResponseObject, error)
}

StrictServerInterface represents all server handlers.

Jump to

Keyboard shortcuts

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