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.8.0 DO NOT EDIT.
Index ¶
- Variables
- func GetSpec() (swagger *openapi3.T, err error)
- func GetSpecJSON() ([]byte, error)
- func GetSwagger() (*openapi3.T, error)deprecated
- func Handler(si ServerInterface) http.Handler
- func HandlerFromMux(si ServerInterface, r *mux.Router) http.Handler
- func HandlerFromMuxWithBaseURL(si ServerInterface, r *mux.Router, baseURL string) http.Handler
- func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
- func NewBulkUpdateRequest(server string, backend Backend, entity Entity, body BulkUpdateJSONRequestBody) (*http.Request, error)
- func NewBulkUpdateRequestWithBody(server string, backend Backend, entity Entity, contentType string, ...) (*http.Request, error)
- func NewCreateItemRequest(server string, backend Backend, entity Entity, body CreateItemJSONRequestBody) (*http.Request, error)
- func NewCreateItemRequestWithBody(server string, backend Backend, entity Entity, contentType string, ...) (*http.Request, error)
- func NewDeleteItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
- func NewExistsItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
- func NewGetItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
- func NewGetVersionInfoRequest(server string) (*http.Request, error)
- func NewListBackendsRequest(server string) (*http.Request, error)
- func NewListEntitiesRequest(server string, backend Backend) (*http.Request, error)
- func NewListItemsRequest(server string, backend Backend, entity Entity, params *ListItemsParams) (*http.Request, error)
- func NewQueryNamedRequest(server string, backend Backend, name string, params *QueryNamedParams) (*http.Request, error)
- func NewUpdateItemByIdRequest(server string, backend Backend, entity Entity, id string, ...) (*http.Request, error)
- func NewUpdateItemByIdRequestWithBody(server string, backend Backend, entity Entity, id string, contentType string, ...) (*http.Request, error)
- func PathToRawSpec(pathToFile string) map[string]func() ([]byte, error)
- type Backend
- type BackendConfig
- type BackendConfigDriver
- type Backends
- type BulkUpdateJSONRequestBody
- type BulkUpdateMode
- type BulkUpdateRequest
- type BulkUpdateResponse
- type Client
- func (c *Client) BulkUpdate(ctx context.Context, backend Backend, entity Entity, ...) (*http.Response, error)
- func (c *Client) BulkUpdateWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, ...) (*http.Response, error)
- func (c *Client) CreateItem(ctx context.Context, backend Backend, entity Entity, ...) (*http.Response, error)
- func (c *Client) CreateItemWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, ...) (*http.Response, error)
- func (c *Client) DeleteItemById(ctx context.Context, backend Backend, entity Entity, id string, ...) (*http.Response, error)
- func (c *Client) ExistsItemById(ctx context.Context, backend Backend, entity Entity, id string, ...) (*http.Response, error)
- func (c *Client) GetItemById(ctx context.Context, backend Backend, entity Entity, id string, ...) (*http.Response, error)
- func (c *Client) GetVersionInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListBackends(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListEntities(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*http.Response, error)
- func (c *Client) ListItems(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, ...) (*http.Response, error)
- func (c *Client) QueryNamed(ctx context.Context, backend Backend, name string, params *QueryNamedParams, ...) (*http.Response, error)
- func (c *Client) UpdateItemById(ctx context.Context, backend Backend, entity Entity, id string, ...) (*http.Response, error)
- func (c *Client) UpdateItemByIdWithBody(ctx context.Context, backend Backend, entity Entity, id string, ...) (*http.Response, error)
- type ClientInterface
- type ClientOption
- type ClientProfile
- type ClientProfileSpec
- type ClientProfiles
- type ClientWithResponses
- func (c *ClientWithResponses) BulkUpdateWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, ...) (*BulkUpdateResponse, error)
- func (c *ClientWithResponses) BulkUpdateWithResponse(ctx context.Context, backend Backend, entity Entity, ...) (*BulkUpdateResponse, error)
- func (c *ClientWithResponses) CreateItemWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, ...) (*CreateItemResponse, error)
- func (c *ClientWithResponses) CreateItemWithResponse(ctx context.Context, backend Backend, entity Entity, ...) (*CreateItemResponse, error)
- func (c *ClientWithResponses) DeleteItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, ...) (*DeleteItemByIdResponse, error)
- func (c *ClientWithResponses) ExistsItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, ...) (*ExistsItemByIdResponse, error)
- func (c *ClientWithResponses) GetItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, ...) (*GetItemByIdResponse, error)
- func (c *ClientWithResponses) GetVersionInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionInfoResponse, error)
- func (c *ClientWithResponses) ListBackendsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBackendsResponse, error)
- func (c *ClientWithResponses) ListEntitiesWithResponse(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error)
- func (c *ClientWithResponses) ListItemsWithResponse(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, ...) (*ListItemsResponse, error)
- func (c *ClientWithResponses) QueryNamedWithResponse(ctx context.Context, backend Backend, name string, params *QueryNamedParams, ...) (*QueryNamedResponse, error)
- func (c *ClientWithResponses) UpdateItemByIdWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, id string, ...) (*UpdateItemByIdResponse, error)
- func (c *ClientWithResponses) UpdateItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, ...) (*UpdateItemByIdResponse, error)
- type ClientWithResponsesInterface
- type Config
- type CreateItemJSONRequestBody
- type CreateItemResponse
- type DeleteItemByIdResponse
- type Entity
- type EntityConfig
- type EntityConfigSpec
- type ErrorObject
- type ExistsItemByIdResponse
- type GetItemByIdResponse
- type GetVersionInfoResponse
- type GorillaServerOptions
- type HttpRequestDoer
- type InvalidParamFormatError
- type ListBackendsResponse
- type ListEntitiesResponse
- type ListItemsParams
- type ListItemsResponse
- type MiddlewareFunc
- type NameList
- type PageOffset
- type PageSize
- type PagedResult
- type QueryNamedParams
- type QueryNamedResponse
- type RequestEditorFn
- type RequiredHeaderError
- type RequiredParamError
- type ServerInterface
- type ServerInterfaceWrapper
- func (siw *ServerInterfaceWrapper) BulkUpdate(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) CreateItem(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) DeleteItemById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ExistsItemById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetItemById(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) GetVersionInfo(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListBackends(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListEntities(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) ListItems(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) QueryNamed(w http.ResponseWriter, r *http.Request)
- func (siw *ServerInterfaceWrapper) UpdateItemById(w http.ResponseWriter, r *http.Request)
- type TooManyValuesForParamError
- type UnescapedCookieParamError
- type UnmarshalingParamError
- type UntypedDto
- type UpdateItemByIdJSONRequestBody
- type UpdateItemByIdResponse
- func (r UpdateItemByIdResponse) ContentType() string
- func (r UpdateItemByIdResponse) GetBody() []byte
- func (r UpdateItemByIdResponse) GetJSON202() *UntypedDto
- func (r UpdateItemByIdResponse) GetJSON404() *ErrorObject
- func (r UpdateItemByIdResponse) Status() string
- func (r UpdateItemByIdResponse) StatusCode() int
Constants ¶
This section is empty.
Variables ¶
Functions ¶
func GetSpec ¶ added in v1.0.7
GetSpec returns the OpenAPI specification corresponding to the generated code in this file. External references in the spec are resolved through PathToRawSpec; externally-referenced files must be embedded in their corresponding Go packages (via the import-mapping feature). URL-based external refs are not supported.
func GetSpecJSON ¶ added in v1.0.7
GetSpecJSON returns the raw JSON bytes of the embedded OpenAPI specification: decompressed but not unmarshaled. External references are not resolved here; the bytes are the spec exactly as embedded by codegen. The result is cached at package init time, so repeated calls are cheap.
func GetSwagger
deprecated
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 HandlerWithOptions ¶
func HandlerWithOptions(si ServerInterface, options GorillaServerOptions) http.Handler
HandlerWithOptions creates http.Handler with additional options
func NewBulkUpdateRequest ¶ added in v1.0.6
func NewBulkUpdateRequest(server string, backend Backend, entity Entity, body BulkUpdateJSONRequestBody) (*http.Request, error)
NewBulkUpdateRequest calls the generic BulkUpdate builder with application/json body
func NewBulkUpdateRequestWithBody ¶ added in v1.0.6
func NewBulkUpdateRequestWithBody(server string, backend Backend, entity Entity, contentType string, body io.Reader) (*http.Request, error)
NewBulkUpdateRequestWithBody constructs an http.Request for the BulkUpdate method, with any body, and a specified content type
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 constructs an http.Request for the CreateItem method, with any body, and a specified content type
func NewDeleteItemByIdRequest ¶ added in v1.0.1
func NewDeleteItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
NewDeleteItemByIdRequest constructs an http.Request for the DeleteItemById method
func NewExistsItemByIdRequest ¶ added in v1.0.1
func NewExistsItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
NewExistsItemByIdRequest constructs an http.Request for the ExistsItemById method
func NewGetItemByIdRequest ¶ added in v1.0.1
func NewGetItemByIdRequest(server string, backend Backend, entity Entity, id string) (*http.Request, error)
NewGetItemByIdRequest constructs an http.Request for the GetItemById method
func NewGetVersionInfoRequest ¶ added in v1.0.7
NewGetVersionInfoRequest constructs an http.Request for the GetVersionInfo method
func NewListBackendsRequest ¶ added in v1.0.1
NewListBackendsRequest constructs an http.Request for the ListBackends method
func NewListEntitiesRequest ¶ added in v1.0.1
NewListEntitiesRequest constructs an http.Request for the ListEntities method
func NewListItemsRequest ¶ added in v1.0.1
func NewListItemsRequest(server string, backend Backend, entity Entity, params *ListItemsParams) (*http.Request, error)
NewListItemsRequest constructs an http.Request for the ListItems method
func NewQueryNamedRequest ¶ added in v1.0.7
func NewQueryNamedRequest(server string, backend Backend, name string, params *QueryNamedParams) (*http.Request, error)
NewQueryNamedRequest constructs an http.Request for the QueryNamed method
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 constructs an http.Request for the UpdateItemById method, with any body, and a specified content type
Types ¶
type BackendConfig ¶ added in v1.0.8
type BackendConfig struct {
ConnMaxIdleTime *time.Duration `json:"conn_max_idle_time,omitempty" yaml:"conn_max_idle_time,omitempty"`
ConnMaxLifetime *time.Duration `json:"conn_max_lifetime,omitempty" yaml:"conn_max_lifetime,omitempty"`
// Create Flag to enable create operations. When omitted, then false (disabled) is assumed
Create *bool `json:"create,omitempty" yaml:"create,omitempty"`
Db *sql.DB `json:"-" yaml:"db,omitempty"`
// Delete Flag to enable delete operations. When omitted, then false (disabled) is assumed
Delete *bool `json:"delete,omitempty" yaml:"delete,omitempty"`
// Driver Type of driver to use
Driver *BackendConfigDriver `json:"driver,omitempty" yaml:"driver,omitempty"`
// Dsn Data source specification.
// Can contain credentials
Dsn string `json:"dsn" yaml:"dsn"`
// Entities Entity-level configurations.
Entities *map[string]*EntityConfig `json:"entities,omitempty" yaml:"entities,omitempty"`
// IdMap Optional mapping from entity (table) name to ID column.
// If not specified, then 'id' is assumed
// Deprecated: Use entities map
IdMap *map[string]string `json:"id_map,omitempty" yaml:"id_map,omitempty"`
// InitQueries SQL queries to be executed at start. Be careful here.
InitQueries *[]string `json:"init_queries,omitempty" yaml:"init_queries,omitempty"`
// MaxIdleConnections Sets the maximum number of connections in the idle connection pool.
MaxIdleConnections *int `json:"max_idle_connections,omitempty" yaml:"max_idle_connections,omitempty"`
// MaxOpenConnections Sets the maximum number of open connections to the database.
MaxOpenConnections *int `json:"max_open_connections,omitempty" yaml:"max_open_connections,omitempty"`
// PageSizeLimit Limit for page size. When per-entity limit is not configured, then this value is used.
PageSizeLimit *int `json:"page_size_limit,omitempty" yaml:"page_size_limit,omitempty"`
// Queries Named queries that can be executed by their name
Queries *map[string]string `json:"queries,omitempty" yaml:"queries,omitempty"`
// Read Flag to enable read operations. When omitted, then true (enabled) is assumed
Read *bool `json:"read,omitempty" yaml:"read,omitempty"`
// Update Flag to enable update operations. When omitted, then false (disabled) is assumed
Update *bool `json:"update,omitempty" yaml:"update,omitempty"`
}
BackendConfig defines model for BackendConfig.
func (*BackendConfig) ApplyPageSizeLimit ¶ added in v1.0.8
func (be *BackendConfig) ApplyPageSizeLimit(ent string, current int) int
func (*BackendConfig) Close ¶ added in v1.0.8
func (be *BackendConfig) Close() error
func (*BackendConfig) DB ¶ added in v1.0.8
func (be *BackendConfig) DB() *sql.DB
func (*BackendConfig) IdColumn ¶ added in v1.0.8
func (be *BackendConfig) IdColumn(ent string) string
IdColumn gets ID column for given entity, see IdMap
type BackendConfigDriver ¶ added in v1.0.8
type BackendConfigDriver string
BackendConfigDriver Type of driver to use
const (
Mysql BackendConfigDriver = "mysql"
)
Defines values for BackendConfigDriver.
func (BackendConfigDriver) Valid ¶ added in v1.0.8
func (e BackendConfigDriver) Valid() bool
Valid indicates whether the value is a known member of the BackendConfigDriver enum.
type Backends ¶ added in v1.0.8
type Backends map[string]*BackendConfig
type BulkUpdateJSONRequestBody ¶ added in v1.0.6
type BulkUpdateJSONRequestBody = BulkUpdateRequest
BulkUpdateJSONRequestBody defines body for BulkUpdate for application/json ContentType.
type BulkUpdateMode ¶ added in v1.0.6
type BulkUpdateMode string
BulkUpdateMode Mode of update:
- `INSERT` - Objects are inserted. Conflicts will cause an error.
- `REPLACE` - Objects are removed prior to creating if they exists. All primary keys must be present in request.
- `UPDATE` - Objects are updated. All primary keys must be present in request. Non-existent objects are ignored.
- `DELETE` - Objects are deleted. All primary keys must be present in request.
const ( DELETE BulkUpdateMode = "DELETE" INSERT BulkUpdateMode = "INSERT" REPLACE BulkUpdateMode = "REPLACE" UPDATE BulkUpdateMode = "UPDATE" )
Defines values for BulkUpdateMode.
func (BulkUpdateMode) Valid ¶ added in v1.0.7
func (e BulkUpdateMode) Valid() bool
Valid indicates whether the value is a known member of the BulkUpdateMode enum.
type BulkUpdateRequest ¶ added in v1.0.6
type BulkUpdateRequest struct {
// Mode Mode of update:
//
// * `INSERT` - Objects are inserted. Conflicts will cause an error.
// * `REPLACE` - Objects are removed prior to creating if they exists.
// All primary keys must be present in request.
// * `UPDATE` - Objects are updated. All primary keys must be present in request.
// Non-existent objects are ignored.
// * `DELETE` - Objects are deleted. All primary keys must be present in request.
Mode BulkUpdateMode `json:"mode" yaml:"mode"`
// Objects Actual data objects to process
Objects []UntypedDto `json:"objects" yaml:"objects"`
}
BulkUpdateRequest Request object describing bulk operation
type BulkUpdateResponse ¶ added in v1.0.6
func ParseBulkUpdateResponse ¶ added in v1.0.6
func ParseBulkUpdateResponse(rsp *http.Response) (*BulkUpdateResponse, error)
ParseBulkUpdateResponse parses an HTTP response from a BulkUpdateWithResponse call
func (BulkUpdateResponse) ContentType ¶ added in v1.0.7
func (r BulkUpdateResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (BulkUpdateResponse) GetBody ¶ added in v1.0.7
func (r BulkUpdateResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (BulkUpdateResponse) Status ¶ added in v1.0.6
func (r BulkUpdateResponse) Status() string
Status returns HTTPResponse.Status
func (BulkUpdateResponse) StatusCode ¶ added in v1.0.6
func (r BulkUpdateResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
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) BulkUpdate ¶ added in v1.0.6
func (c *Client) BulkUpdate(ctx context.Context, backend Backend, entity Entity, body BulkUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
BulkUpdate Perform bulk update
Takes a body of the `application/json` content type.
Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
func (*Client) BulkUpdateWithBody ¶ added in v1.0.6
func (c *Client) BulkUpdateWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
BulkUpdateWithBody Perform bulk update
Takes any type of body and a specified content type.
Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
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)
CreateItem Create new entity item
Takes a body of the `application/json` content type.
Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
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)
CreateItemWithBody Create new entity item
Takes any type of body and a specified content type.
Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
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)
DeleteItemById Delete entity item by ID
Corresponds with DELETE /{backend}/{entity}/{id} (the `DeleteItemById` operationId).
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)
ExistsItemById Check for existence of entity item by ID
Corresponds with HEAD /{backend}/{entity}/{id} (the `ExistsItemById` operationId).
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)
GetItemById Get entity item by ID
Corresponds with GET /{backend}/{entity}/{id} (the `GetItemById` operationId).
func (*Client) GetVersionInfo ¶ added in v1.0.7
func (c *Client) GetVersionInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
GetVersionInfo Get version info
Get system version info.
Corresponds with GET /version (the `GetVersionInfo` operationId).
func (*Client) ListBackends ¶ added in v1.0.1
func (c *Client) ListBackends(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
ListBackends List all configured backends
Get list of all configured backends.
Corresponds with GET /backends (the `ListBackends` operationId).
func (*Client) ListEntities ¶ added in v1.0.1
func (c *Client) ListEntities(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*http.Response, error)
ListEntities List all known entities within backend
Get list of known entities within given backend.
Corresponds with GET /{backend}/entities (the `ListEntities` operationId).
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)
ListItems List entity items
List entity items using provided criteria.
Corresponds with GET /{backend}/{entity} (the `ListItems` operationId).
func (*Client) QueryNamed ¶ added in v1.0.7
func (c *Client) QueryNamed(ctx context.Context, backend Backend, name string, params *QueryNamedParams, reqEditors ...RequestEditorFn) (*http.Response, error)
QueryNamed Execute named query and return the result set
Run previously-crafted query on the server and return results. Saved queries should not contain any paging statement as those are provided based on `page-offset` and `page-size` parameter.
Corresponds with GET /{backend}/_query/{name} (the `QueryNamed` operationId).
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)
UpdateItemById Update entity item in-place by ID
Takes a body of the `application/json` content type.
Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
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)
UpdateItemByIdWithBody Update entity item in-place by ID
Takes any type of body and a specified content type.
Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
type ClientInterface ¶ added in v1.0.1
type ClientInterface interface {
// ListBackends List all configured backends
//
// Get list of all configured backends.
//
// Corresponds with GET /backends (the `ListBackends` operationId).
ListBackends(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetVersionInfo Get version info
//
// Get system version info.
//
// Corresponds with GET /version (the `GetVersionInfo` operationId).
GetVersionInfo(ctx context.Context, reqEditors ...RequestEditorFn) (*http.Response, error)
// QueryNamed Execute named query and return the result set
//
// Run previously-crafted query on the server and return results.
// Saved queries should not contain any paging statement as those are provided
// based on `page-offset` and `page-size` parameter.
//
// Corresponds with GET /{backend}/_query/{name} (the `QueryNamed` operationId).
QueryNamed(ctx context.Context, backend Backend, name string, params *QueryNamedParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListEntities List all known entities within backend
//
// Get list of known entities within given backend.
//
// Corresponds with GET /{backend}/entities (the `ListEntities` operationId).
ListEntities(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*http.Response, error)
// ListItems List entity items
//
// List entity items using provided criteria.
//
// Corresponds with GET /{backend}/{entity} (the `ListItems` operationId).
ListItems(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateItemWithBody Create new entity item
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
CreateItemWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// CreateItem Create new entity item
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
CreateItem(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// BulkUpdateWithBody Perform bulk update
//
// Takes any type of body and a specified content type.
//
// Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
BulkUpdateWithBody(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// BulkUpdate Perform bulk update
//
// Takes a body of the `application/json` content type.
//
// Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
BulkUpdate(ctx context.Context, backend Backend, entity Entity, body BulkUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*http.Response, error)
// DeleteItemById Delete entity item by ID
//
// Corresponds with DELETE /{backend}/{entity}/{id} (the `DeleteItemById` operationId).
DeleteItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// GetItemById Get entity item by ID
//
// Corresponds with GET /{backend}/{entity}/{id} (the `GetItemById` operationId).
GetItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// ExistsItemById Check for existence of entity item by ID
//
// Corresponds with HEAD /{backend}/{entity}/{id} (the `ExistsItemById` operationId).
ExistsItemById(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateItemByIdWithBody Update entity item in-place by ID
//
// Takes any type of body and a specified content type.
//
// Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
UpdateItemByIdWithBody(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*http.Response, error)
// UpdateItemById Update entity item in-place by ID
//
// Takes a body of the `application/json` content type.
//
// Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
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
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 ClientProfile ¶ added in v1.0.8
type ClientProfile struct {
// Auth Authentication configuration. TBD
Auth *map[string]interface{} `json:"auth,omitempty" yaml:"auth,omitempty"`
// Url URL to the server API endpoint
Url string `json:"url" yaml:"url"`
}
ClientProfile defines model for ClientProfile.
type ClientProfileSpec ¶ added in v1.0.8
type ClientProfileSpec struct {
// Auth Authentication configuration. TBD
Auth *map[string]interface{} `json:"auth,omitempty" yaml:"auth,omitempty"`
// Url URL to the server API endpoint
Url string `json:"url" yaml:"url"`
}
ClientProfileSpec defines model for ClientProfileSpec.
type ClientProfiles ¶ added in v1.0.8
type ClientProfiles map[string]ClientProfile
ClientProfiles Map of client profiles
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) BulkUpdateWithBodyWithResponse ¶ added in v1.0.6
func (c *ClientWithResponses) BulkUpdateWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BulkUpdateResponse, error)
BulkUpdateWithBodyWithResponse Perform bulk update
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
func (*ClientWithResponses) BulkUpdateWithResponse ¶ added in v1.0.6
func (c *ClientWithResponses) BulkUpdateWithResponse(ctx context.Context, backend Backend, entity Entity, body BulkUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*BulkUpdateResponse, error)
BulkUpdateWithResponse Perform bulk update
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
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 Create new entity item
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
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)
CreateItemWithResponse Create new entity item
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
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 Delete entity item by ID
Returns a wrapper object for the known response body format(s).
Corresponds with DELETE /{backend}/{entity}/{id} (the `DeleteItemById` operationId).
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 Check for existence of entity item by ID
Returns a wrapper object for the known response body format(s).
Corresponds with HEAD /{backend}/{entity}/{id} (the `ExistsItemById` operationId).
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 Get entity item by ID
Returns a wrapper object for the known response body format(s).
Corresponds with GET /{backend}/{entity}/{id} (the `GetItemById` operationId).
func (*ClientWithResponses) GetVersionInfoWithResponse ¶ added in v1.0.7
func (c *ClientWithResponses) GetVersionInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionInfoResponse, error)
GetVersionInfoWithResponse Get version info
Get system version info.
Returns a wrapper object for the known response body format(s).
Corresponds with GET /version (the `GetVersionInfo` operationId).
func (*ClientWithResponses) ListBackendsWithResponse ¶ added in v1.0.1
func (c *ClientWithResponses) ListBackendsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBackendsResponse, error)
ListBackendsWithResponse List all configured backends
Get list of all configured backends.
Returns a wrapper object for the known response body format(s).
Corresponds with GET /backends (the `ListBackends` operationId).
func (*ClientWithResponses) ListEntitiesWithResponse ¶ added in v1.0.1
func (c *ClientWithResponses) ListEntitiesWithResponse(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error)
ListEntitiesWithResponse List all known entities within backend
Get list of known entities within given backend.
Returns a wrapper object for the known response body format(s).
Corresponds with GET /{backend}/entities (the `ListEntities` operationId).
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 List entity items
List entity items using provided criteria.
Returns a wrapper object for the known response body format(s).
Corresponds with GET /{backend}/{entity} (the `ListItems` operationId).
func (*ClientWithResponses) QueryNamedWithResponse ¶ added in v1.0.7
func (c *ClientWithResponses) QueryNamedWithResponse(ctx context.Context, backend Backend, name string, params *QueryNamedParams, reqEditors ...RequestEditorFn) (*QueryNamedResponse, error)
QueryNamedWithResponse Execute named query and return the result set
Run previously-crafted query on the server and return results. Saved queries should not contain any paging statement as those are provided based on `page-offset` and `page-size` parameter.
Returns a wrapper object for the known response body format(s).
Corresponds with GET /{backend}/_query/{name} (the `QueryNamed` operationId).
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 Update entity item in-place by ID
Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
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)
UpdateItemByIdWithResponse Update entity item in-place by ID
Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
type ClientWithResponsesInterface ¶ added in v1.0.1
type ClientWithResponsesInterface interface {
// ListBackendsWithResponse List all configured backends
//
// Get list of all configured backends.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /backends (the `ListBackends` operationId).
ListBackendsWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*ListBackendsResponse, error)
// GetVersionInfoWithResponse Get version info
//
// Get system version info.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /version (the `GetVersionInfo` operationId).
GetVersionInfoWithResponse(ctx context.Context, reqEditors ...RequestEditorFn) (*GetVersionInfoResponse, error)
// QueryNamedWithResponse Execute named query and return the result set
//
// Run previously-crafted query on the server and return results.
// Saved queries should not contain any paging statement as those are provided
// based on `page-offset` and `page-size` parameter.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /{backend}/_query/{name} (the `QueryNamed` operationId).
QueryNamedWithResponse(ctx context.Context, backend Backend, name string, params *QueryNamedParams, reqEditors ...RequestEditorFn) (*QueryNamedResponse, error)
// ListEntitiesWithResponse List all known entities within backend
//
// Get list of known entities within given backend.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /{backend}/entities (the `ListEntities` operationId).
ListEntitiesWithResponse(ctx context.Context, backend Backend, reqEditors ...RequestEditorFn) (*ListEntitiesResponse, error)
// ListItemsWithResponse List entity items
//
// List entity items using provided criteria.
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /{backend}/{entity} (the `ListItems` operationId).
ListItemsWithResponse(ctx context.Context, backend Backend, entity Entity, params *ListItemsParams, reqEditors ...RequestEditorFn) (*ListItemsResponse, error)
// CreateItemWithBodyWithResponse Create new entity item
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
CreateItemWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)
// CreateItemWithResponse Create new entity item
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /{backend}/{entity} (the `CreateItem` operationId).
CreateItemWithResponse(ctx context.Context, backend Backend, entity Entity, body CreateItemJSONRequestBody, reqEditors ...RequestEditorFn) (*CreateItemResponse, error)
// BulkUpdateWithBodyWithResponse Perform bulk update
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
BulkUpdateWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*BulkUpdateResponse, error)
// BulkUpdateWithResponse Perform bulk update
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with POST /{backend}/{entity}/bulk (the `BulkUpdate` operationId).
BulkUpdateWithResponse(ctx context.Context, backend Backend, entity Entity, body BulkUpdateJSONRequestBody, reqEditors ...RequestEditorFn) (*BulkUpdateResponse, error)
// DeleteItemByIdWithResponse Delete entity item by ID
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with DELETE /{backend}/{entity}/{id} (the `DeleteItemById` operationId).
DeleteItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*DeleteItemByIdResponse, error)
// GetItemByIdWithResponse Get entity item by ID
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with GET /{backend}/{entity}/{id} (the `GetItemById` operationId).
GetItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*GetItemByIdResponse, error)
// ExistsItemByIdWithResponse Check for existence of entity item by ID
//
// Returns a wrapper object for the known response body format(s).
//
// Corresponds with HEAD /{backend}/{entity}/{id} (the `ExistsItemById` operationId).
ExistsItemByIdWithResponse(ctx context.Context, backend Backend, entity Entity, id string, reqEditors ...RequestEditorFn) (*ExistsItemByIdResponse, error)
// UpdateItemByIdWithBodyWithResponse Update entity item in-place by ID
//
// Takes any type of body and a specified content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
UpdateItemByIdWithBodyWithResponse(ctx context.Context, backend Backend, entity Entity, id string, contentType string, body io.Reader, reqEditors ...RequestEditorFn) (*UpdateItemByIdResponse, error)
// UpdateItemByIdWithResponse Update entity item in-place by ID
//
// Takes a body of the `application/json` content type, and returns a wrapper object for the known response body format(s).
//
// Corresponds with PUT /{backend}/{entity}/{id} (the `UpdateItemById` operationId).
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 Config ¶ added in v1.0.8
type Config struct {
// ActiveClientProfile Name of active client profile
ActiveClientProfile *string `json:"active_client_profile,omitempty" yaml:"active_client_profile,omitempty"`
Backends map[string]*BackendConfig `json:"backends" yaml:"backends"`
// ClientProfiles Map of client profiles
ClientProfiles *map[string]ClientProfile `json:"client_profiles,omitempty" yaml:"client_profiles,omitempty"`
// PageSizeLimit Global default limit for page size.
// When neither per-entity, not per-backend limit is configured, then this value is applied.
// If not specified, then value of 20 is assumed
PageSizeLimit *int `json:"page_size_limit,omitempty" yaml:"page_size_limit,omitempty"`
// Server Server configuration
Server ccfg.ServerConfig `json:"server" yaml:"server"`
}
Config defines model for Config.
func (*Config) CheckAndNormalize ¶ added in v1.0.8
CheckAndNormalize sets any missing optional values and ensures all values are semantically correct.
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 the response for an HTTP 201 `application/json` response
JSON201 *UntypedDto
// JSON500 the response for an HTTP 500 `application/json` response
JSON500 *ErrorObject
}
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) ContentType ¶ added in v1.0.7
func (r CreateItemResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (CreateItemResponse) GetBody ¶ added in v1.0.7
func (r CreateItemResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (CreateItemResponse) GetJSON201 ¶ added in v1.0.7
func (r CreateItemResponse) GetJSON201() *UntypedDto
GetJSON201 returns the response for an HTTP 201 `application/json` response
func (CreateItemResponse) GetJSON500 ¶ added in v1.0.7
func (r CreateItemResponse) GetJSON500() *ErrorObject
GetJSON500 returns the response for an HTTP 500 `application/json` response
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
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) ContentType ¶ added in v1.0.7
func (r DeleteItemByIdResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (DeleteItemByIdResponse) GetBody ¶ added in v1.0.7
func (r DeleteItemByIdResponse) GetBody() []byte
GetBody returns the raw response body bytes
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 EntityConfig ¶ added in v1.0.8
type EntityConfig struct {
// IdColumn Name of ID column. If not specified, then 'id' is assumed
IdColumn *string `json:"id_column,omitempty" yaml:"id_column,omitempty"`
// PageSizeLimit Limit for page size
PageSizeLimit *int `json:"page_size_limit,omitempty" yaml:"page_size_limit,omitempty"`
}
EntityConfig defines model for EntityConfig.
type EntityConfigSpec ¶ added in v1.0.8
type EntityConfigSpec struct {
// IdColumn Name of ID column. If not specified, then 'id' is assumed
IdColumn *string `json:"id_column,omitempty" yaml:"id_column,omitempty"`
// PageSizeLimit Limit for page size
PageSizeLimit *int `json:"page_size_limit,omitempty" yaml:"page_size_limit,omitempty"`
}
EntityConfigSpec defines model for EntityConfigSpec.
type ErrorObject ¶ added in v1.0.7
type ErrorObject struct {
// Code Code related to error state
Code *int `json:"code,omitempty" yaml:"code,omitempty"`
// Data Ad-hoc data associated with error
Data *map[string]interface{} `json:"data,omitempty" yaml:"data,omitempty"`
// Message Human readable message about error state
Message string `json:"message" yaml:"message"`
}
ErrorObject Generic object to convey error details
type ExistsItemByIdResponse ¶ added in v1.0.1
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) ContentType ¶ added in v1.0.7
func (r ExistsItemByIdResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ExistsItemByIdResponse) GetBody ¶ added in v1.0.7
func (r ExistsItemByIdResponse) GetBody() []byte
GetBody returns the raw response body bytes
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 the response for an HTTP 200 `application/json` response
JSON200 *UntypedDto
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ErrorObject
}
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) ContentType ¶ added in v1.0.7
func (r GetItemByIdResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetItemByIdResponse) GetBody ¶ added in v1.0.7
func (r GetItemByIdResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetItemByIdResponse) GetJSON200 ¶ added in v1.0.7
func (r GetItemByIdResponse) GetJSON200() *UntypedDto
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetItemByIdResponse) GetJSON404 ¶ added in v1.0.7
func (r GetItemByIdResponse) GetJSON404() *ErrorObject
GetJSON404 returns the response for an HTTP 404 `application/json` response
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 GetVersionInfoResponse ¶ added in v1.0.7
type GetVersionInfoResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *externalRef0.SystemVersionInfo
}
func ParseGetVersionInfoResponse ¶ added in v1.0.7
func ParseGetVersionInfoResponse(rsp *http.Response) (*GetVersionInfoResponse, error)
ParseGetVersionInfoResponse parses an HTTP response from a GetVersionInfoWithResponse call
func (GetVersionInfoResponse) ContentType ¶ added in v1.0.7
func (r GetVersionInfoResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (GetVersionInfoResponse) GetBody ¶ added in v1.0.7
func (r GetVersionInfoResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (GetVersionInfoResponse) GetJSON200 ¶ added in v1.0.7
func (r GetVersionInfoResponse) GetJSON200() *externalRef0.SystemVersionInfo
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (GetVersionInfoResponse) Status ¶ added in v1.0.7
func (r GetVersionInfoResponse) Status() string
Status returns HTTPResponse.Status
func (GetVersionInfoResponse) StatusCode ¶ added in v1.0.7
func (r GetVersionInfoResponse) 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
Doer performs HTTP requests.
The standard http.Client implements this interface.
type InvalidParamFormatError ¶
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 the response for an HTTP 200 `application/json` 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) ContentType ¶ added in v1.0.7
func (r ListBackendsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ListBackendsResponse) GetBody ¶ added in v1.0.7
func (r ListBackendsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ListBackendsResponse) GetJSON200 ¶ added in v1.0.7
func (r ListBackendsResponse) GetJSON200() *NameList
GetJSON200 returns the response for an HTTP 200 `application/json` response
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 the response for an HTTP 200 `application/json` 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) ContentType ¶ added in v1.0.7
func (r ListEntitiesResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ListEntitiesResponse) GetBody ¶ added in v1.0.7
func (r ListEntitiesResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ListEntitiesResponse) GetJSON200 ¶ added in v1.0.7
func (r ListEntitiesResponse) GetJSON200() *NameList
GetJSON200 returns the response for an HTTP 200 `application/json` response
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 *PageOffset `form:"page-offset,omitempty" json:"page-offset,omitempty" yaml:"page-offset,omitempty"`
// PageSize Page size. Actual value used on server is capped based on policy.
PageSize *PageSize `form:"page-size,omitempty" json:"page-size,omitempty" yaml:"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" yaml:"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" yaml:"filter,omitempty"`
}
ListItemsParams defines parameters for ListItems.
type ListItemsResponse ¶ added in v1.0.1
type ListItemsResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` 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) ContentType ¶ added in v1.0.7
func (r ListItemsResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (ListItemsResponse) GetBody ¶ added in v1.0.7
func (r ListItemsResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (ListItemsResponse) GetJSON200 ¶ added in v1.0.7
func (r ListItemsResponse) GetJSON200() *PagedResult
GetJSON200 returns the response for an HTTP 200 `application/json` response
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 PagedResult ¶ added in v1.0.1
type PagedResult struct {
Data *[]UntypedDto `json:"data,omitempty" yaml:"data,omitempty"`
// Offset Offset of current page from the beginning
Offset *float32 `json:"offset,omitempty" yaml:"offset,omitempty"`
// TotalCount Total number of items matching current filter
TotalCount *int `json:"total_count,omitempty" yaml:"total_count,omitempty"`
}
PagedResult Paged list of items
type QueryNamedParams ¶ added in v1.0.7
type QueryNamedParams struct {
// PageOffset Page offset
PageOffset *PageOffset `form:"page-offset,omitempty" json:"page-offset,omitempty" yaml:"page-offset,omitempty"`
// PageSize Page size. Actual value used on server is capped based on policy.
PageSize *PageSize `form:"page-size,omitempty" json:"page-size,omitempty" yaml:"page-size,omitempty"`
// Arg Additional arguments passed to query
Arg *[]string `form:"arg,omitempty" json:"arg,omitempty" yaml:"arg,omitempty"`
}
QueryNamedParams defines parameters for QueryNamed.
type QueryNamedResponse ¶ added in v1.0.7
type QueryNamedResponse struct {
Body []byte
HTTPResponse *http.Response
// JSON200 the response for an HTTP 200 `application/json` response
JSON200 *PagedResult
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ErrorObject
}
func ParseQueryNamedResponse ¶ added in v1.0.7
func ParseQueryNamedResponse(rsp *http.Response) (*QueryNamedResponse, error)
ParseQueryNamedResponse parses an HTTP response from a QueryNamedWithResponse call
func (QueryNamedResponse) ContentType ¶ added in v1.0.7
func (r QueryNamedResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (QueryNamedResponse) GetBody ¶ added in v1.0.7
func (r QueryNamedResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (QueryNamedResponse) GetJSON200 ¶ added in v1.0.7
func (r QueryNamedResponse) GetJSON200() *PagedResult
GetJSON200 returns the response for an HTTP 200 `application/json` response
func (QueryNamedResponse) GetJSON404 ¶ added in v1.0.7
func (r QueryNamedResponse) GetJSON404() *ErrorObject
GetJSON404 returns the response for an HTTP 404 `application/json` response
func (QueryNamedResponse) Status ¶ added in v1.0.7
func (r QueryNamedResponse) Status() string
Status returns HTTPResponse.Status
func (QueryNamedResponse) StatusCode ¶ added in v1.0.7
func (r QueryNamedResponse) StatusCode() int
StatusCode returns HTTPResponse.StatusCode
type RequestEditorFn ¶ added in v1.0.1
RequestEditorFn is the function signature for the RequestEditor callback function
type RequiredHeaderError ¶
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 {
// ListBackends List all configured backends
// (GET /backends)
ListBackends(w http.ResponseWriter, r *http.Request)
// GetVersionInfo Get version info
// (GET /version)
GetVersionInfo(w http.ResponseWriter, r *http.Request)
// QueryNamed Execute named query and return the result set
// (GET /{backend}/_query/{name})
QueryNamed(w http.ResponseWriter, r *http.Request, backend Backend, name string, params QueryNamedParams)
// ListEntities List all known entities within backend
// (GET /{backend}/entities)
ListEntities(w http.ResponseWriter, r *http.Request, backend Backend)
// ListItems List entity items
// (GET /{backend}/{entity})
ListItems(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, params ListItemsParams)
// CreateItem Create new entity item
// (POST /{backend}/{entity})
CreateItem(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity)
// BulkUpdate Perform bulk update
// (POST /{backend}/{entity}/bulk)
BulkUpdate(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity)
// DeleteItemById Delete entity item by ID
// (DELETE /{backend}/{entity}/{id})
DeleteItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id string)
// GetItemById Get entity item by ID
// (GET /{backend}/{entity}/{id})
GetItemById(w http.ResponseWriter, r *http.Request, backend Backend, entity Entity, id string)
// ExistsItemById 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)
// UpdateItemById 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) BulkUpdate ¶ added in v1.0.6
func (siw *ServerInterfaceWrapper) BulkUpdate(w http.ResponseWriter, r *http.Request)
BulkUpdate operation middleware
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) GetVersionInfo ¶ added in v1.0.7
func (siw *ServerInterfaceWrapper) GetVersionInfo(w http.ResponseWriter, r *http.Request)
GetVersionInfo 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) QueryNamed ¶ added in v1.0.7
func (siw *ServerInterfaceWrapper) QueryNamed(w http.ResponseWriter, r *http.Request)
QueryNamed operation middleware
func (*ServerInterfaceWrapper) UpdateItemById ¶
func (siw *ServerInterfaceWrapper) UpdateItemById(w http.ResponseWriter, r *http.Request)
UpdateItemById operation middleware
type TooManyValuesForParamError ¶
func (*TooManyValuesForParamError) Error ¶
func (e *TooManyValuesForParamError) Error() string
type UnescapedCookieParamError ¶
func (*UnescapedCookieParamError) Error ¶
func (e *UnescapedCookieParamError) Error() string
func (*UnescapedCookieParamError) Unwrap ¶
func (e *UnescapedCookieParamError) Unwrap() error
type UnmarshalingParamError ¶
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
// JSON202 the response for an HTTP 202 `application/json` response
JSON202 *UntypedDto
// JSON404 the response for an HTTP 404 `application/json` response
JSON404 *ErrorObject
}
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) ContentType ¶ added in v1.0.7
func (r UpdateItemByIdResponse) ContentType() string
ContentType is a convenience method to retrieve the Content-Type value from the HTTP response headers
func (UpdateItemByIdResponse) GetBody ¶ added in v1.0.7
func (r UpdateItemByIdResponse) GetBody() []byte
GetBody returns the raw response body bytes
func (UpdateItemByIdResponse) GetJSON202 ¶ added in v1.0.7
func (r UpdateItemByIdResponse) GetJSON202() *UntypedDto
GetJSON202 returns the response for an HTTP 202 `application/json` response
func (UpdateItemByIdResponse) GetJSON404 ¶ added in v1.0.7
func (r UpdateItemByIdResponse) GetJSON404() *ErrorObject
GetJSON404 returns the response for an HTTP 404 `application/json` response
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