demo

package
v0.0.0-...-37aa375 Latest Latest
Warning

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

Go to latest
Published: Aug 23, 2024 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Overview

Package demo provides primitives to interact with the openapi HTTP API.

Code generated by github.com/deepmap/oapi-codegen version v1.9.1 DO NOT EDIT.

Index

Constants

View Source
const (
	ModuleName        = "demo"
	ModuleDescription = "This is a demo module doing nothing"
)

Variables

This section is empty.

Functions

func GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

GetSwagger returns the Swagger specification corresponding to the generated code in this file. The external references of Swagger specification are resolved. The logic of resolving external references is tightly connected to "import-mapping" feature. Externally referenced files must be embedded in the corresponding golang packages. Urls can be supported but this task was out of the scope.

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

func PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ChiServerOptions

type ChiServerOptions struct {
	BaseURL          string
	BaseRouter       chi.Router
	Middlewares      []MiddlewareFunc
	ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}

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.HandlerFunc) http.HandlerFunc

type PostAlertEventIDParams

type PostAlertEventIDParams struct {
	Type PostAlertEventIDParamsType `json:"type"`
}

PostAlertEventIDParams defines parameters for PostAlertEventID.

type PostAlertEventIDParamsType

type PostAlertEventIDParamsType string

PostAlertEventIDParamsType defines parameters for PostAlertEventID.

type PostApiApiIDAnnotationAnnotationJSONBody

type PostApiApiIDAnnotationAnnotationJSONBody struct {
	Data *string `json:"data,omitempty"`
}

PostApiApiIDAnnotationAnnotationJSONBody defines parameters for PostApiApiIDAnnotationAnnotation.

type PostApiApiIDAnnotationAnnotationJSONRequestBody

type PostApiApiIDAnnotationAnnotationJSONRequestBody PostApiApiIDAnnotationAnnotationJSONBody

PostApiApiIDAnnotationAnnotationJSONRequestBody defines body for PostApiApiIDAnnotationAnnotation for application/json ContentType.

type PostEventEventIDAnnotationAnnotationJSONBody

type PostEventEventIDAnnotationAnnotationJSONBody struct {
	Data *string `json:"data,omitempty"`
}

PostEventEventIDAnnotationAnnotationJSONBody defines parameters for PostEventEventIDAnnotationAnnotation.

type PostEventEventIDAnnotationAnnotationJSONRequestBody

type PostEventEventIDAnnotationAnnotationJSONRequestBody PostEventEventIDAnnotationAnnotationJSONBody

PostEventEventIDAnnotationAnnotationJSONRequestBody defines body for PostEventEventIDAnnotationAnnotation for application/json ContentType.

type PostEventsJSONBody

type PostEventsJSONBody struct {
	AdditionalProperties map[string]interface{} `json:"-"`
}

PostEventsJSONBody defines parameters for PostEvents.

func (PostEventsJSONBody) Get

func (a PostEventsJSONBody) Get(fieldName string) (value interface{}, found bool)

Getter for additional properties for PostEventsJSONBody. Returns the specified element and whether it was found

func (PostEventsJSONBody) MarshalJSON

func (a PostEventsJSONBody) MarshalJSON() ([]byte, error)

Override default JSON handling for PostEventsJSONBody to handle AdditionalProperties

func (*PostEventsJSONBody) Set

func (a *PostEventsJSONBody) Set(fieldName string, value interface{})

Setter for additional properties for PostEventsJSONBody

func (*PostEventsJSONBody) UnmarshalJSON

func (a *PostEventsJSONBody) UnmarshalJSON(b []byte) error

Override default JSON handling for PostEventsJSONBody to handle AdditionalProperties

type PostEventsJSONRequestBody

type PostEventsJSONRequestBody PostEventsJSONBody

PostEventsJSONRequestBody defines body for PostEvents for application/json ContentType.

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 {

	// (POST /alert/{eventID})
	PostAlertEventID(w http.ResponseWriter, r *http.Request, eventID int, params PostAlertEventIDParams)

	// (GET /api/{apiID})
	GetApiApiID(w http.ResponseWriter, r *http.Request, apiID int)

	// (DELETE /api/{apiID}/annotation/{annotation})
	DeleteApiApiIDAnnotationAnnotation(w http.ResponseWriter, r *http.Request, apiID int, annotation string)

	// (GET /api/{apiID}/annotation/{annotation})
	GetApiApiIDAnnotationAnnotation(w http.ResponseWriter, r *http.Request, apiID int, annotation string)

	// (POST /api/{apiID}/annotation/{annotation})
	PostApiApiIDAnnotationAnnotation(w http.ResponseWriter, r *http.Request, apiID int, annotation string)

	// (GET /event/{eventID}/annotation/{annotation})
	GetEventEventIDAnnotationAnnotation(w http.ResponseWriter, r *http.Request, eventID int, annotation string)

	// (POST /event/{eventID}/annotation/{annotation})
	PostEventEventIDAnnotationAnnotation(w http.ResponseWriter, r *http.Request, eventID int, annotation string)

	// (POST /events)
	PostEvents(w http.ResponseWriter, r *http.Request)
	// Get the version of this Plugin
	// (GET /version)
	GetVersion(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) DeleteApiApiIDAnnotationAnnotation

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

DeleteApiApiIDAnnotationAnnotation operation middleware

func (*ServerInterfaceWrapper) GetApiApiID

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

GetApiApiID operation middleware

func (*ServerInterfaceWrapper) GetApiApiIDAnnotationAnnotation

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

GetApiApiIDAnnotationAnnotation operation middleware

func (*ServerInterfaceWrapper) GetEventEventIDAnnotationAnnotation

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

GetEventEventIDAnnotationAnnotation operation middleware

func (*ServerInterfaceWrapper) GetVersion

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

GetVersion operation middleware

func (*ServerInterfaceWrapper) PostAlertEventID

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

PostAlertEventID operation middleware

func (*ServerInterfaceWrapper) PostApiApiIDAnnotationAnnotation

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

PostApiApiIDAnnotationAnnotation operation middleware

func (*ServerInterfaceWrapper) PostEventEventIDAnnotationAnnotation

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

PostEventEventIDAnnotationAnnotation operation middleware

func (*ServerInterfaceWrapper) PostEvents

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

PostEvents operation middleware

type TooManyValuesForParamError

type TooManyValuesForParamError struct {
	ParamName string
	Count     int
}

func (*TooManyValuesForParamError) Error

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 UnmarshalingParamError

type UnmarshalingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshalingParamError) Error

func (e *UnmarshalingParamError) Error() string

func (*UnmarshalingParamError) Unwrap

func (e *UnmarshalingParamError) Unwrap() error

type Version

type Version struct {
	Version string `json:"version"`
}

Version defines model for Version.

Jump to

Keyboard shortcuts

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