Documentation
¶
Overview ¶
Package api 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 ¶
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r chi.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
- type ChiServerOptions
- type EmptyResponse
- type ErrorResponse
- type IngestJSONRequestBody
- type IngestRequest
- type InvalidParamFormatError
- type MiddlewareFunc
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- type TooManyValuesForParamError
- type TransformDefinition
- type TransformDefinitionType
- type TransformJSONRequestBody
- type TransformRequest
- type TransformResponse
- type UnescapedCookieParamError
- type Unimplemented
- type UnmarshalingParamError
Constants ¶
This section is empty.
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, r chi.Router) http.Handler
HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.
func HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options ChiServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
Types ¶
type ChiServerOptions ¶
type ChiServerOptions struct {
BaseURL string
BaseRouter chi.Router
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type EmptyResponse ¶
type EmptyResponse = map[string]interface{}
EmptyResponse defines model for EmptyResponse.
type ErrorResponse ¶
ErrorResponse defines model for ErrorResponse.
type IngestJSONRequestBody ¶
type IngestJSONRequestBody = IngestRequest
IngestJSONRequestBody defines body for Ingest for application/json ContentType.
type IngestRequest ¶
type IngestRequest = map[string]interface{}
IngestRequest defines model for IngestRequest.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
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 ServerInterface ¶
type ServerInterface interface {
// Ingest a webhook message
// (POST /ingest/{sourceSlug})
Ingest(w http.ResponseWriter, r *http.Request, sourceSlug string)
// Get Prometheus metrics
// (GET /metrics)
Metrics(w http.ResponseWriter, r *http.Request)
// Transform a message
// (POST /transform)
Transform(w http.ResponseWriter, r *http.Request)
}
ServerInterface represents all server handlers.
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) Ingest ¶
func (siw *ServerInterfaceWrapper) Ingest(w http.ResponseWriter, r *http.Request)
Ingest operation middleware
func (*ServerInterfaceWrapper) Metrics ¶
func (siw *ServerInterfaceWrapper) Metrics(w http.ResponseWriter, r *http.Request)
Metrics operation middleware
func (*ServerInterfaceWrapper) Transform ¶
func (siw *ServerInterfaceWrapper) Transform(w http.ResponseWriter, r *http.Request)
Transform operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type TransformDefinition ¶
type TransformDefinition struct {
Id *string `json:"id,omitempty"`
Script *string `json:"script,omitempty"`
ScriptPath *string `json:"scriptPath,omitempty"`
Type TransformDefinitionType `json:"type"`
}
TransformDefinition defines model for TransformDefinition.
type TransformDefinitionType ¶
type TransformDefinitionType string
TransformDefinitionType defines model for TransformDefinition.Type.
const (
Javascript TransformDefinitionType = "javascript"
)
Defines values for TransformDefinitionType.
func (TransformDefinitionType) Valid ¶
func (e TransformDefinitionType) Valid() bool
Valid indicates whether the value is a known member of the TransformDefinitionType enum.
type TransformJSONRequestBody ¶
type TransformJSONRequestBody = TransformRequest
TransformJSONRequestBody defines body for Transform for application/json ContentType.
type TransformRequest ¶
type TransformRequest struct {
Body string `json:"body"`
Headers *map[string][]string `json:"headers,omitempty"`
TransformDefinition TransformDefinition `json:"transformDefinition"`
}
TransformRequest defines model for TransformRequest.
type TransformResponse ¶
type TransformResponse struct {
Body *string `json:"body,omitempty"`
Headers *map[string][]string `json:"headers,omitempty"`
}
TransformResponse defines model for TransformResponse.
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type Unimplemented ¶
type Unimplemented struct{}
func (Unimplemented) Ingest ¶
func (_ Unimplemented) Ingest(w http.ResponseWriter, r *http.Request, sourceSlug string)
Ingest a webhook message (POST /ingest/{sourceSlug})
func (Unimplemented) Metrics ¶
func (_ Unimplemented) Metrics(w http.ResponseWriter, r *http.Request)
Get Prometheus metrics (GET /metrics)
func (Unimplemented) Transform ¶
func (_ Unimplemented) Transform(w http.ResponseWriter, r *http.Request)
Transform a message (POST /transform)
type UnmarshalingParamError ¶
func (*UnmarshalingParamError) Error ¶
func (e *UnmarshalingParamError) Error() string
func (*UnmarshalingParamError) Unwrap ¶
func (e *UnmarshalingParamError) Unwrap() error