api

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Nov 14, 2024 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Overview

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

Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.4.1 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 *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

func NewCreateItemRequest added in v1.0.1

func NewCreateItemRequest(server string, backend Backend, entity Entity, body CreateItemJSONRequestBody) (*http.Request, error)

NewCreateItemRequest calls the generic CreateItem builder with application/json body

func NewCreateItemRequestWithBody added in v1.0.1

func NewCreateItemRequestWithBody(server string, backend Backend, entity Entity, contentType string, body io.Reader) (*http.Request, error)

NewCreateItemRequestWithBody generates requests for CreateItem with any type of body

func NewDeleteItemByIdRequest added in v1.0.1

func NewDeleteItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)

NewDeleteItemByIdRequest generates requests for DeleteItemById

func NewExistsItemByIdRequest added in v1.0.1

func NewExistsItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)

NewExistsItemByIdRequest generates requests for ExistsItemById

func NewGetItemByIdRequest added in v1.0.1

func NewGetItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)

NewGetItemByIdRequest generates requests for GetItemById

func NewListBackendsRequest added in v1.0.1

func NewListBackendsRequest(server string) (*http.Request, error)

NewListBackendsRequest generates requests for ListBackends

func NewListEntitiesRequest added in v1.0.1

func NewListEntitiesRequest(server string, backend Backend) (*http.Request, error)

NewListEntitiesRequest generates requests for ListEntities

func NewListItemsRequest added in v1.0.1

func NewListItemsRequest(server string, backend Backend, entity Entity, params *ListItemsParams) (*http.Request, error)

NewListItemsRequest generates requests for ListItems

func NewUpdateItemByIdRequest added in v1.0.1

func NewUpdateItemByIdRequest(server string, backend Backend, entity Entity, id string, body UpdateItemByIdJSONRequestBody) (*http.Request, error)

NewUpdateItemByIdRequest calls the generic UpdateItemById builder with application/json body

func NewUpdateItemByIdRequestWithBody added in v1.0.3

func NewUpdateItemByIdRequestWithBody(server string, backend Backend, entity Entity, id string, contentType string, body io.Reader) (*http.Request, error)

NewUpdateItemByIdRequestWithBody generates requests for UpdateItemById with any type of body

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 Backend

type Backend = string

Backend defines model for backend.

type Client added in v1.0.1

type Client struct {
	// The endpoint of the server conforming to this interface, with scheme,
	// https://api.deepmap.com for example. This can contain a path relative
	// to the server, such as https://api.deepmap.com/dev-test, and all the
	// paths in the swagger spec will be appended to the server.
	Server string

	// Doer for performing requests, typically a *http.Client with any
	// customized settings, such as certificate chains.
	Client HttpRequestDoer

	// A list of callbacks for modifying requests which are generated before sending over
	// the network.
	RequestEditors []RequestEditorFn
}

Client which conforms to the OpenAPI3 specification for this service.

func NewClient added in v1.0.1

func NewClient(server string, opts ...ClientOption) (*Client, error)

Creates a new Client, with reasonable defaults

func (*Client) CreateItem added in v1.0.1

func (c *Client) CreateItem(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) CreateItemWithBody added in v1.0.1

func (c *Client) CreateItemWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) DeleteItemById added in v1.0.1

func (c *Client) DeleteItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ExistsItemById added in v1.0.1

func (c *Client) ExistsItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) GetItemById added in v1.0.1

func (c *Client) GetItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListBackends added in v1.0.1

