oapi

package
v0.0.0-...-39982f3 Latest Latest
Warning

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

Go to latest
Published: Dec 11, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package oapi 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

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, 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 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 PutScanResultsJSONRequestBody

type PutScanResultsJSONRequestBody = ScanResult

PutScanResultsJSONRequestBody defines body for PutScanResults 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 ScanResult

type ScanResult struct {
	ImageId string `json:"imageId"`

	// Report is a big JSON object which should conform to the CycloneDX BOM schema.
	Report json.RawMessage `json:"report"`
}

ScanResult defines model for ScanResult.

type ServeMux

type ServeMux interface {
	HandleFunc(pattern string, handler func(http.ResponseWriter, *http.Request))
	ServeHTTP(w http.ResponseWriter, r *http.Request)
}

ServeMux is an abstraction of http.ServeMux.

type ServerInterface

type ServerInterface interface {

	// (GET /)
	Get(w http.ResponseWriter, r *http.Request)

	// (GET /bundle.js)
	GetBundleJs(w http.ResponseWriter, r *http.Request)

	// (GET /output.css)
	GetOutputCss(w http.ResponseWriter, r *http.Request)

	// (GET /scan-results)
	GetScanResults(w http.ResponseWriter, r *http.Request)

	// (PUT /scan-results)
	PutScanResults(w http.ResponseWriter, r *http.Request)

	// (DELETE /scan-results/{imageId})
	DeleteScanResultsImageId(w http.ResponseWriter, r *http.Request, imageId string)

	// (GET /scan-results/{imageId})
	GetScanResultsImageId(w http.ResponseWriter, r *http.Request, imageId string)

	// (GET /subscribe)
	GetSubscribe(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) DeleteScanResultsImageId

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

DeleteScanResultsImageId operation middleware

func (*ServerInterfaceWrapper) Get

Get operation middleware

func (*ServerInterfaceWrapper) GetBundleJs

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

GetBundleJs operation middleware

func (*ServerInterfaceWrapper) GetOutputCss

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

GetOutputCss operation middleware

func (*ServerInterfaceWrapper) GetScanResults

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

GetScanResults operation middleware

func (*ServerInterfaceWrapper) GetScanResultsImageId

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

GetScanResultsImageId operation middleware

func (*ServerInterfaceWrapper) GetSubscribe

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

GetSubscribe operation middleware

func (*ServerInterfaceWrapper) PutScanResults

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

PutScanResults operation middleware

type StdHTTPServerOptions

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

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

Jump to

Keyboard shortcuts

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