endpoint

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Jun 20, 2019 License: GPL-3.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrPostForm               = errors.New("Form data sent was empty and/or not of type `application/x-www-form-urlencoded`")
	ErrCardinalityMany        = errors.New("Form data contained multiple input values for a single column")
	ErrUnexpectedJSON         = errors.New("Received JSON data that we are unable to parse")
	ErrMismatchedAffectedRows = errors.New("The amount of rows affected should be sane")
)

Functions

This section is empty.

Types

type Backend

type Backend interface {
	GetSchemaMapping(string) *descriptor.SchemaMapping
	GetFilterPredicateMapping(filter.Predicate) string
	SaveSchemaMapping() error
	GetQueryTemplate(string) string
	QueryContext(context.Context, string, ...interface{}) ([]interface{}, error)
	ExecContext(context.Context, string, ...interface{}) (sql.Result, error)
	CommitTx(string) error
	CreateTx(time.Duration) (uuid.UUID, error)
}

type CRUD

type CRUD interface {
	CreateSingle(rw http.ResponseWriter, req *http.Request)
	GetSingle(rw http.ResponseWriter, req *http.Request)
	GetCollection(rw http.ResponseWriter, req *http.Request)
	UpdateSingle(rw http.ResponseWriter, req *http.Request)
	DeleteSingle(rw http.ResponseWriter, req *http.Request)
}

CRUD abstracts the functionality expected from a standard CRUD service, this includes methods for creating, reading, updating and deleting resources.

type CollectionFilterer

type CollectionFilterer interface {
	GetCollectionFilterable(rw http.ResponseWriter, req *http.Request)
}

CollectionFilterer allows a user to select an operator and a field to filter the result set upon

type DataConnectorOptions

type DataConnectorOptions interface {
	GetSingleAsOption(rw http.ResponseWriter, req *http.Request)
	GetCollectionAsOptions(rw http.ResponseWriter, req *http.Request)
	GetCollectionAsOptionsFilterable(rw http.ResponseWriter, req *http.Request)
}

DataConnectorOptions satisfies the interface for a custom connector as specified by Signavio's Workflow Accelerator documentation

type Endpoint

type Endpoint interface {
	CRUD
	DataConnectorOptions
	CollectionFilterer
	// GetHandler returns a http.Handler which include all the routes that implement
	// the functionality required by the CRUD and WorkflowConnector interfaces
	GetHandler() http.Handler
	Open(...interface{}) error
}

Jump to

Keyboard shortcuts

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