datastore

package
v0.3.626 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2018 License: Apache-2.0 Imports: 13 Imported by: 8

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(ctx context.Context, dbURL string) (models.Datastore, error)

New creates a DataStore from the specified URL

func NewMock

func NewMock() models.Datastore

func NewMockInit

func NewMockInit(args ...interface{}) models.Datastore

args helps break tests less if we change stuff

func Register

func Register(provider Provider)

Register globally registers a data store provider

func Wrap

Types

type Provider

type Provider interface {
	fmt.Stringer
	// Supports indicates if this provider can handle a given data store.
	Supports(url *url.URL) bool
	// New creates a new data store from the specified URL
	New(ctx context.Context, url *url.URL) (models.Datastore, error)
}

Provider is a datastore provider

Directories

Path Synopsis
internal
sql
dbhelper
Package dbhelper wraps SQL and specific capabilities of an SQL db
Package dbhelper wraps SQL and specific capabilities of an SQL db

Jump to

Keyboard shortcuts

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