datastore

package
v1.1.10 Latest Latest
Warning

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

Go to latest
Published: Nov 20, 2021 License: Apache-2.0 Imports: 1 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Type     string
	URL      string
	Database string
}

Config datastore config

type DataStore

type DataStore interface {
	Add(ctx context.Context, kind string, entity interface{}) error

	Put(ctx context.Context, kind, name string, entity interface{}) error

	Delete(ctx context.Context, kind, name string) error

	Get(ctx context.Context, kind, name string, decodeTo interface{}) error

	// Find executes a find command and returns an iterator over the matching items.
	Find(ctx context.Context, kind string) (Iterator, error)

	FindOne(ctx context.Context, kind, name string) (Iterator, error)

	IsExist(ctx context.Context, kind, name string) (bool, error)
}

DataStore datastore interface

type Iterator

type Iterator interface {
	// Next gets the next item for this cursor.
	Next(ctx context.Context) bool

	// Decode will unmarshal the current item into given entity.
	Decode(entity interface{}) error

	Close(ctx context.Context) error
}

Iterator dataset query

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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