store

package
v0.0.0-...-76701a9 Latest Latest
Warning

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

Go to latest
Published: Jun 29, 2017 License: MIT, MIT Imports: 2 Imported by: 0

Documentation

Overview

Package store is a collection of composable interfaces that are can be implemented in order to build a storage driver

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CRUD

type CRUD interface {
	Save(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType)
	Get(ctx context.Context, id string) (*jsh.Object, jsh.ErrorType)
	List(ctx context.Context) (jsh.List, jsh.ErrorType)
	Update(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType)
	Delete(ctx context.Context, id string) jsh.ErrorType
}

CRUD implements all sub-storage functions

type Delete

type Delete func(ctx context.Context, id string) jsh.ErrorType

Delete an object from storage by id

type Get

type Get func(ctx context.Context, id string) (*jsh.Object, jsh.ErrorType)

Get a specific instance of a resource by id from storage

type List

type List func(ctx context.Context) (jsh.List, jsh.ErrorType)

List all instances of a resource from storage

type Save

type Save func(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType)

Save a new resource to storage

type ToMany

type ToMany func(ctx context.Context, id string) (jsh.List, jsh.ErrorType)

ToMany retrieves a list of objects of a single resource type that are related to the provided resource id

type Update

type Update func(ctx context.Context, object *jsh.Object) (*jsh.Object, jsh.ErrorType)

Update an existing object in storage

Jump to

Keyboard shortcuts

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