Documentation
¶
Overview ¶
Package apogy provides primitives to interact with the openapi HTTP API.
Code generated by github.com/deepmap/oapi-codegen version v1.16.3 DO NOT EDIT.
Index ¶
- func IsErrorConflict(e error) bool
- func IsErrorValidationFailed(e error) bool
- func NewDeleteDocumentRequest(server string, model string, id string) (*http.Request, error)
- func NewGetDocumentRequest(server string, model string, id string) (*http.Request, error)
- func NewPutDocumentRequest(server string, body PutDocumentJSONRequestBody) (*http.Request, error)
- func NewPutDocumentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewQueryDocumentsRequest(server string, body QueryDocumentsJSONRequestBody) (*http.Request, error)
- func NewQueryDocumentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewSearchDocumentsRequest(server string, body SearchDocumentsJSONRequestBody) (*http.Request, error)
- func NewSearchDocumentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func RegisterHandlers(router EchoRouter, si ServerInterface)
- func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
- type Client
- func (c *Client) DeleteDocument(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) GetDocument(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) PutDocument(ctx context.Context, body PutDocumentJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) PutDocumentWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) QueryDocuments(ctx context.Context, body QueryDocumentsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) QueryDocumentsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) SearchDocuments(ctx context.Context, body SearchDocumentsJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SearchDocumentsWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) DeleteDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*DeleteDocumentResponse, error)
- func (c *ClientWithResponses) GetDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*GetDocumentResponse, error)
- func (c *ClientWithResponses) PutDocumentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*PutDocumentResponse, error)
- func (c *ClientWithResponses) PutDocumentWithResponse(ctx context.Context, body PutDocumentJSONRequestBody, ...) (*PutDocumentResponse, error)
- func (client *ClientWithResponses) Query(ctx context.Context, q string, args ...interface{}) iter.Seq2[*Document, error]
- func (c *ClientWithResponses) QueryDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*QueryDocumentsResponse, error)
- func (c *ClientWithResponses) QueryDocumentsWithResponse(ctx context.Context, body QueryDocumentsJSONRequestBody, ...) (*QueryDocumentsResponse, error)
- func (client *ClientWithResponses) QueryOne(ctx context.Context, q string, args ...interface{}) (*Document, error)
- func (c *ClientWithResponses) SearchDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SearchDocumentsResponse, error)
- func (c *ClientWithResponses) SearchDocumentsWithResponse(ctx context.Context, body SearchDocumentsJSONRequestBody, ...) (*SearchDocumentsResponse, error)
- type ClientWithResponsesInterface
- type DeleteDocument200Response
- type DeleteDocument400JSONResponse
- type DeleteDocument404Response
- type DeleteDocumentRequestObject
- type DeleteDocumentResponse
- type DeleteDocumentResponseObject
- type Document
- type EchoRouter
- type Error
- type ErrorResponse
- type Filter
- type GetDocument200JSONResponse
- type GetDocumentRequestObject
- type GetDocumentResponse
- type GetDocumentResponseObject
- type History
- type HttpRequestDoer
- type Mutation
- type Mutations
- type PutDocument200JSONResponse
- type PutDocument400JSONResponse
- type PutDocument409JSONResponse
- type PutDocument422JSONResponse
- type PutDocumentJSONRequestBody
- type PutDocumentRequestObject
- type PutDocumentResponse
- type PutDocumentResponseObject
- type Query
- type QueryDocuments200JSONResponse
- type QueryDocuments400JSONResponse
- type QueryDocumentsJSONRequestBody
- type QueryDocumentsRequestObject
- type QueryDocumentsResponse
- type QueryDocumentsResponseObject
- type ReactorActivation
- type ReactorDone
- type ReactorIn
- type ReactorOut
- type ReactorStart
- type ReactorWorking
- type RequestEditorFn
- type SearchDocuments200JSONResponse
- type SearchDocuments400JSONResponse
- type SearchDocumentsJSONRequestBody
- type SearchDocumentsRequestObject
- type SearchDocumentsResponse
- type SearchDocumentsResponseObject
- type SearchRequest
- type SearchResponse
- type ServerInterface
- type ServerInterfaceWrapper
- func (w *ServerInterfaceWrapper) DeleteDocument(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) GetDocument(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) PutDocument(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) QueryDocuments(ctx echo.Context) error
- func (w *ServerInterfaceWrapper) SearchDocuments(ctx echo.Context) error
- type StrictHandlerFunc
- type StrictMiddlewareFunc
- type StrictServerInterface
- type TypedClient
- func (c *TypedClient[Doc]) Delete(ctx context.Context, id string, reqEditors ...RequestEditorFn) error
- func (c *TypedClient[Doc]) Get(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*Doc, error)
- func (c *TypedClient[Doc]) MutOne(ctx context.Context, id string, muts interface{}, ...) (*Doc, error)
- func (c *TypedClient[Doc]) Put(ctx context.Context, body *Doc, reqEditors ...RequestEditorFn) (*Doc, error)
- func (c *TypedClient[Doc]) Query(ctx context.Context, args ...interface{}) iter.Seq2[*Doc, error]
- func (c *TypedClient[Doc]) QueryOne(ctx context.Context, args ...interface{}) (*Doc, error)
- type TypedSearchResponse
- type ValidationRequest
- type ValidationResponse
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsErrorConflict ¶ added in v0.0.13
func IsErrorValidationFailed ¶ added in v0.0.12
func NewDeleteDocumentRequest ¶ added in v0.0.3
NewDeleteDocumentRequest generates requests for DeleteDocument
func NewGetDocumentRequest ¶
NewGetDocumentRequest generates requests for GetDocument
func NewPutDocumentRequest ¶
func NewPutDocumentRequest(server string, body PutDocumentJSONRequestBody) (*http.Request, error)
NewPutDocumentRequest calls the generic PutDocument builder with application/json body
func NewPutDocumentRequestWithBody ¶
func NewPutDocumentRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewPutDocumentRequestWithBody generates requests for PutDocument with any type of body
func NewQueryDocumentsRequest ¶ added in v0.0.8
func NewQueryDocumentsRequest(server string, body QueryDocumentsJSONRequestBody) (*http.Request, error)
NewQueryDocumentsRequest calls the generic QueryDocuments builder with application/json body
func NewQueryDocumentsRequestWithBody ¶ added in v0.0.8
func NewQueryDocumentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewQueryDocumentsRequestWithBody generates requests for QueryDocuments with any type of body
func NewSearchDocumentsRequest ¶
func NewSearchDocumentsRequest(server string, body SearchDocumentsJSONRequestBody) (*http.Request, error)
NewSearchDocumentsRequest calls the generic SearchDocuments builder with application/json body
func NewSearchDocumentsRequestWithBody ¶
func NewSearchDocumentsRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSearchDocumentsRequestWithBody generates requests for SearchDocuments with any type of body
func RegisterHandlers ¶
func RegisterHandlers(router EchoRouter, si ServerInterface)
RegisterHandlers adds each server route to the EchoRouter.
func RegisterHandlersWithBaseURL ¶
func RegisterHandlersWithBaseURL(router EchoRouter, si ServerInterface, baseURL string)
Registers handlers, and prepends BaseURL to the paths, so that the paths can be served under a prefix.
Types ¶
type Client ¶
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 ¶
func NewClient(server string, opts ...ClientOption) (*Client, error)
Creates a new Client, with reasonable defaults
func (*Client) DeleteDocument ¶ added in v0.0.3
func (*Client) GetDocument ¶
func (*Client) PutDocument ¶
func (c *Client) PutDocument(ctx context.Context, body PutDocumentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) PutDocumentWithBody ¶
func (*Client) QueryDocuments ¶ added in v0.0.8
func (c *Client) QueryDocuments(ctx context.Context, body QueryDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) QueryDocumentsWithBody ¶ added in v0.0.8
func (*Client) SearchDocuments ¶
func (c *Client) SearchDocuments(ctx context.Context, body SearchDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
type ClientInterface ¶
type ClientInterface interface {
// PutDocumentWithBody request with any body
PutDocumentWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
PutDocument(ctx context.Context, body PutDocumentJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryDocumentsWithBody request with any body
QueryDocumentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
QueryDocuments(ctx context.Context, body QueryDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SearchDocumentsWithBody request with any body
SearchDocumentsWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SearchDocuments(ctx context.Context, body SearchDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteDocument request
DeleteDocument(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetDocument request
GetDocument(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
}
The interface specification for the client above.
type ClientOption ¶
ClientOption allows setting custom parameters during construction
func WithHTTPClient ¶
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 ¶
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 ¶
type ClientWithResponses struct {
ClientInterface
}
ClientWithResponses builds on ClientInterface to offer response payloads
func NewClientWithResponses ¶
func NewClientWithResponses(server string, opts ...ClientOption) (*ClientWithResponses, error)
NewClientWithResponses creates a new ClientWithResponses, which wraps Client with return type handling
func (*ClientWithResponses) DeleteDocumentWithResponse ¶ added in v0.0.3
func (c *ClientWithResponses) DeleteDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*DeleteDocumentResponse, error)
DeleteDocumentWithResponse request returning *DeleteDocumentResponse
func (*ClientWithResponses) GetDocumentWithResponse ¶
func (c *ClientWithResponses) GetDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*GetDocumentResponse, error)
GetDocumentWithResponse request returning *GetDocumentResponse
func (*ClientWithResponses) PutDocumentWithBodyWithResponse ¶
func (c *ClientWithResponses) PutDocumentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutDocumentResponse, error)
PutDocumentWithBodyWithResponse request with arbitrary body returning *PutDocumentResponse
func (*ClientWithResponses) PutDocumentWithResponse ¶
func (c *ClientWithResponses) PutDocumentWithResponse(ctx context.Context, body PutDocumentJSONRequestBody, reqEditors ...RequestEditorFn) (*PutDocumentResponse, error)
func (*ClientWithResponses) QueryDocumentsWithBodyWithResponse ¶ added in v0.0.8
func (c *ClientWithResponses) QueryDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryDocumentsResponse, error)
QueryDocumentsWithBodyWithResponse request with arbitrary body returning *QueryDocumentsResponse
func (*ClientWithResponses) QueryDocumentsWithResponse ¶ added in v0.0.8
func (c *ClientWithResponses) QueryDocumentsWithResponse(ctx context.Context, body QueryDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryDocumentsResponse, error)
func (*ClientWithResponses) SearchDocumentsWithBodyWithResponse ¶
func (c *ClientWithResponses) SearchDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchDocumentsResponse, error)
SearchDocumentsWithBodyWithResponse request with arbitrary body returning *SearchDocumentsResponse
func (*ClientWithResponses) SearchDocumentsWithResponse ¶
func (c *ClientWithResponses) SearchDocumentsWithResponse(ctx context.Context, body SearchDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchDocumentsResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// PutDocumentWithBodyWithResponse request with any body
PutDocumentWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*PutDocumentResponse, error)
PutDocumentWithResponse(ctx context.Context, body PutDocumentJSONRequestBody, reqEditors ...RequestEditorFn) (*PutDocumentResponse, error)
// QueryDocumentsWithBodyWithResponse request with any body
QueryDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*QueryDocumentsResponse, error)
QueryDocumentsWithResponse(ctx context.Context, body QueryDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*QueryDocumentsResponse, error)
// SearchDocumentsWithBodyWithResponse request with any body
SearchDocumentsWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchDocumentsResponse, error)
SearchDocumentsWithResponse(ctx context.Context, body SearchDocumentsJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchDocumentsResponse, error)
// DeleteDocumentWithResponse request
DeleteDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*DeleteDocumentResponse, error)
// GetDocumentWithResponse request
GetDocumentWithResponse(ctx context.Context, model string, id string, reqEditors ...RequestEditorFn) (*GetDocumentResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type DeleteDocument200Response ¶ added in v0.0.3
type DeleteDocument200Response struct {
}
func (DeleteDocument200Response) VisitDeleteDocumentResponse ¶ added in v0.0.3
func (response DeleteDocument200Response) VisitDeleteDocumentResponse(w http.ResponseWriter) error
type DeleteDocument400JSONResponse ¶ added in v0.0.4
type DeleteDocument400JSONResponse ErrorResponse
func (DeleteDocument400JSONResponse) VisitDeleteDocumentResponse ¶ added in v0.0.4
func (response DeleteDocument400JSONResponse) VisitDeleteDocumentResponse(w http.ResponseWriter) error
type DeleteDocument404Response ¶ added in v0.0.3
type DeleteDocument404Response struct {
}
func (DeleteDocument404Response) VisitDeleteDocumentResponse ¶ added in v0.0.3
func (response DeleteDocument404Response) VisitDeleteDocumentResponse(w http.ResponseWriter) error
type DeleteDocumentRequestObject ¶ added in v0.0.3
type DeleteDocumentResponse ¶ added in v0.0.3
type DeleteDocumentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *ErrorResponse
}
func ParseDeleteDocumentResponse ¶ added in v0.0.3
func ParseDeleteDocumentResponse(rsp *http.Response) (*DeleteDocumentResponse, error)
ParseDeleteDocumentResponse parses an HTTP response from a DeleteDocumentWithResponse call
func (DeleteDocumentResponse) Status ¶ added in v0.0.3
func (r DeleteDocumentResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteDocumentResponse) StatusCode ¶ added in v0.0.3
func (r DeleteDocumentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type DeleteDocumentResponseObject ¶ added in v0.0.3
type DeleteDocumentResponseObject interface {
VisitDeleteDocumentResponse(w http.ResponseWriter) error
}
type Document ¶
type Document struct {
History *History `json:"history,omitempty"`
Id string `json:"id"`
Model string `json:"model"`
Mut *Mutations `json:"mut,omitempty"`
Status *map[string]interface{} `json:"status,omitempty"`
Val interface{} `json:"val"`
Version *uint64 `json:"version,omitempty"`
}
Document defines model for Document.
type EchoRouter ¶
type EchoRouter interface {
CONNECT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
DELETE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
GET(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
HEAD(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
OPTIONS(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PATCH(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
POST(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
PUT(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
TRACE(path string, h echo.HandlerFunc, m ...echo.MiddlewareFunc) *echo.Route
}
This is a simple interface which specifies echo.Route addition functions which are present on both echo.Echo and echo.Group, since we want to allow using either of them for path registration
type ErrorResponse ¶
type ErrorResponse struct {
Message *string `json:"message,omitempty"`
}
ErrorResponse defines model for ErrorResponse.
type Filter ¶
type Filter struct {
Equal *interface{} `json:"equal,omitempty"`
Greater *interface{} `json:"greater,omitempty"`
Key string `json:"key"`
Less *interface{} `json:"less,omitempty"`
Prefix *interface{} `json:"prefix,omitempty"`
Skip *interface{} `json:"skip,omitempty"`
}
Filter defines model for Filter.
type GetDocument200JSONResponse ¶
type GetDocument200JSONResponse Document
func (GetDocument200JSONResponse) VisitGetDocumentResponse ¶
func (response GetDocument200JSONResponse) VisitGetDocumentResponse(w http.ResponseWriter) error
type GetDocumentResponse ¶
func ParseGetDocumentResponse ¶
func ParseGetDocumentResponse(rsp *http.Response) (*GetDocumentResponse, error)
ParseGetDocumentResponse parses an HTTP response from a GetDocumentWithResponse call
func (GetDocumentResponse) Status ¶
func (r GetDocumentResponse) Status() string
Status returns HTTPResponse.Status
func (GetDocumentResponse) StatusCode ¶
func (r GetDocumentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type GetDocumentResponseObject ¶
type GetDocumentResponseObject interface {
VisitGetDocumentResponse(w http.ResponseWriter) error
}
type History ¶
type History struct {
Created *time.Time `json:"created,omitempty"`
Updated *time.Time `json:"updated,omitempty"`
}
History defines model for History.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type Mutation ¶ added in v0.0.12
type Mutation struct {
Add *interface{} `json:"add,omitempty"`
Div *interface{} `json:"div,omitempty"`
Max *interface{} `json:"max,omitempty"`
Min *interface{} `json:"min,omitempty"`
Mul *interface{} `json:"mul,omitempty"`
Set *interface{} `json:"set,omitempty"`
Sub *interface{} `json:"sub,omitempty"`
}
Mutation defines model for Mutation.
type PutDocument200JSONResponse ¶
type PutDocument200JSONResponse Document
func (PutDocument200JSONResponse) VisitPutDocumentResponse ¶
func (response PutDocument200JSONResponse) VisitPutDocumentResponse(w http.ResponseWriter) error
type PutDocument400JSONResponse ¶
type PutDocument400JSONResponse ErrorResponse
func (PutDocument400JSONResponse) VisitPutDocumentResponse ¶
func (response PutDocument400JSONResponse) VisitPutDocumentResponse(w http.ResponseWriter) error
type PutDocument409JSONResponse ¶ added in v0.0.4
type PutDocument409JSONResponse ErrorResponse
func (PutDocument409JSONResponse) VisitPutDocumentResponse ¶ added in v0.0.4
func (response PutDocument409JSONResponse) VisitPutDocumentResponse(w http.ResponseWriter) error
type PutDocument422JSONResponse ¶ added in v0.0.12
type PutDocument422JSONResponse ErrorResponse
func (PutDocument422JSONResponse) VisitPutDocumentResponse ¶ added in v0.0.12
func (response PutDocument422JSONResponse) VisitPutDocumentResponse(w http.ResponseWriter) error
type PutDocumentJSONRequestBody ¶
type PutDocumentJSONRequestBody = Document
PutDocumentJSONRequestBody defines body for PutDocument for application/json ContentType.
type PutDocumentRequestObject ¶
type PutDocumentRequestObject struct {
Body *PutDocumentJSONRequestBody
}
type PutDocumentResponse ¶
type PutDocumentResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *Document
JSON400 *ErrorResponse
JSON409 *ErrorResponse
JSON422 *ErrorResponse
}
func ParsePutDocumentResponse ¶
func ParsePutDocumentResponse(rsp *http.Response) (*PutDocumentResponse, error)
ParsePutDocumentResponse parses an HTTP response from a PutDocumentWithResponse call
func (PutDocumentResponse) Status ¶
func (r PutDocumentResponse) Status() string
Status returns HTTPResponse.Status
func (PutDocumentResponse) StatusCode ¶
func (r PutDocumentResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type PutDocumentResponseObject ¶
type PutDocumentResponseObject interface {
VisitPutDocumentResponse(w http.ResponseWriter) error
}
type Query ¶ added in v0.0.8
type Query struct {
Cursor *string `json:"cursor,omitempty"`
Limit *int `json:"limit,omitempty"`
Params *[]interface{} `json:"params,omitempty"`
Q string `json:"q"`
}
Query defines model for Query.
type QueryDocuments200JSONResponse ¶ added in v0.0.8
type QueryDocuments200JSONResponse SearchResponse
func (QueryDocuments200JSONResponse) VisitQueryDocumentsResponse ¶ added in v0.0.8
func (response QueryDocuments200JSONResponse) VisitQueryDocumentsResponse(w http.ResponseWriter) error
type QueryDocuments400JSONResponse ¶ added in v0.0.8
type QueryDocuments400JSONResponse ErrorResponse
func (QueryDocuments400JSONResponse) VisitQueryDocumentsResponse ¶ added in v0.0.8
func (response QueryDocuments400JSONResponse) VisitQueryDocumentsResponse(w http.ResponseWriter) error
type QueryDocumentsJSONRequestBody ¶ added in v0.0.8
type QueryDocumentsJSONRequestBody = Query
QueryDocumentsJSONRequestBody defines body for QueryDocuments for application/json ContentType.
type QueryDocumentsRequestObject ¶ added in v0.0.8
type QueryDocumentsRequestObject struct {
Body *QueryDocumentsJSONRequestBody
}
type QueryDocumentsResponse ¶ added in v0.0.8
type QueryDocumentsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SearchResponse
JSON400 *ErrorResponse
}
func ParseQueryDocumentsResponse ¶ added in v0.0.8
func ParseQueryDocumentsResponse(rsp *http.Response) (*QueryDocumentsResponse, error)
ParseQueryDocumentsResponse parses an HTTP response from a QueryDocumentsWithResponse call
func (QueryDocumentsResponse) Status ¶ added in v0.0.8
func (r QueryDocumentsResponse) Status() string
Status returns HTTPResponse.Status
func (QueryDocumentsResponse) StatusCode ¶ added in v0.0.8
func (r QueryDocumentsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type QueryDocumentsResponseObject ¶ added in v0.0.8
type QueryDocumentsResponseObject interface {
VisitQueryDocumentsResponse(w http.ResponseWriter) error
}
type ReactorActivation ¶
type ReactorActivation struct {
Id string `json:"id"`
Model string `json:"model"`
Version uint64 `json:"version"`
}
ReactorActivation defines model for ReactorActivation.
type ReactorDone ¶
type ReactorDone = map[string]interface{}
ReactorDone defines model for ReactorDone.
type ReactorIn ¶
type ReactorIn struct {
Done *ReactorDone `json:"done,omitempty"`
Start *ReactorStart `json:"start,omitempty"`
Working *ReactorWorking `json:"working,omitempty"`
}
ReactorIn defines model for ReactorIn.
type ReactorOut ¶
type ReactorOut struct {
Activation *ReactorActivation `json:"activation,omitempty"`
}
ReactorOut defines model for ReactorOut.
type ReactorStart ¶
type ReactorStart struct {
Id string `json:"id"`
}
ReactorStart defines model for ReactorStart.
type ReactorWorking ¶
type ReactorWorking = map[string]interface{}
ReactorWorking defines model for ReactorWorking.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type SearchDocuments200JSONResponse ¶
type SearchDocuments200JSONResponse SearchResponse
func (SearchDocuments200JSONResponse) VisitSearchDocumentsResponse ¶
func (response SearchDocuments200JSONResponse) VisitSearchDocumentsResponse(w http.ResponseWriter) error
type SearchDocuments400JSONResponse ¶ added in v0.0.4
type SearchDocuments400JSONResponse ErrorResponse
func (SearchDocuments400JSONResponse) VisitSearchDocumentsResponse ¶ added in v0.0.4
func (response SearchDocuments400JSONResponse) VisitSearchDocumentsResponse(w http.ResponseWriter) error
type SearchDocumentsJSONRequestBody ¶
type SearchDocumentsJSONRequestBody = SearchRequest
SearchDocumentsJSONRequestBody defines body for SearchDocuments for application/json ContentType.
type SearchDocumentsRequestObject ¶
type SearchDocumentsRequestObject struct {
Body *SearchDocumentsJSONRequestBody
}
type SearchDocumentsResponse ¶
type SearchDocumentsResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SearchResponse
JSON400 *ErrorResponse
}
func ParseSearchDocumentsResponse ¶
func ParseSearchDocumentsResponse(rsp *http.Response) (*SearchDocumentsResponse, error)
ParseSearchDocumentsResponse parses an HTTP response from a SearchDocumentsWithResponse call
func (SearchDocumentsResponse) Status ¶
func (r SearchDocumentsResponse) Status() string
Status returns HTTPResponse.Status
func (SearchDocumentsResponse) StatusCode ¶
func (r SearchDocumentsResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SearchDocumentsResponseObject ¶
type SearchDocumentsResponseObject interface {
VisitSearchDocumentsResponse(w http.ResponseWriter) error
}
type SearchRequest ¶
type SearchRequest struct {
Cursor *string `json:"cursor,omitempty"`
Filters *[]Filter `json:"filters,omitempty"`
// Full If true, return full documents instead of just the ids
Full *bool `json:"full,omitempty"`
Limit *int `json:"limit,omitempty"`
Links *[]SearchRequest `json:"links,omitempty"`
Model string `json:"model"`
}
SearchRequest defines model for SearchRequest.
type SearchResponse ¶
type SearchResponse struct {
Cursor *string `json:"cursor,omitempty"`
Documents []Document `json:"documents"`
Error *string `json:"error,omitempty"`
}
SearchResponse defines model for SearchResponse.
type ServerInterface ¶
type ServerInterface interface {
// Create or update a document
// (POST /v1)
PutDocument(ctx echo.Context) error
// Search for documents with AQL
// (POST /v1/q)
QueryDocuments(ctx echo.Context) error
// Search for documents
// (POST /v1/search)
SearchDocuments(ctx echo.Context) error
// Delete a document by model and ID
// (DELETE /v1/{model}/{id})
DeleteDocument(ctx echo.Context, model string, id string) error
// Get a document by model and ID
// (GET /v1/{model}/{id})
GetDocument(ctx echo.Context, model string, id string) error
}
ServerInterface represents all server handlers.
func NewStrictHandler ¶
func NewStrictHandler(ssi StrictServerInterface, middlewares []StrictMiddlewareFunc) ServerInterface
type ServerInterfaceWrapper ¶
type ServerInterfaceWrapper struct {
Handler ServerInterface
}
ServerInterfaceWrapper converts echo contexts to parameters.
func (*ServerInterfaceWrapper) DeleteDocument ¶ added in v0.0.3
func (w *ServerInterfaceWrapper) DeleteDocument(ctx echo.Context) error
DeleteDocument converts echo context to params.
func (*ServerInterfaceWrapper) GetDocument ¶
func (w *ServerInterfaceWrapper) GetDocument(ctx echo.Context) error
GetDocument converts echo context to params.
func (*ServerInterfaceWrapper) PutDocument ¶
func (w *ServerInterfaceWrapper) PutDocument(ctx echo.Context) error
PutDocument converts echo context to params.
func (*ServerInterfaceWrapper) QueryDocuments ¶ added in v0.0.8
func (w *ServerInterfaceWrapper) QueryDocuments(ctx echo.Context) error
QueryDocuments converts echo context to params.
func (*ServerInterfaceWrapper) SearchDocuments ¶
func (w *ServerInterfaceWrapper) SearchDocuments(ctx echo.Context) error
SearchDocuments converts echo context to params.
type StrictHandlerFunc ¶
type StrictHandlerFunc = strictecho.StrictEchoHandlerFunc
type StrictMiddlewareFunc ¶
type StrictMiddlewareFunc = strictecho.StrictEchoMiddlewareFunc
type StrictServerInterface ¶
type StrictServerInterface interface {
// Create or update a document
// (POST /v1)
PutDocument(ctx context.Context, request PutDocumentRequestObject) (PutDocumentResponseObject, error)
// Search for documents with AQL
// (POST /v1/q)
QueryDocuments(ctx context.Context, request QueryDocumentsRequestObject) (QueryDocumentsResponseObject, error)
// Search for documents
// (POST /v1/search)
SearchDocuments(ctx context.Context, request SearchDocumentsRequestObject) (SearchDocumentsResponseObject, error)
// Delete a document by model and ID
// (DELETE /v1/{model}/{id})
DeleteDocument(ctx context.Context, request DeleteDocumentRequestObject) (DeleteDocumentResponseObject, error)
// Get a document by model and ID
// (GET /v1/{model}/{id})
GetDocument(ctx context.Context, request GetDocumentRequestObject) (GetDocumentResponseObject, error)
}
StrictServerInterface represents all server handlers.
type TypedClient ¶ added in v0.0.8
func (*TypedClient[Doc]) Delete ¶ added in v0.0.8
func (c *TypedClient[Doc]) Delete(ctx context.Context, id string, reqEditors ...RequestEditorFn) error
func (*TypedClient[Doc]) Get ¶ added in v0.0.8
func (c *TypedClient[Doc]) Get(ctx context.Context, id string, reqEditors ...RequestEditorFn) (*Doc, error)
func (*TypedClient[Doc]) MutOne ¶ added in v0.0.12
func (c *TypedClient[Doc]) MutOne(ctx context.Context, id string, muts interface{}, reqEditors ...RequestEditorFn) (*Doc, error)
func (*TypedClient[Doc]) Put ¶ added in v0.0.8
func (c *TypedClient[Doc]) Put(ctx context.Context, body *Doc, reqEditors ...RequestEditorFn) (*Doc, error)
type TypedSearchResponse ¶ added in v0.0.8
type ValidationRequest ¶
type ValidationRequest struct {
Current *Document `json:"current,omitempty"`
Pending *Document `json:"pending,omitempty"`
}
ValidationRequest defines model for ValidationRequest.
type ValidationResponse ¶
type ValidationResponse struct {
Document *Document `json:"document,omitempty"`
Reject *struct {
Message *string `json:"message,omitempty"`
} `json:"reject,omitempty"`
}
ValidationResponse defines model for ValidationResponse.