api

package
v0.0.0-...-b07ea14 Latest Latest
Warning

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

Go to latest
Published: Oct 20, 2019 License: MIT Imports: 0 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUDAPI

type CRUDAPI interface {
	Create(entity Entity) error
	Get(id [16]byte) (Entity, error)
	List(params map[string]string) ([]Entity, error)
	Update(v Entity) error
	Delete(id [16]byte) error
}

CRUDAPI is a generic interface for common CRUD operations either extend this or use your own for more complex requirements

type CreateFunc

type CreateFunc func(entity Entity) error

type DeleteFunc

type DeleteFunc func(id [16]byte) error

type Entity

type Entity interface {
	ID() [16]byte
	SetID([16]byte)
}

Entity represents a basic domain model with UUID

type GetFunc

type GetFunc func(id [16]byte) (Entity, error)

type ListFunc

type ListFunc func(params map[string]string) ([]Entity, error)

type UpdateFunc

type UpdateFunc func(v Entity) error

Jump to

Keyboard shortcuts

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