model

package
v0.0.0-...-3c0c640 Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Model

type Model interface {
	// Save any object. Maintains indexes set up.
	Save(query interface{}) error
	// List objects by a query. Each query requires an appropriate index
	// to exist. List throws an error if a matching index can't be found.
	List(query interface{}, resultSlicePointer interface{}) error
	// Same as list, but accepts pointer to non slices and
	// expects to find only one element. Throws error if not found
	// or if more than two elements are found.
	Read(query string, resultPointer interface{}) error
	// Deletes a record. Delete only support Equals("id", value) for now.
	// @todo Delete only supports string keys for now.
	Delete(query string) error
}

Model represents a place where data can be saved to and queried from.

func New

func New(namespace string) Model

New db

Jump to

Keyboard shortcuts

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