func (c *Client) ListBackends(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListEntities added in v1.0.1

func (c *Client) ListEntities(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) ListItems added in v1.0.1

func (c *Client) ListItems(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateItemById added in v1.0.1

func (c *Client) UpdateItemById(ctx context.Context, backend Backend, entity Entity, id string, body UpdateItemByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

func (*Client) UpdateItemByIdWithBody added in v1.0.3

func (c *Client) UpdateItemByIdWithBody(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

type ClientInterface added in v1.0.1

type ClientInterface interface {
	// ListBackends request
	ListBackends(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListEntities request
	ListEntities(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ListItems request
	ListItems(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*http.Response, error)

	// CreateItemWithBody request with any body
	CreateItemWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	CreateItem(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)

	// DeleteItemById request
	DeleteItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// GetItemById request
	GetItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// ExistsItemById request
	ExistsItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)

	// UpdateItemByIdWithBody request with any body
	UpdateItemByIdWithBody(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)

	UpdateItemById(ctx context.Context, backend Backend, entity Entity, id string, body UpdateItemByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
}

The interface specification for the client above.

type ClientOption added in v1.0.1

type ClientOption func(*Client) error

ClientOption allows setting custom parameters during construction

func WithBaseURL added in v1.0.1

func WithBaseURL(baseURL string) ClientOption

WithBaseURL overrides the baseURL.

func WithHTTPClient added in v1.0.1

func WithHTTPClient(doer HttpRequestDoer) ClientOption

WithHTTPClient allows overriding the default Doer, which is automatically created using http.Client. This is useful for tests.

func WithRequestEditorFn added in v1.0.1

func WithRequestEditorFn(fn RequestEditorFn) ClientOption

WithRequestEditorFn allows setting up a callback function, which will be called right before sending the request. This can be used to mutate the request.

type ClientWithResponses added in v1.0.1

type ClientWithResponses struct {
	ClientInterface
}

ClientWithResponses builds on ClientInterface to offer response payloads

func NewClientWithResponses added in v1.0.1

func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)

NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling

func (*ClientWithResponses) CreateItemWithBodyWithResponse added in v1.0.1

func (c *ClientWithResponses) CreateItemWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)

CreateItemWithBodyWithResponse request with arbitrary body returning *CreateItemResponse

func (*ClientWithResponses) CreateItemWithResponse added in v1.0.1

func (c *ClientWithResponses) CreateItemWithResponse(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)

func (*ClientWithResponses) DeleteItemByIdWithResponse added in v1.0.1

func (c *ClientWithResponses) DeleteItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*DeleteItemByIdResponse, error)

DeleteItemByIdWithResponse request returning *DeleteItemByIdResponse

func (*ClientWithResponses) ExistsItemByIdWithResponse added in v1.0.1

func (c *ClientWithResponses) ExistsItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*ExistsItemByIdResponse, error)

ExistsItemByIdWithResponse request returning *ExistsItemByIdResponse

func (*ClientWithResponses) GetItemByIdWithResponse added in v1.0.1

func (c *ClientWithResponses) GetItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*GetItemByIdResponse, error)

GetItemByIdWithResponse request returning *GetItemByIdResponse

func (*ClientWithResponses) ListBackendsWithResponse added in v1.0.1

func (c *ClientWithResponses) ListBackendsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBackendsResponse, error)

ListBackendsWithResponse request returning *ListBackendsResponse

func (*ClientWithResponses) ListEntitiesWithResponse added in v1.0.1

func (c *ClientWithResponses) ListEntitiesWithResponse(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error)

ListEntitiesWithResponse request returning *ListEntitiesResponse

func (*ClientWithResponses) ListItemsWithResponse added in v1.0.1

func (c *ClientWithResponses) ListItemsWithResponse(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*ListItemsResponse, error)

ListItemsWithResponse request returning *ListItemsResponse

func (*ClientWithResponses) UpdateItemByIdWithBodyWithResponse added in v1.0.3

func (c *ClientWithResponses) UpdateItemByIdWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateItemByIdResponse, error)

UpdateItemByIdWithBodyWithResponse request with arbitrary body returning *UpdateItemByIdResponse

func (*ClientWithResponses) UpdateItemByIdWithResponse added in v1.0.1

func (c *ClientWithResponses) UpdateItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, body UpdateItemByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateItemByIdResponse, error)

type ClientWithResponsesInterface added in v1.0.1

type ClientWithResponsesInterface interface {
	// ListBackendsWithResponse request
	ListBackendsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBackendsResponse, error)

	// ListEntitiesWithResponse request
	ListEntitiesWithResponse(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error)

	// ListItemsWithResponse request
	ListItemsWithResponse(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*ListItemsResponse, error)

	// CreateItemWithBodyWithResponse request with any body
	CreateItemWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)

	CreateItemWithResponse(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)

	// DeleteItemByIdWithResponse request
	DeleteItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*DeleteItemByIdResponse, error)

	// GetItemByIdWithResponse request
	GetItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*GetItemByIdResponse, error)

	// ExistsItemByIdWithResponse request
	ExistsItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*ExistsItemByIdResponse, error)

	// UpdateItemByIdWithBodyWithResponse request with any body
	UpdateItemByIdWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateItemByIdResponse, error)

	UpdateItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, body UpdateItemByIdJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateItemByIdResponse, error)
}

ClientWithResponsesInterface is the interface specification for the client with responses above.

type CreateItemJSONRequestBody

type CreateItemJSONRequestBody = UntypedDto

CreateItemJSONRequestBody defines body for CreateItem for application/json ContentType.

type CreateItemResponse added in v1.0.1

type CreateItemResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON201      *UntypedDto
}

