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.4.1 DO NOT EDIT.
Index ¶
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type DNSConfigResponse
- type DNSConfigUpdateRequest
- type EchoRouter
- type NetworkErrorResponse
- type PingResponse
- type PostNetworkPingJSONBody
- type PostNetworkPingJSONRequestBody
- type PutNetworkDNSJSONRequestBody
- type ServerInterface
- type ServerInterfaceWrapper
Constants ¶
This section is empty.
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 DNSConfigResponse ¶
type DNSConfigResponse struct { // SearchDomains List of search domains. SearchDomains *[]string `json:"search_domains,omitempty"` // Servers List of configured DNS servers. Servers *[]string `json:"servers,omitempty"` }
DNSConfigResponse defines model for DNSConfigResponse.
type DNSConfigUpdateRequest ¶
type DNSConfigUpdateRequest struct { // InterfaceName The name of the network interface to apply DNS configuration to. Must only contain letters and numbers. InterfaceName *string `json:"interface_name,omitempty" validate:"required,alphanum"` // SearchDomains New list of search domains to configure. SearchDomains *[]string `json:"search_domains,omitempty" validate:"required_without=Servers,omitempty,dive,hostname,min=1"` // Servers New list of DNS servers to configure. Servers *[]string `json:"servers,omitempty" validate:"required_without=SearchDomains,omitempty,dive,ip,min=1"` }
DNSConfigUpdateRequest defines model for DNSConfigUpdateRequest.
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 NetworkErrorResponse ¶
type NetworkErrorResponse struct { // Code The error code. Code int `json:"code"` // Details Additional details about the error, specifying which component failed. Details *string `json:"details,omitempty"` // Error A description of the error that occurred. Error string `json:"error"` }
NetworkErrorResponse defines model for network.ErrorResponse.
type PingResponse ¶
type PingResponse struct { // AvgRtt Average round-trip time as a string in Go's time.Duration format. AvgRtt *string `json:"avg_rtt,omitempty"` // MaxRtt Maximum round-trip time as a string in Go's time.Duration format. MaxRtt *string `json:"max_rtt,omitempty"` // MinRtt Minimum round-trip time as a string in Go's time.Duration format. MinRtt *string `json:"min_rtt,omitempty"` // PacketLoss Percentage of packet loss. PacketLoss *float64 `json:"packet_loss,omitempty"` // PacketsReceived Number of packets received. PacketsReceived *int `json:"packets_received,omitempty"` // PacketsSent Number of packets sent. PacketsSent *int `json:"packets_sent,omitempty"` }
PingResponse defines model for PingResponse.
type PostNetworkPingJSONBody ¶
type PostNetworkPingJSONBody struct { // Address The IP address of the server to ping. Supports both IPv4 and IPv6. Address string `json:"address" validate:"required,ip"` }
PostNetworkPingJSONBody defines parameters for PostNetworkPing.
type PostNetworkPingJSONRequestBody ¶
type PostNetworkPingJSONRequestBody PostNetworkPingJSONBody
PostNetworkPingJSONRequestBody defines body for PostNetworkPing for application/json ContentType.
type PutNetworkDNSJSONRequestBody ¶
type PutNetworkDNSJSONRequestBody = DNSConfigUpdateRequest
PutNetworkDNSJSONRequestBody defines body for PutNetworkDNS for application/json ContentType.
type ServerInterface ¶
type ServerInterface interface { // Update DNS servers // (PUT /network/dns) PutNetworkDNS(ctx echo.Context) error // List DNS servers // (GET /network/dns/{interfaceName}) GetNetworkDNSByInterface(ctx echo.Context, interfaceName string) error // Ping a remote server // (POST /network/ping) PostNetworkPing(ctx echo.Context) error }
ServerInterface represents all server handlers.
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) GetNetworkDNSByInterface ¶
func (w *ServerInterfaceWrapper) GetNetworkDNSByInterface(ctx echo.Context) error
GetNetworkDNSByInterface converts echo context to params.
func (*ServerInterfaceWrapper) PostNetworkPing ¶
func (w *ServerInterfaceWrapper) PostNetworkPing(ctx echo.Context) error
PostNetworkPing converts echo context to params.
func (*ServerInterfaceWrapper) PutNetworkDNS ¶
func (w *ServerInterfaceWrapper) PutNetworkDNS(ctx echo.Context) error
PutNetworkDNS converts echo context to params.