repository

package
v0.0.1 Latest Latest
Warning

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

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

Documentation

Overview

Package repository provides a collection like object for persistence.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Repository

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

Repository is an instance of a postgres Database

func New

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

New creates a new postgres database

func (*Repository) Add

func (r *Repository) Add(ctx context.Context, collection string, items ...datastore.Snapper) error

Add adds items(s) to the repository

func (*Repository) Filter

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

Filter gets a new filter for searching the repository.

func (*Repository) Query

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

Query gets a new query for searching the repository.

func (*Repository) Remove

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

Remove removes items from the repository matching criteria.

func (*Repository) Search

func (r *Repository) Search(ctx context.Context, query datastore.Query) (datastore.Cursor, error)

Search retrieves items from the repository matching criteria.

func (*Repository) Update

func (r *Repository) Update(ctx context.Context, collection string, filter datastore.Filter, item datastore.Snapper) (int, error)

Update updates an item matching a filter

Jump to

Keyboard shortcuts

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