server

package
v0.0.0-...-c1d610b Latest Latest
Warning

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

Go to latest
Published: Jul 11, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

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

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

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

Code generated by github.com/deepmap/oapi-codegen version v1.11.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

func RunGRPCServerOnAddr

func RunGRPCServerOnAddr(addr string, registerServer func(server *grpc.Server))

func RunGrpcServer

func RunGrpcServer(registerServer func(server *grpc.Server))

func RunHTTPServer

func RunHTTPServer(createHandler func(router chi.Router) http.Handler)

func RunHTTPServerOnAddr

func RunHTTPServerOnAddr(addr string, createHandler func(router chi.Router) http.Handler)

Types

type ChiServerOptions

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

type Error

type Error struct {
	Message string `json:"message"`
}

Error defines model for Error.

type GetSession

type GetSession struct {
	Values *map[string]interface{} `json:"values,omitempty"`
}

GetSession defines model for GetSession.

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 PostSession

type PostSession struct {
	SessionKey   string                 `json:"sessionKey"`
	SessionValue map[string]interface{} `json:"sessionValue"`
}

PostSession defines model for PostSession.

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 /session)
	SetSession(w http.ResponseWriter, r *http.Request)

	// (DELETE /session/{sessionId})
	DeleteSession(w http.ResponseWriter, r *http.Request, sessionId string)

	// (GET /session/{sessionId})
	GetSession(w http.ResponseWriter, r *http.Request, sessionId string)
}

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

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

DeleteSession operation middleware

func (*ServerInterfaceWrapper) GetSession

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

GetSession operation middleware

func (*ServerInterfaceWrapper) SetSession

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

SetSession operation middleware

type SetSessionJSONBody

type SetSessionJSONBody = PostSession

SetSessionJSONBody defines parameters for SetSession.

type SetSessionJSONRequestBody

type SetSessionJSONRequestBody = SetSessionJSONBody

SetSessionJSONRequestBody defines body for SetSession for application/json ContentType.

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