store

package
v0.0.0-...-b5f797f Latest Latest
Warning

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

Go to latest
Published: Feb 13, 2024 License: GPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Stores

func Stores(userId string, stores ...Store) func()

Types

type CollectionName

type CollectionName string

type HasObjectId

type HasObjectId interface {
	ObjectId() primitive.ObjectID
	SetObjectId(id primitive.ObjectID)
}

type Store

type Store interface {
	Disconnect(ctx context.Context) error
	Create(ctx context.Context, userId string, d interface{}) (interface{}, error)
	Save(ctx context.Context, userId string, d HasObjectId) (interface{}, error)
	FindOne(ctx context.Context, userId string, filter interface{}, rec interface{}) error
	Find(ctx context.Context, userId string, filter interface{}, sort interface{}, rec interface{}) error
	DeleteAll(ctx context.Context, userId string) (int64, error)
	DropCollection(ctx context.Context) error
	Delete(ctx context.Context, userId string, filter interface{}, rec interface{}) error
	Distinct(ctx context.Context, userId string, field string) ([]interface{}, error)
}

func New

func New(uri, db string, collection CollectionName) (Store, error)

func NewLogged

func NewLogged(store Store) Store

Jump to

Keyboard shortcuts

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