Documentation
¶
Overview ¶
Package monitorapi provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.7.2 DO NOT EDIT.
Index ¶
- Constants
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
- func NewGetNodeMonitorRequest(server string) (*http.Request, error)
- type Client
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- type ClientWithResponsesInterface
- type GetNodeMonitor200JSONResponse
- type GetNodeMonitor401JSONResponse
- type GetNodeMonitor405Response
- type GetNodeMonitor503JSONResponse
- type GetNodeMonitorRequestObject
- type GetNodeMonitorResponse
- type GetNodeMonitorResponseObject
- type HttpRequestDoer
- type InvalidParamFormatError
- type MiddlewareFunc
- type MonitorError
- type MonitorErrorError
- type NodeSnapshot
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type ServeMux
- type ServerInterface
- type ServerInterfaceWrapper
- type StdHTTPServerOptions
- type StrictHTTPServerOptions
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
const (
MonitorTokenScopes monitorTokenContextKey = "MonitorToken.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func Handler ¶
func Handler(si ServerInterface) http.Handler
Handler creates http.Handler with routing matching OpenAPI spec.
func HandlerFromMux ¶
func HandlerFromMux(si ServerInterface, m ServeMux) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerFromMuxWithBaseURL ¶
func HandlerFromMuxWithBaseURL(si ServerInterface, m ServeMux, baseURL string) http.Handler
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options StdHTTPServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type Client ¶
type Client struct {
// The endpoint of the server conforming to this interface, with scheme,
// https://api.deepmap.com for example. This can contain a path relative
// to the server, such as https://api.deepmap.com/dev-test, and all the
// paths in the swagger spec will be appended to the server.
Server string
// Doer for performing requests, typically a *http.Client with any
// customized settings, such as certificate chains.
Client HttpRequestDoer
// A list of callbacks for modifying requests which are generated before sending over
// the network.
RequestEditors []RequestEditorFn
}
Client which conforms to the OpenAPI3 specification for this service.
func NewClient ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) GetNodeMonitor ¶
type ClientInterface ¶
type ClientInterface interface {
// GetNodeMonitor request
GetNodeMonitor(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
func WithHTTPClient(doer HttpRequestDoer) ClientOption
WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.
func WithRequestEditorFn ¶
func WithRequestEditorFn(fn RequestEditorFn) ClientOption
WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.
type ClientWithResponses ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) GetNodeMonitorWithResponse ¶
func (c *ClientWithResponses) GetNodeMonitorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetNodeMonitorResponse, error)
GetNodeMonitorWithResponse request returning *GetNodeMonitorResponse
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// GetNodeMonitorWithResponse request
GetNodeMonitorWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetNodeMonitorResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type GetNodeMonitor200JSONResponse ¶
type GetNodeMonitor200JSONResponse NodeSnapshot
func (GetNodeMonitor200JSONResponse) VisitGetNodeMonitorResponse ¶
func (response GetNodeMonitor200JSONResponse) VisitGetNodeMonitorResponse(w http.ResponseWriter) error
type GetNodeMonitor401JSONResponse ¶
type GetNodeMonitor401JSONResponse MonitorError
func (GetNodeMonitor401JSONResponse) VisitGetNodeMonitorResponse ¶
func (response GetNodeMonitor401JSONResponse) VisitGetNodeMonitorResponse(w http.ResponseWriter) error
type GetNodeMonitor405Response ¶
type GetNodeMonitor405Response struct {
}
func (GetNodeMonitor405Response) VisitGetNodeMonitorResponse ¶
func (response GetNodeMonitor405Response) VisitGetNodeMonitorResponse(w http.ResponseWriter) error
type GetNodeMonitor503JSONResponse ¶
type GetNodeMonitor503JSONResponse MonitorError
func (GetNodeMonitor503JSONResponse) VisitGetNodeMonitorResponse ¶
func (response GetNodeMonitor503JSONResponse) VisitGetNodeMonitorResponse(w http.ResponseWriter) error
type GetNodeMonitorRequestObject ¶
type GetNodeMonitorRequestObject struct {
}
type GetNodeMonitorResponse ¶
type GetNodeMonitorResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *NodeSnapshot
JSON401 *MonitorError
JSON503 *MonitorError
}
func ParseGetNodeMonitorResponse ¶
func ParseGetNodeMonitorResponse(rsp *http.Response) (*GetNodeMonitorResponse, error)
ParseGetNodeMonitorResponse parses an HTTP response from a GetNodeMonitorWithResponse call
func (GetNodeMonitorResponse) ContentType ¶
func (r GetNodeMonitorResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetNodeMonitorResponse) Status ¶
func (r GetNodeMonitorResponse) Status() string
Status returns HTTPResponse.Status
func (GetNodeMonitorResponse) StatusCode ¶
func (r GetNodeMonitorResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetNodeMonitorResponseObject ¶
type GetNodeMonitorResponseObject interface {
VisitGetNodeMonitorResponse(w http.ResponseWriter) error
}
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type MonitorError ¶
type MonitorError struct {
Error MonitorErrorError `json:"error"`
}
MonitorError defines model for MonitorError.
type MonitorErrorError ¶
type MonitorErrorError string
MonitorErrorError defines model for MonitorError.Error.
const ( INVALIDMONITORTOKEN MonitorErrorError = "INVALID_MONITOR_TOKEN" MONITORDISABLED MonitorErrorError = "MONITOR_DISABLED" )
Defines values for MonitorErrorError.
func (MonitorErrorError) Valid ¶
func (e MonitorErrorError) Valid() bool
Valid indicates whether the value is a known member of the MonitorErrorError enum.
type NodeSnapshot ¶
type NodeSnapshot struct {
// BuildCommit Source commit embedded in this process binary; "dev" for unversioned builds.
BuildCommit string `json:"build_commit"`
Goroutines int `json:"goroutines"`
HeapBytes uint64 `json:"heap_bytes"`
PublicKey string `json:"public_key"`
Role string `json:"role"`
Time time.Time `json:"time"`
Transport struct {
Connections int `json:"connections"`
// InboundServiceChannels Current remote-opened service DataChannels admitted across this process, including pending opens. Released on stream or parent connection close. Excludes locally opened, packet, and native tunnel channels.
InboundServiceChannels int `json:"inbound_service_channels"`
RxBytes uint64 `json:"rx_bytes"`
Services int `json:"services"`
TxBytes uint64 `json:"tx_bytes"`
} `json:"transport"`
UptimeSeconds float64 `json:"uptime_seconds"`
// Version Software version embedded in this process binary; "dev" for unversioned builds.
Version string `json:"version"`
}
NodeSnapshot defines model for NodeSnapshot.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type RequiredHeaderError ¶
func (*RequiredHeaderError) Error ¶
func (e *RequiredHeaderError) Error() string
func (*RequiredHeaderError) Unwrap ¶
func (e *RequiredHeaderError) Unwrap() error
type RequiredParamError ¶
type RequiredParamError struct {
ParamName string
}
func (*RequiredParamError) Error ¶
func (e *RequiredParamError) Error() string
type ServeMux ¶
type ServeMux interface {
HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
http.Handler
}
ServeMux is an abstraction of http.ServeMux.
type ServerInterface ¶
type ServerInterface interface {
// (GET /monitor/api/node)
GetNodeMonitor(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
func NewStrictHandlerWithOptions ¶
func NewStrictHandlerWithOptions(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc, options StrictHTTPServerOptions) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
HandlerMiddlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
ServerInterfaceWrapper converts contexts to parameters.
func (*ServerInterfaceWrapper) GetNodeMonitor ¶
func (siw *ServerInterfaceWrapper) GetNodeMonitor(w http.ResponseWriter, r *http.Request)
GetNodeMonitor operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHTTPServerOptions ¶
type StrictHTTPServerOptions struct {
RequestErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
ResponseErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type StrictHandlerFunc ¶
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc func(f StrictHandlerFunc, operationID string) StrictHandlerFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// (GET /monitor/api/node)
GetNodeMonitor(ctx context.Context, request GetNodeMonitorRequestObject) (GetNodeMonitorResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error