read

package
v0.0.0-...-33bd477 Latest Latest
Warning

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

Go to latest
Published: Aug 1, 2024 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen/v2 version v2.1.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 *mux.Router) http.Handler

HandlerFromMux creates http.Handler with routing matching OpenAPI spec based on the provided mux.

func HandlerFromMuxWithBaseURL

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

func HandlerWithOptions

func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler

HandlerWithOptions creates http.Handler with additional options

Types

type GetQueryParams

type GetQueryParams struct {
	// Q query
	Q *string `form:"q,omitempty" json:"q,omitempty"`
}

GetQueryParams defines parameters for GetQuery.

type GetTestQueryParams

type GetTestQueryParams struct {
	// Q query
	Q *string `form:"q,omitempty" json:"q,omitempty"`
}

GetTestQueryParams defines parameters for GetTestQuery.

type GorillaServerOptions

type GorillaServerOptions struct {
	BaseURL          string
	BaseRouter       *mux.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 ResultsResponse

type ResultsResponse = externalRef0.ResultsResponse

ResultsResponse defines model for ResultsResponse.

type Router

type Router struct {
	// contains filtered or unexported fields
}

func NewRouter

func NewRouter() *Router

type SearchResponse

type SearchResponse = externalRef0.SearchResponse

SearchResponse defines model for SearchResponse.

type Server

type Server struct {
	// contains filtered or unexported fields
}

Server struct

func NewServer

func NewServer() Server

func (*Server) Configure

func (srv *Server) Configure()

TODO: add context

func (*Server) GetHealth

func (srv *Server) GetHealth(w http.ResponseWriter, r *http.Request)

func (*Server) GetQuery

func (srv *Server) GetQuery(w http.ResponseWriter, r *http.Request, params GetQueryParams)

func (*Server) GetResults

func (srv *Server) GetResults(w http.ResponseWriter, r *http.Request)

func (*Server) GetTestQuery

func (srv *Server) GetTestQuery(w http.ResponseWriter, r *http.Request, params GetTestQueryParams)

func (*Server) ListenAndServe

func (srv *Server) ListenAndServe() error

func (*Server) Shutdown

func (srv *Server) Shutdown(ctx context.Context) error

type ServerInterface

type ServerInterface interface {
	// Health check endpoint
	// (GET /health)
	GetHealth(w http.ResponseWriter, r *http.Request)

	// (GET /query)
	GetQuery(w http.ResponseWriter, r *http.Request, params GetQueryParams)

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

	// (GET /test/query)
	GetTestQuery(w http.ResponseWriter, r *http.Request, params GetTestQueryParams)
}

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) GetHealth

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

GetHealth operation middleware

func (*ServerInterfaceWrapper) GetQuery

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

GetQuery operation middleware

func (*ServerInterfaceWrapper) GetResults

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

GetResults operation middleware

func (*ServerInterfaceWrapper) GetTestQuery

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

GetTestQuery 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

Jump to

Keyboard shortcuts

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