func ParseCreateItemResponse added in v1.0.1

func ParseCreateItemResponse(rsp *http.Response) (*CreateItemResponse, error)

ParseCreateItemResponse parses an HTTP response from a CreateItemWithResponse call

func (CreateItemResponse) Status added in v1.0.1

func (r CreateItemResponse) Status() string

Status returns HTTPResponse.Status

func (CreateItemResponse) StatusCode added in v1.0.1

func (r CreateItemResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type DeleteItemByIdResponse added in v1.0.1

type DeleteItemByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseDeleteItemByIdResponse added in v1.0.1

func ParseDeleteItemByIdResponse(rsp *http.Response) (*DeleteItemByIdResponse, error)

ParseDeleteItemByIdResponse parses an HTTP response from a DeleteItemByIdWithResponse call

func (DeleteItemByIdResponse) Status added in v1.0.1

func (r DeleteItemByIdResponse) Status() string

Status returns HTTPResponse.Status

func (DeleteItemByIdResponse) StatusCode added in v1.0.1

func (r DeleteItemByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type Entity

type Entity = string

Entity defines model for entity.

type ExistsItemByIdResponse added in v1.0.1

type ExistsItemByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
}

func ParseExistsItemByIdResponse added in v1.0.1

func ParseExistsItemByIdResponse(rsp *http.Response) (*ExistsItemByIdResponse, error)

ParseExistsItemByIdResponse parses an HTTP response from a ExistsItemByIdWithResponse call

func (ExistsItemByIdResponse) Status added in v1.0.1

func (r ExistsItemByIdResponse) Status() string

Status returns HTTPResponse.Status

func (ExistsItemByIdResponse) StatusCode added in v1.0.1

func (r ExistsItemByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GetItemByIdResponse added in v1.0.1

type GetItemByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UntypedDto
}

func ParseGetItemByIdResponse added in v1.0.1

func ParseGetItemByIdResponse(rsp *http.Response) (*GetItemByIdResponse, error)

ParseGetItemByIdResponse parses an HTTP response from a GetItemByIdWithResponse call

func (GetItemByIdResponse) Status added in v1.0.1

func (r GetItemByIdResponse) Status() string

Status returns HTTPResponse.Status

func (GetItemByIdResponse) StatusCode added in v1.0.1

func (r GetItemByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type GorillaServerOptions

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

type HttpRequestDoer added in v1.0.1

type HttpRequestDoer interface {
	Do(req *http.Request) (*http.Response, error)
}

Doer performs HTTP requests.

The standard http.Client implements this interface.

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 ListBackendsResponse added in v1.0.1

type ListBackendsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *NameList
}

func ParseListBackendsResponse added in v1.0.1

func ParseListBackendsResponse(rsp *http.Response) (*ListBackendsResponse, error)

ParseListBackendsResponse parses an HTTP response from a ListBackendsWithResponse call

func (ListBackendsResponse) Status added in v1.0.1

func (r ListBackendsResponse) Status() string

Status returns HTTPResponse.Status

func (ListBackendsResponse) StatusCode added in v1.0.1

func (r ListBackendsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListEntitiesResponse added in v1.0.1

type ListEntitiesResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *NameList
}

func ParseListEntitiesResponse added in v1.0.1

func ParseListEntitiesResponse(rsp *http.Response) (*ListEntitiesResponse, error)

ParseListEntitiesResponse parses an HTTP response from a ListEntitiesWithResponse call

func (ListEntitiesResponse) Status added in v1.0.1

func (r ListEntitiesResponse) Status() string

Status returns HTTPResponse.Status

func (ListEntitiesResponse) StatusCode added in v1.0.1

func (r ListEntitiesResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type ListItemsParams

type ListItemsParams struct {
	// PageOffset Page offset
	PageOffset *int `form:"page-offset,omitempty" json:"page-offset,omitempty"`

	// PageSize Page size
	PageSize *int `form:"page-size,omitempty" json:"page-size,omitempty"`

	// Order List of order instructions in form of `key=direction`.
	// Key represents entity field (column) and direction is one of `ASC` or `DESC`,
	// for example `name=ASC` or `id=DESC`.
	// Direction can be omitted, in such case `ASC` is assumed.
	Order *[]string `form:"order[],omitempty" json:"order[],omitempty"`

	// Filter Filter is JSON-encoded FilterExpression.
	// Currently supported types are `simple`, `not` and `junction`.
	// Examples:
	//
	// - `{"simple": { "name": "id", "op": "=", "val" : 1}}`
	//
	//    is equivalent to SQL `id=1`
	//
	// - `{"not": { "simple": { "name": "id", "op": ">", "val" : 100}}}`
	//
	//    is equivalent to SQL `NOT (id>100)`
	//
	// - `{"junction": {"op": "AND", "sub" : [{"simple": { "name": "age", "op": ">", "val" : 35}}, {"simple": { "name": "salary", "op": ">", "val" : 5000}}]}}`
	//
	//    is equivalent to SQL `(age>35) AND (salary > 5000)`
	Filter *string `form:"filter,omitempty" json:"filter,omitempty"`
}

ListItemsParams defines parameters for ListItems.

type ListItemsResponse added in v1.0.1

type ListItemsResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *PagedResult
}

func ParseListItemsResponse added in v1.0.1

func ParseListItemsResponse(rsp *http.Response) (*ListItemsResponse, error)

ParseListItemsResponse parses an HTTP response from a ListItemsWithResponse call

func (ListItemsResponse) Status added in v1.0.1

func (r ListItemsResponse) Status() string

Status returns HTTPResponse.Status

func (ListItemsResponse) StatusCode added in v1.0.1

func (r ListItemsResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

type MiddlewareFunc

type MiddlewareFunc func(http.Handler) http.Handler

type NameList

type NameList = []string

NameList List of names, such as backends or entities

type PagedResult added in v1.0.1

type PagedResult struct {
	Data *[]UntypedDto `json:"data,omitempty"`

	// Offset Offset of current page from the beginning
	Offset *float32 `json:"offset,omitempty"`

	// TotalCount Total number of items matching current filter
	TotalCount *float32 `json:"total_count,omitempty"`
}

PagedResult Paged list of items

type RequestEditorFn added in v1.0.1

type RequestEditorFn func(ctx context.Context, req *http.Request) error

RequestEditorFn is the function signature for the RequestEditor callback function

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 {
	// List all configured backends
	// (GET /backends)
	ListBackends(w http.ResponseWriter, r *http.Request)
	// List all known entities within backend
	// (GET /{backend}/entities)
	ListEntities(w http.ResponseWriter, r *http.Request, backend Backend)
	// List entity items
	// (GET /{backend}/{entity})
	ListItems(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, params ListItemsParams)
	// Create new entity item
	// (POST /{backend}/{entity})
	CreateItem(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity)
	// Delete entity item by ID
	// (DELETE /{backend}/{entity}/{id})
	DeleteItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id string)
	// Get entity item by ID
	// (GET /{backend}/{entity}/{id})
	GetItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id string)
	// Check for existence of entity item by ID
	// (HEAD /{backend}/{entity}/{id})
	ExistsItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id string)
	// Update entity item in-place by ID
	// (PUT /{backend}/{entity}/{id})
	UpdateItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id 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) CreateItem

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

