Documentation
¶
Overview ¶
Package todo provides primitives to interact with the openapi HTTP API.
Code generated by github.com/oapi-codegen/oapi-codegen/v2 version v2.5.0 DO NOT EDIT.
Package todo represents the ToDo REST API client generated.
Index ¶
- func NewCreateTaskRequest(server string, body CreateTaskJSONRequestBody) (*http.Request, error)
- func NewCreateTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewDeleteTaskRequest(server string, id googleuuid.UUID) (*http.Request, error)
- func NewReadTaskRequest(server string, id googleuuid.UUID) (*http.Request, error)
- func NewSearchTaskRequest(server string, body SearchTaskJSONRequestBody) (*http.Request, error)
- func NewSearchTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
- func NewUpdateTaskRequest(server string, id googleuuid.UUID, body UpdateTaskJSONRequestBody) (*http.Request, error)
- func NewUpdateTaskRequestWithBody(server string, id googleuuid.UUID, contentType string, body io.Reader) (*http.Request, error)
- type Client
- func (c *Client) CreateTask(ctx context.Context, body CreateTaskJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) CreateTaskWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) DeleteTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ReadTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) SearchTask(ctx context.Context, body SearchTaskJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) SearchTaskWithBody(ctx context.Context, contentType string, body io.Reader, ...) (*http.Response, error)
- func (c *Client) UpdateTask(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, ...) (*http.Response, error)
- func (c *Client) UpdateTaskWithBody(ctx context.Context, id googleuuid.UUID, contentType string, body io.Reader, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientWithResponses
- func (c *ClientWithResponses) CreateTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*CreateTaskResponse, error)
- func (c *ClientWithResponses) CreateTaskWithResponse(ctx context.Context, body CreateTaskJSONRequestBody, ...) (*CreateTaskResponse, error)
- func (c *ClientWithResponses) DeleteTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
- func (c *ClientWithResponses) ReadTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*ReadTaskResponse, error)
- func (c *ClientWithResponses) SearchTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, ...) (*SearchTaskResponse, error)
- func (c *ClientWithResponses) SearchTaskWithResponse(ctx context.Context, body SearchTaskJSONRequestBody, ...) (*SearchTaskResponse, error)
- func (c *ClientWithResponses) UpdateTaskWithBodyWithResponse(ctx context.Context, id googleuuid.UUID, contentType string, body io.Reader, ...) (*UpdateTaskResponse, error)
- func (c *ClientWithResponses) UpdateTaskWithResponse(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, ...) (*UpdateTaskResponse, error)
- type ClientWithResponsesInterface
- type CreateTaskJSONBody
- type CreateTaskJSONRequestBody
- type CreateTaskResponse
- type CreateTasksRequest
- type CreateTasksResponse
- type Dates
- type DeleteTaskResponse
- type ErrorResponse
- type HttpRequestDoer
- type Priority
- type ReadTaskResponse
- type ReadTasksResponse
- type RequestEditorFn
- type SearchTaskJSONBody
- type SearchTaskJSONRequestBody
- type SearchTaskResponse
- type SearchTasksRequest
- type SearchTasksResponse
- type Task
- type UpdateTaskJSONBody
- type UpdateTaskJSONRequestBody
- type UpdateTaskResponse
- type UpdateTasksRequest
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewCreateTaskRequest ¶
func NewCreateTaskRequest(server string, body CreateTaskJSONRequestBody) (*http.Request, error)
NewCreateTaskRequest calls the generic CreateTask builder with application/json body
func NewCreateTaskRequestWithBody ¶
func NewCreateTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewCreateTaskRequestWithBody generates requests for CreateTask with any type of body
func NewDeleteTaskRequest ¶
NewDeleteTaskRequest generates requests for DeleteTask
func NewReadTaskRequest ¶
NewReadTaskRequest generates requests for ReadTask
func NewSearchTaskRequest ¶
func NewSearchTaskRequest(server string, body SearchTaskJSONRequestBody) (*http.Request, error)
NewSearchTaskRequest calls the generic SearchTask builder with application/json body
func NewSearchTaskRequestWithBody ¶
func NewSearchTaskRequestWithBody(server string, contentType string, body io.Reader) (*http.Request, error)
NewSearchTaskRequestWithBody generates requests for SearchTask with any type of body
func NewUpdateTaskRequest ¶
func NewUpdateTaskRequest(server string, id googleuuid.UUID, body UpdateTaskJSONRequestBody) (*http.Request, error)
NewUpdateTaskRequest calls the generic UpdateTask builder with application/json body
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) CreateTask ¶
func (c *Client) CreateTask(ctx context.Context, body CreateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) CreateTaskWithBody ¶
func (*Client) DeleteTask ¶
func (c *Client) DeleteTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) ReadTask ¶
func (c *Client) ReadTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) SearchTask ¶
func (c *Client) SearchTask(ctx context.Context, body SearchTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) SearchTaskWithBody ¶
func (*Client) UpdateTask ¶
func (c *Client) UpdateTask(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
func (*Client) UpdateTaskWithBody ¶
type ClientInterface ¶
type ClientInterface interface {
// CreateTaskWithBody request with any body
CreateTaskWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
CreateTask(ctx context.Context, body CreateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// SearchTaskWithBody request with any body
SearchTaskWithBody(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
SearchTask(ctx context.Context, body SearchTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteTask request
DeleteTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// ReadTask request
ReadTask(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateTaskWithBody request with any body
UpdateTaskWithBody(ctx context.Context, id googleuuid.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
UpdateTask(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, 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) CreateTaskWithBodyWithResponse ¶
func (c *ClientWithResponses) CreateTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTaskResponse, error)
CreateTaskWithBodyWithResponse request with arbitrary body returning *CreateTaskResponse
func (*ClientWithResponses) CreateTaskWithResponse ¶
func (c *ClientWithResponses) CreateTaskWithResponse(ctx context.Context, body CreateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTaskResponse, error)
func (*ClientWithResponses) DeleteTaskWithResponse ¶
func (c *ClientWithResponses) DeleteTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
DeleteTaskWithResponse request returning *DeleteTaskResponse
func (*ClientWithResponses) ReadTaskWithResponse ¶
func (c *ClientWithResponses) ReadTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*ReadTaskResponse, error)
ReadTaskWithResponse request returning *ReadTaskResponse
func (*ClientWithResponses) SearchTaskWithBodyWithResponse ¶
func (c *ClientWithResponses) SearchTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchTaskResponse, error)
SearchTaskWithBodyWithResponse request with arbitrary body returning *SearchTaskResponse
func (*ClientWithResponses) SearchTaskWithResponse ¶
func (c *ClientWithResponses) SearchTaskWithResponse(ctx context.Context, body SearchTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchTaskResponse, error)
func (*ClientWithResponses) UpdateTaskWithBodyWithResponse ¶
func (c *ClientWithResponses) UpdateTaskWithBodyWithResponse(ctx context.Context, id googleuuid.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)
UpdateTaskWithBodyWithResponse request with arbitrary body returning *UpdateTaskResponse
func (*ClientWithResponses) UpdateTaskWithResponse ¶
func (c *ClientWithResponses) UpdateTaskWithResponse(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)
type ClientWithResponsesInterface ¶
type ClientWithResponsesInterface interface {
// CreateTaskWithBodyWithResponse request with any body
CreateTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateTaskResponse, error)
CreateTaskWithResponse(ctx context.Context, body CreateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateTaskResponse, error)
// SearchTaskWithBodyWithResponse request with any body
SearchTaskWithBodyWithResponse(ctx context.Context, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*SearchTaskResponse, error)
SearchTaskWithResponse(ctx context.Context, body SearchTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*SearchTaskResponse, error)
// DeleteTaskWithResponse request
DeleteTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*DeleteTaskResponse, error)
// ReadTaskWithResponse request
ReadTaskWithResponse(ctx context.Context, id googleuuid.UUID, reqEditors ...RequestEditorFn) (*ReadTaskResponse, error)
// UpdateTaskWithBodyWithResponse request with any body
UpdateTaskWithBodyWithResponse(ctx context.Context, id googleuuid.UUID, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)
UpdateTaskWithResponse(ctx context.Context, id googleuuid.UUID, body UpdateTaskJSONRequestBody, reqEditors ...RequestEditorFn) (*UpdateTaskResponse, error)
}
ClientWithResponsesInterface is the interface specification for the client with responses above.
type CreateTaskJSONBody ¶
type CreateTaskJSONBody struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
Priority *Priority `json:"priority,omitempty"`
}
CreateTaskJSONBody defines parameters for CreateTask.
type CreateTaskJSONRequestBody ¶
type CreateTaskJSONRequestBody CreateTaskJSONBody
CreateTaskJSONRequestBody defines body for CreateTask for application/json ContentType.
type CreateTaskResponse ¶
type CreateTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON201 *CreateTasksResponse
JSON400 *ErrorResponse
JSON500 *ErrorResponse
}
func ParseCreateTaskResponse ¶
func ParseCreateTaskResponse(rsp *http.Response) (*CreateTaskResponse, error)
ParseCreateTaskResponse parses an HTTP response from a CreateTaskWithResponse call
func (CreateTaskResponse) Status ¶
func (r CreateTaskResponse) Status() string
Status returns HTTPResponse.Status
func (CreateTaskResponse) StatusCode ¶
func (r CreateTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type CreateTasksRequest ¶
type CreateTasksRequest struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
Priority *Priority `json:"priority,omitempty"`
}
CreateTasksRequest defines model for CreateTasksRequest.
type CreateTasksResponse ¶
type CreateTasksResponse struct {
Task Task `json:"task"`
}
CreateTasksResponse defines model for CreateTasksResponse.
type Dates ¶
type Dates struct {
// Due When the task is expected to be due, seconds are dropped.
Due *time.Time `json:"due"`
// Start When the task is expected to begin, seconds are dropped.
Start *time.Time `json:"start"`
}
Dates defines model for Dates.
type DeleteTaskResponse ¶
type DeleteTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON500 *ErrorResponse
}
func ParseDeleteTaskResponse ¶
func ParseDeleteTaskResponse(rsp *http.Response) (*DeleteTaskResponse, error)
ParseDeleteTaskResponse parses an HTTP response from a DeleteTaskWithResponse call
func (DeleteTaskResponse) Status ¶
func (r DeleteTaskResponse) Status() string
Status returns HTTPResponse.Status
func (DeleteTaskResponse) StatusCode ¶
func (r DeleteTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ErrorResponse ¶
type ErrorResponse struct {
Error string `json:"error"`
}
ErrorResponse defines model for ErrorResponse.
type HttpRequestDoer ¶
Doer performs HTTP requests.
The standard http.Client implements this interface.
type ReadTaskResponse ¶
type ReadTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *ReadTasksResponse
JSON500 *ErrorResponse
}
func ParseReadTaskResponse ¶
func ParseReadTaskResponse(rsp *http.Response) (*ReadTaskResponse, error)
ParseReadTaskResponse parses an HTTP response from a ReadTaskWithResponse call
func (ReadTaskResponse) Status ¶
func (r ReadTaskResponse) Status() string
Status returns HTTPResponse.Status
func (ReadTaskResponse) StatusCode ¶
func (r ReadTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type ReadTasksResponse ¶
type ReadTasksResponse struct {
Task *Task `json:"task,omitempty"`
}
ReadTasksResponse defines model for ReadTasksResponse.
type RequestEditorFn ¶
RequestEditorFn is the function signature for the RequestEditor callback function
type SearchTaskJSONBody ¶
type SearchTaskJSONBody struct {
Description *string `json:"description"`
From int64 `json:"from"`
IsDone *bool `json:"isDone"`
Priority *Priority `json:"priority,omitempty"`
Size int64 `json:"size"`
}
SearchTaskJSONBody defines parameters for SearchTask.
type SearchTaskJSONRequestBody ¶
type SearchTaskJSONRequestBody SearchTaskJSONBody
SearchTaskJSONRequestBody defines body for SearchTask for application/json ContentType.
type SearchTaskResponse ¶
type SearchTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON200 *SearchTasksResponse
JSON400 *ErrorResponse
JSON500 *ErrorResponse
}
func ParseSearchTaskResponse ¶
func ParseSearchTaskResponse(rsp *http.Response) (*SearchTaskResponse, error)
ParseSearchTaskResponse parses an HTTP response from a SearchTaskWithResponse call
func (SearchTaskResponse) Status ¶
func (r SearchTaskResponse) Status() string
Status returns HTTPResponse.Status
func (SearchTaskResponse) StatusCode ¶
func (r SearchTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type SearchTasksRequest ¶
type SearchTasksRequest struct {
Description *string `json:"description"`
From int64 `json:"from"`
IsDone *bool `json:"isDone"`
Priority *Priority `json:"priority,omitempty"`
Size int64 `json:"size"`
}
SearchTasksRequest defines model for SearchTasksRequest.
type SearchTasksResponse ¶
type SearchTasksResponse struct {
Tasks *[]Task `json:"tasks,omitempty"`
Total *int64 `json:"total,omitempty"`
}
SearchTasksResponse defines model for SearchTasksResponse.
type Task ¶
type Task struct {
Dates *Dates `json:"dates,omitempty"`
Description string `json:"description"`
ID googleuuid.UUID `json:"id"`
IsDone *bool `json:"isDone,omitempty"`
Priority *Priority `json:"priority,omitempty"`
}
Task defines model for Task.
type UpdateTaskJSONBody ¶
type UpdateTaskJSONBody struct {
Dates *Dates `json:"dates,omitempty"`
Description *string `json:"description,omitempty"`
IsDone *bool `json:"isDone,omitempty"`
Priority *Priority `json:"priority,omitempty"`
}
UpdateTaskJSONBody defines parameters for UpdateTask.
type UpdateTaskJSONRequestBody ¶
type UpdateTaskJSONRequestBody UpdateTaskJSONBody
UpdateTaskJSONRequestBody defines body for UpdateTask for application/json ContentType.
type UpdateTaskResponse ¶
type UpdateTaskResponse struct {
Body []byte
HTTPResponse *http.Response
JSON400 *ErrorResponse
JSON500 *ErrorResponse
}
func ParseUpdateTaskResponse ¶
func ParseUpdateTaskResponse(rsp *http.Response) (*UpdateTaskResponse, error)
ParseUpdateTaskResponse parses an HTTP response from a UpdateTaskWithResponse call
func (UpdateTaskResponse) Status ¶
func (r UpdateTaskResponse) Status() string
Status returns HTTPResponse.Status
func (UpdateTaskResponse) StatusCode ¶
func (r UpdateTaskResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
elasticsearch-indexer-kafka
command
|
|
|
elasticsearch-indexer-rabbitmq
command
|
|
|
elasticsearch-indexer-redis
command
|
|
|
rest-server
command
|
|
|
Package internal defines the types used to create Tasks and their corresponding attributes.
|
Package internal defines the types used to create Tasks and their corresponding attributes. |
|
elasticsearch
Package elasticsearch implements the Elasticsearch repository.
|
Package elasticsearch implements the Elasticsearch repository. |
|
envvar/envvartesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
kafka
Package kafka implements the Kafka repository to publish events.
|
Package kafka implements the Kafka repository to publish events. |
|
memcached
Package memcached implements the memcached repository to cache tasks.
|
Package memcached implements the memcached repository to cache tasks. |
|
memcached/memcachedtesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
postgresql
Package postgresql implements the PostgreSQL repository for tasks.
|
Package postgresql implements the PostgreSQL repository for tasks. |
|
rabbitmq
Package rabbitmq implements the RabbitMQ repository to publish events.
|
Package rabbitmq implements the RabbitMQ repository to publish events. |
|
redis
Package redis implements the Redis repository to publish events.
|
Package redis implements the Redis repository to publish events. |
|
rest
Package rest provides primitives to interact with the openapi HTTP API.
|
Package rest provides primitives to interact with the openapi HTTP API. |
|
rest/resttesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |
|
service/servicetesting
Code generated by counterfeiter.
|
Code generated by counterfeiter. |