models

package
v0.0.0-...-8832f83 Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2019 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Action

type Action struct {
	OriginalIndex int
	Err           error
	Action        *models.Action
	UUID          strfmt.UUID
}

Action is a helper type that groups all the info about one action in a batch that belongs together, i.e. uuid, action body and error state.

Consumers of a Action (i.e. database connector) should always check whether an error is already present by the time they receive a batch action. Errors can be introduced at all levels, e.g. validation.

However, error'd actions are not removed to make sure that the list in Actions matches the order and content of the incoming batch request

type Actions

type Actions []Action

Actions groups many Action items together. The order matches the order from the original request. It can be turned into the expected response type using the .Response() method

func (Actions) Response

func (b Actions) Response() []*models.ActionsGetResponse

Response uses the information contained in every Action (uuid, action body and error state) to form the expected response for the Batching request.

type Thing

type Thing struct {
	OriginalIndex int
	Err           error
	Thing         *models.Thing
	UUID          strfmt.UUID
}

Thing is a helper type that groups all the info about one thing in a batch that belongs together, i.e. uuid, thing body and error state.

Consumers of a Thing (i.e. database connector) should always check whether an error is already present by the time they receive a batch thing. Errors can be introduced at all levels, e.g. validation.

However, error'd things are not removed to make sure that the list in Things matches the order and content of the incoming batch request

type Things

type Things []Thing

Things groups many Thing items together. The order matches the order from the original request. It can be turned into the expected response type using the .Response() method

func (Things) Response

func (b Things) Response() []*models.ThingsGetResponse

Response uses the information contained in every Thing (uuid, thing body and error state) to form the expected response for the Batching request.

Jump to

Keyboard shortcuts

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