api

package
v0.1.13 Latest Latest
Warning

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

Go to latest
Published: Jul 10, 2026 License: LGPL-3.0 Imports: 4 Imported by: 0

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

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 HandlerFromMuxWithBaseURL

func HandlerFromMuxWithBaseURL(si ServerInterface, r chi.Router, baseURL string) http.Handler

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

type ErrorResponse struct {
	Error string  `json:"error"`
	ReqID *string `json:"reqID,omitempty"`
}

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

type InvalidParamFormatError struct {
	ParamName string
	Err       error
}

func (*InvalidParamFormatError) Error

func (e *InvalidParamFormatError) Error() string

func (*InvalidParamFormatError) Unwrap

func (e *InvalidParamFormatError) Unwrap() error

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type RequiredHeaderError

type RequiredHeaderError struct {
	ParamName string
	Err       error
}

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

Ingest operation middleware

func (*ServerInterfaceWrapper) Metrics

Metrics operation middleware

func (*ServerInterfaceWrapper) Transform

func (siw *ServerInterfaceWrapper) Transform(w http.ResponseWriter, r *http.Request)

Transform operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

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

type UnescapedCookieParamError struct {
	ParamName string
	Err       error
}

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

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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