oapiserver

package
v0.0.0-...-2128016 Latest Latest
Warning

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

Go to latest
Published: Feb 24, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package oapiserver 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 GetSwagger

func GetSwagger() (swagger *openapi3.T, err error)

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, 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 PathToRawSpec

func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)

Constructs a synthetic filesystem for resolving external references when loading openapi specifications.

Types

type ChiServerOptions

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

type CreateItemJSONBody

type CreateItemJSONBody struct {
	Content string `json:"content"`
	Sort    int64  `json:"sort"`
}

CreateItemJSONBody defines parameters for CreateItem.

type CreateItemJSONRequestBody

type CreateItemJSONRequestBody CreateItemJSONBody

CreateItemJSONRequestBody defines body for CreateItem for application/json ContentType.

type CreateListJSONBody

type CreateListJSONBody struct {
	Name string `json:"name"`
}

CreateListJSONBody defines parameters for CreateList.

type CreateListJSONRequestBody

type CreateListJSONRequestBody CreateListJSONBody

CreateListJSONRequestBody defines body for CreateList for application/json ContentType.

type GetItemsParams

type GetItemsParams struct {
	Limit  *int32 `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int32 `form:"offset,omitempty" json:"offset,omitempty"`
}

GetItemsParams defines parameters for GetItems.

type GetListsParams

type GetListsParams struct {
	Limit  *int32 `form:"limit,omitempty" json:"limit,omitempty"`
	Offset *int32 `form:"offset,omitempty" json:"offset,omitempty"`
}

GetListsParams defines parameters for GetLists.

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 a list of lists
	// (GET /lists)
	GetLists(w http.ResponseWriter, r *http.Request, params GetListsParams)
	// Create a new list
	// (POST /lists)
	CreateList(w http.ResponseWriter, r *http.Request)
	// Delete list by ID
	// (DELETE /lists/{listID})
	DeleteList(w http.ResponseWriter, r *http.Request, listID int64)
	// Get list by ID
	// (GET /lists/{listID})
	GetList(w http.ResponseWriter, r *http.Request, listID int64)
	// Update list by ID
	// (PUT /lists/{listID})
	UpdateList(w http.ResponseWriter, r *http.Request, listID int64)
	// Get a list of items from listID
	// (GET /lists/{listID}/items)
	GetItems(w http.ResponseWriter, r *http.Request, listID int64, params GetItemsParams)
	// Create a new item on the listID
	// (POST /lists/{listID}/items)
	CreateItem(w http.ResponseWriter, r *http.Request, listID int64)
	// Delete item by listID and itemID
	// (DELETE /lists/{listID}/items/{itemID})
	DeleteItem(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)
	// Get item by listID and itemID
	// (GET /lists/{listID}/items/{itemID})
	GetItem(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)
	// Update item checked by listID and itemID
	// (PUT /lists/{listID}/items/{itemID}/checked)
	UpdateItemFromListChecked(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)
	// Update item content by listID and itemID
	// (PUT /lists/{listID}/items/{itemID}/content)
	UpdateItemFromListContent(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)
	// Update item sort by listID and itemID
	// (PUT /lists/{listID}/items/{itemID}/sort)
	UpdateItemFromListSort(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)
	// Reflow list by ID
	// (PUT /lists/{listID}/reflow)
	ReflowList(w http.ResponseWriter, r *http.Request, listID int64)
}

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

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

CreateItem operation middleware

func (*ServerInterfaceWrapper) CreateList

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

CreateList operation middleware

func (*ServerInterfaceWrapper) DeleteItem

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

DeleteItem operation middleware

func (*ServerInterfaceWrapper) DeleteList

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

DeleteList operation middleware

func (*ServerInterfaceWrapper) GetItem

GetItem operation middleware

func (*ServerInterfaceWrapper) GetItems

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

GetItems operation middleware

func (*ServerInterfaceWrapper) GetList

GetList operation middleware

func (*ServerInterfaceWrapper) GetLists

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

GetLists operation middleware

func (*ServerInterfaceWrapper) ReflowList

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

ReflowList operation middleware

func (*ServerInterfaceWrapper) UpdateItemFromListChecked

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

UpdateItemFromListChecked operation middleware

func (*ServerInterfaceWrapper) UpdateItemFromListContent

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

UpdateItemFromListContent operation middleware

func (*ServerInterfaceWrapper) UpdateItemFromListSort

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

UpdateItemFromListSort operation middleware

func (*ServerInterfaceWrapper) UpdateList

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

UpdateList 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 Unimplemented

type Unimplemented struct{}

func (Unimplemented) CreateItem

func (_ Unimplemented) CreateItem(w http.ResponseWriter, r *http.Request, listID int64)

Create a new item on the listID (POST /lists/{listID}/items)

func (Unimplemented) CreateList

func (_ Unimplemented) CreateList(w http.ResponseWriter, r *http.Request)

Create a new list (POST /lists)

func (Unimplemented) DeleteItem

func (_ Unimplemented) DeleteItem(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)

Delete item by listID and itemID (DELETE /lists/{listID}/items/{itemID})

func (Unimplemented) DeleteList

func (_ Unimplemented) DeleteList(w http.ResponseWriter, r *http.Request, listID int64)

Delete list by ID (DELETE /lists/{listID})

func (Unimplemented) GetItem

func (_ Unimplemented) GetItem(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)

Get item by listID and itemID (GET /lists/{listID}/items/{itemID})

func (Unimplemented) GetItems

func (_ Unimplemented) GetItems(w http.ResponseWriter, r *http.Request, listID int64, params GetItemsParams)

Get a list of items from listID (GET /lists/{listID}/items)

func (Unimplemented) GetList

func (_ Unimplemented) GetList(w http.ResponseWriter, r *http.Request, listID int64)

Get list by ID (GET /lists/{listID})

func (Unimplemented) GetLists

func (_ Unimplemented) GetLists(w http.ResponseWriter, r *http.Request, params GetListsParams)

Get a list of lists (GET /lists)

func (Unimplemented) ReflowList

func (_ Unimplemented) ReflowList(w http.ResponseWriter, r *http.Request, listID int64)

Reflow list by ID (PUT /lists/{listID}/reflow)

func (Unimplemented) UpdateItemFromListChecked

func (_ Unimplemented) UpdateItemFromListChecked(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)

Update item checked by listID and itemID (PUT /lists/{listID}/items/{itemID}/checked)

func (Unimplemented) UpdateItemFromListContent

func (_ Unimplemented) UpdateItemFromListContent(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)

Update item content by listID and itemID (PUT /lists/{listID}/items/{itemID}/content)

func (Unimplemented) UpdateItemFromListSort

func (_ Unimplemented) UpdateItemFromListSort(w http.ResponseWriter, r *http.Request, listID int64, itemID int64)

Update item sort by listID and itemID (PUT /lists/{listID}/items/{itemID}/sort)

func (Unimplemented) UpdateList

func (_ Unimplemented) UpdateList(w http.ResponseWriter, r *http.Request, listID int64)

Update list by ID (PUT /lists/{listID})

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

type UpdateItemFromListCheckedJSONBody

type UpdateItemFromListCheckedJSONBody struct {
	Checked bool `json:"checked"`
}

UpdateItemFromListCheckedJSONBody defines parameters for UpdateItemFromListChecked.

type UpdateItemFromListCheckedJSONRequestBody

type UpdateItemFromListCheckedJSONRequestBody UpdateItemFromListCheckedJSONBody

UpdateItemFromListCheckedJSONRequestBody defines body for UpdateItemFromListChecked for application/json ContentType.

type UpdateItemFromListContentJSONBody

type UpdateItemFromListContentJSONBody struct {
	Content string `json:"content"`
}

UpdateItemFromListContentJSONBody defines parameters for UpdateItemFromListContent.

type UpdateItemFromListContentJSONRequestBody

type UpdateItemFromListContentJSONRequestBody UpdateItemFromListContentJSONBody

UpdateItemFromListContentJSONRequestBody defines body for UpdateItemFromListContent for application/json ContentType.

type UpdateItemFromListSortJSONBody

type UpdateItemFromListSortJSONBody struct {
	Sort int64 `json:"sort"`
}

UpdateItemFromListSortJSONBody defines parameters for UpdateItemFromListSort.

type UpdateItemFromListSortJSONRequestBody

type UpdateItemFromListSortJSONRequestBody UpdateItemFromListSortJSONBody

UpdateItemFromListSortJSONRequestBody defines body for UpdateItemFromListSort for application/json ContentType.

type UpdateListJSONBody

type UpdateListJSONBody struct {
	Name string `json:"name"`
}

UpdateListJSONBody defines parameters for UpdateList.

type UpdateListJSONRequestBody

type UpdateListJSONRequestBody UpdateListJSONBody

UpdateListJSONRequestBody defines body for UpdateList for application/json ContentType.

Jump to

Keyboard shortcuts

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