CreateItem operation middleware

func (*ServerInterfaceWrapper) DeleteItemById

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

DeleteItemById operation middleware

func (*ServerInterfaceWrapper) ExistsItemById

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

ExistsItemById operation middleware

func (*ServerInterfaceWrapper) GetItemById

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

GetItemById operation middleware

func (*ServerInterfaceWrapper) ListBackends

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

ListBackends operation middleware

func (*ServerInterfaceWrapper) ListEntities

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

ListEntities operation middleware

func (*ServerInterfaceWrapper) ListItems

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

ListItems operation middleware

func (*ServerInterfaceWrapper) UpdateItemById

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

UpdateItemById 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

type UntypedDto

type UntypedDto map[string]interface{}

UntypedDto Unstructured content, dictionary of string-to-any values.

type UpdateItemByIdJSONRequestBody added in v1.0.3

type UpdateItemByIdJSONRequestBody = UntypedDto

UpdateItemByIdJSONRequestBody defines body for UpdateItemById for application/json ContentType.

type UpdateItemByIdResponse added in v1.0.1

type UpdateItemByIdResponse struct {
	Body         []byte
	HTTPResponse *http.Response
	JSON200      *UntypedDto
}

func ParseUpdateItemByIdResponse added in v1.0.1

func ParseUpdateItemByIdResponse(rsp *http.Response) (*UpdateItemByIdResponse, error)

ParseUpdateItemByIdResponse parses an HTTP response from a UpdateItemByIdWithResponse call

func (UpdateItemByIdResponse) Status added in v1.0.1

func (r UpdateItemByIdResponse) Status() string

Status returns HTTPResponse.Status

func (UpdateItemByIdResponse) StatusCode added in v1.0.1

func (r UpdateItemByIdResponse) StatusCode() int

StatusCode returns HTTPResponse.StatusCode

Jump to

Keyboard shortcuts

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