storage

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 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 Database added in v0.1.7

type Database interface {
	Create(ctx context.Context, collection string, document interface{}) (interface{}, error)
	ReadOne(ctx context.Context, collection string, id interface{}) (interface{}, error)
	ReadAll(ctx context.Context, collection string) ([]interface{}, error)
	Update(ctx context.Context, collection string, id interface{}, document interface{}) (interface{}, error)
	Delete(ctx context.Context, collection string, id interface{}) (interface{}, error)
}

type MapDB added in v0.1.6

type MapDB interface {
	Create(ctx context.Context, collection string, document interface{}) (interface{}, error)
	ReadOne(ctx context.Context, collection string, id interface{}) (interface{}, error)
	ReadAll(ctx context.Context, collection string) ([]interface{}, error)
	Update(ctx context.Context, collection string, id interface{}, document interface{}) (interface{}, error)
	Delete(ctx context.Context, collection string, id interface{}) (interface{}, error)
}

func NewMapDB added in v0.1.6

func NewMapDB() (MapDB, error)

type MongoDB

type MongoDB interface {
	Create(ctx context.Context, collection string, document interface{}) (interface{}, error)
	ReadOne(ctx context.Context, collection string, id interface{}) (interface{}, error)
	ReadAll(ctx context.Context, collection string) ([]interface{}, error)
	Update(ctx context.Context, collection string, id interface{}, document interface{}) (interface{}, error)
	Delete(ctx context.Context, collection string, id interface{}) (interface{}, error)
}

func NewMongoDB

func NewMongoDB(ctx context.Context, opt *options.ClientOptions, databaseName string) (MongoDB, error)

Jump to

Keyboard shortcuts

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