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.4.1 DO NOT EDIT.
Copyright 2025 Contributors to the Veraison project. SPDX-License-Identifier: Apache-2.0
Index ¶
- Constants
- func GetSwagger() (swagger *openapi3.T, err error)
- 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 PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type BadRequestError
- type BadRequestErrorStatus
- type BadRequestErrorTitle
- type BadRequestErrorType
- type CMW
- type CMWTyp
- type ChaResRequest
- type ChaResRequestParametersAccept
- type EAT
- type EATEatProfile
- type InvalidParamFormatError
- type MiddlewareFunc
- type Option
- type OptionDataType
- type RatsdCharesApplicationVndVeraisonCharesPlusJSONRequestBody
- type RatsdCharesParams
- type RequiredHeaderError
- type RequiredParamError
- type ServeMux
- type Server
- type ServerInterface
- type ServerInterfaceWrapper
- type StdHTTPServerOptions
- type SubAttester
- type TooManyValuesForParamError
- type UnauthorizedError
- type UnauthorizedErrorStatus
- type UnauthorizedErrorTitle
- type UnauthorizedErrorType
- type UnescapedCookieParamError
- type UnmarshalingParamError
Constants ¶
const ( ApplicationvndVeraisonCharesJson string = "application/vnd.veraison.chares+json" JsonType string = "application/json" )
Defines missing consts in the API Spec
const (
BearerAuthScopes = "BearerAuth.Scopes"
)
Variables ¶
This section is empty.
Functions ¶
func GetSwagger ¶
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, 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 BadRequestError ¶
type BadRequestError struct {
Detail *string `json:"detail,omitempty"`
Instance *string `json:"instance,omitempty"`
Status BadRequestErrorStatus `json:"status"`
Title BadRequestErrorTitle `json:"title"`
Type BadRequestErrorType `json:"type"`
}
BadRequestError defines model for BadRequestError.
type BadRequestErrorStatus ¶
type BadRequestErrorStatus float32
BadRequestErrorStatus defines model for BadRequestError.Status.
const (
N400 BadRequestErrorStatus = 400
)
Defines values for BadRequestErrorStatus.
type BadRequestErrorTitle ¶
type BadRequestErrorTitle string
BadRequestErrorTitle defines model for BadRequestError.Title.
const (
InvalidRequest BadRequestErrorTitle = "invalid request"
)
Defines values for BadRequestErrorTitle.
type BadRequestErrorType ¶
type BadRequestErrorType string
BadRequestErrorType defines model for BadRequestError.Type.
const (
TagGithubCom2024VeraisonratsdErrorInvalidrequest BadRequestErrorType = "tag:github.com,2024:veraison/ratsd:error:invalidrequest"
)
Defines values for BadRequestErrorType.
type CMWTyp ¶
type CMWTyp string
CMWTyp defines model for CMW.Typ.
const (
ApplicationvndVeraisonConfigfsTsmJson CMWTyp = "application/vnd.veraison.configfs-tsm+json"
)
Defines values for CMWTyp.
type ChaResRequest ¶
type ChaResRequest struct {
AttesterSelection json.RawMessage `json:"attester-selection,omitempty"`
Nonce string `json:"nonce"`
}
ChaResRequest defines model for ChaResRequest.
type ChaResRequestParametersAccept ¶
type ChaResRequestParametersAccept = string
ChaResRequestParametersAccept defines model for ChaResRequestParameters.accept.
type EAT ¶
type EAT struct {
EatProfile EATEatProfile `json:"eat_profile"`
NestedToken CMW `json:"nested-token"`
}
EAT defines model for EAT.
type EATEatProfile ¶
type EATEatProfile string
EATEatProfile defines model for EAT.EatProfile.
const (
TagGithubCom2024Veraisonratsd EATEatProfile = "tag:github.com,2024:veraison/ratsd"
)
Defines values for EATEatProfile.
type InvalidParamFormatError ¶
func (*InvalidParamFormatError) Error ¶
func (e *InvalidParamFormatError) Error() string
func (*InvalidParamFormatError) Unwrap ¶
func (e *InvalidParamFormatError) Unwrap() error
type Option ¶
type Option struct {
DataType OptionDataType `json:"data-type"`
Name string `json:"name"`
}
Option defines model for Option.
type OptionDataType ¶
type OptionDataType string
OptionDataType defines model for Option.DataType.
const ( Array OptionDataType = "array" Boolean OptionDataType = "boolean" Integer OptionDataType = "integer" Number OptionDataType = "number" Object OptionDataType = "object" String OptionDataType = "string" )
Defines values for OptionDataType.
type RatsdCharesApplicationVndVeraisonCharesPlusJSONRequestBody ¶
type RatsdCharesApplicationVndVeraisonCharesPlusJSONRequestBody = ChaResRequest
RatsdCharesApplicationVndVeraisonCharesPlusJSONRequestBody defines body for RatsdChares for application/vnd.veraison.chares+json ContentType.
type RatsdCharesParams ¶
type RatsdCharesParams struct {
Accept *ChaResRequestParametersAccept `json:"accept,omitempty"`
}
RatsdCharesParams defines parameters for RatsdChares.
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))
ServeHTTP(w http.ResponseWriter, r *http.Request)
}
ServeMux is an abstraction of http.ServeMux.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
func (*Server) RatsdChares ¶
func (s *Server) RatsdChares(w http.ResponseWriter, r *http.Request, param RatsdCharesParams)
func (*Server) RatsdSubattesters ¶
func (s *Server) RatsdSubattesters(w http.ResponseWriter, r *http.Request)
type ServerInterface ¶
type ServerInterface interface {
// (POST /ratsd/chares)
RatsdChares(w http.ResponseWriter, r *http.Request, params RatsdCharesParams)
// (GET /ratsd/subattesters)
RatsdSubattesters(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) RatsdChares ¶
func (siw *ServerInterfaceWrapper) RatsdChares(w http.ResponseWriter, r *http.Request)
RatsdChares operation middleware
func (*ServerInterfaceWrapper) RatsdSubattesters ¶
func (siw *ServerInterfaceWrapper) RatsdSubattesters(w http.ResponseWriter, r *http.Request)
RatsdSubattesters operation middleware
type StdHTTPServerOptions ¶
type StdHTTPServerOptions struct {
BaseURL string
BaseRouter ServeMux
Middlewares []MiddlewareFunc
ErrorHandlerFunc func(w http.ResponseWriter, r *http.Request, err error)
}
type SubAttester ¶
SubAttester defines model for SubAttester.
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnauthorizedError ¶
type UnauthorizedError struct {
}
UnauthorizedError defines model for UnauthorizedError.
type UnauthorizedErrorStatus ¶
type UnauthorizedErrorStatus float32
UnauthorizedErrorStatus defines model for UnauthorizedError.Status.
const (
N401 UnauthorizedErrorStatus = 401
)
Defines values for UnauthorizedErrorStatus.
type UnauthorizedErrorTitle ¶
type UnauthorizedErrorTitle string
UnauthorizedErrorTitle defines model for UnauthorizedError.Title.
const (
)
Defines values for UnauthorizedErrorTitle.
type UnauthorizedErrorType ¶
type UnauthorizedErrorType string
UnauthorizedErrorType defines model for UnauthorizedError.Type.
const (
)
Defines values for UnauthorizedErrorType.
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