server

package
v0.0.0-...-e67387a Latest Latest
Warning

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

Go to latest
Published: Jan 18, 2022 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

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

Code generated by github.com/deepmap/oapi-codegen version (devel) 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.HandlerFunc) http.HandlerFunc

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 {
	// creates a new group
	// (POST /groups)
	PostGroups(w http.ResponseWriter, r *http.Request)
	// creates a new message
	// (POST /messages)
	PostMessages(w http.ResponseWriter, r *http.Request)
	// retrieves a new message
	// (GET /messages/{id})
	GetMessagesId(w http.ResponseWriter, r *http.Request, id int64)
	// retrieves replies to a message
	// (GET /messages/{id}/replies)
	GetMessagesIdReplies(w http.ResponseWriter, r *http.Request, id int64)
	// creates a reply to another message
	// (POST /messages/{id}/replies)
	PostMessagesIdReplies(w http.ResponseWriter, r *http.Request, id int64)
	// registers a new user
	// (POST /users)
	PostUsers(w http.ResponseWriter, r *http.Request)
	// gets a user's messages
	// (GET /users/{username}/mailbox)
	GetUsersUsernameMailbox(w http.ResponseWriter, r *http.Request, username 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) GetMessagesId

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

GetMessagesId operation middleware

func (*ServerInterfaceWrapper) GetMessagesIdReplies

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

GetMessagesIdReplies operation middleware

func (*ServerInterfaceWrapper) GetUsersUsernameMailbox

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

GetUsersUsernameMailbox operation middleware

func (*ServerInterfaceWrapper) PostGroups

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

PostGroups operation middleware

func (*ServerInterfaceWrapper) PostMessages

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

PostMessages operation middleware

func (*ServerInterfaceWrapper) PostMessagesIdReplies

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

PostMessagesIdReplies operation middleware

func (*ServerInterfaceWrapper) PostUsers

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

PostUsers 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