api

package
v0.0.0-...-c395a66 Latest Latest
Warning

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

Go to latest
Published: Mar 29, 2024 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version v1.13.0 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 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 {
	// Get all Proposals
	// (GET /proposals/)
	GetProposals(w http.ResponseWriter, r *http.Request)
	// Create a Proposal
	// (POST /proposals/)
	CreateProposal(w http.ResponseWriter, r *http.Request)
	// Delete a proposal
	// (DELETE /proposals/{proposalId})
	DeleteProposal(w http.ResponseWriter, r *http.Request, proposalId string)
	// Decide a proposal
	// (POST /proposals/{proposalId}/decide/)
	DecideProposal(w http.ResponseWriter, r *http.Request, proposalId string)
	// Get Service Info
	// (GET /service/info)
	GetServiceInfo(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) CreateProposal

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

CreateProposal operation middleware

func (*ServerInterfaceWrapper) DecideProposal

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

DecideProposal operation middleware

func (*ServerInterfaceWrapper) DeleteProposal

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

DeleteProposal operation middleware

func (*ServerInterfaceWrapper) GetProposals

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

GetProposals operation middleware

func (*ServerInterfaceWrapper) GetServiceInfo

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

GetServiceInfo 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 UnmarshallingParamError

type UnmarshallingParamError struct {
	ParamName string
	Err       error
}

func (*UnmarshallingParamError) Error

func (e *UnmarshallingParamError) Error() string

func (*UnmarshallingParamError) Unwrap

func (e *UnmarshallingParamError) Unwrap() error

Jump to

Keyboard shortcuts

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