datastore

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: GPL-3.0 Imports: 4 Imported by: 0

Documentation

Overview

Package datastore provides a repository implementation.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository added in v0.0.2

type Repository struct {
	// contains filtered or unexported fields
}

Repository is an instance of a postgres Database

func New added in v0.0.2

func New(client client.Client) (*Repository, error)

New creates a new postgres database

func (*Repository) Add added in v0.0.2

func (r *Repository) Add(ctx context.Context, collection string, data interface{}) error

Add adds items(s) to the repository

func (*Repository) Filter added in v0.0.2

func (r *Repository) Filter() client.Filter

Filter gets a new filter for searching the repository.

func (*Repository) Query added in v0.0.2

func (r *Repository) Query() client.Query

Query gets a new query for searching the repository.

func (*Repository) Remove added in v0.0.2

func (r *Repository) Remove(ctx context.Context, collection string, filter client.Filter, first int) (int, error)

Remove removes items from the repository matching criteria.

func (*Repository) Search added in v0.0.2

func (r *Repository) Search(ctx context.Context, query client.Query, dst interface{}) error

Search retrieves items from the repository matching criteria.

func (*Repository) Tag added in v0.0.6

func (r *Repository) Tag(tag string) *Repository

Tag sets the tag for adding to repository

func (*Repository) Update added in v0.0.2

func (r *Repository) Update(ctx context.Context, collection string, filter client.Filter, data interface{}) (int, error)

Update updates an item matching a filter

Directories

Path Synopsis
Package client provides resources for data persistence and retrieval.
Package client provides resources for data persistence and retrieval.
Package internal provides our internal API resources.
Package internal provides our internal API resources.
mock
Package mock provides a basic mock for testing the datastore.
Package mock provides a basic mock for testing the datastore.
Package postgres provides a store implementation using Postgres.
Package postgres provides a store implementation using Postgres.
integration
Package integration provides resources for doing integration testing.
Package integration provides resources for doing integration testing.

Jump to

Keyboard shortcuts

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