store

package
v0.0.0-...-35581b5 Latest Latest
Warning

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

Go to latest
Published: Jul 9, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type SJFStore

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

store is a struct that will implement the Store interface

func (*SJFStore) CountDocuments

func (store *SJFStore) CountDocuments(ctx context.Context, filter bson.M) (int64, error)

CountDocuments returns the number of documents in the SJF collection

func (*SJFStore) Create

func (store *SJFStore) Create(ctx context.Context, sjf *model.SJF) (*model.SJF, error)

Create creates a new SJF process in the database

func (*SJFStore) Delete

func (store *SJFStore) Delete(ctx context.Context, filters *bson.M) error

Delete deletes a SJF process with the given filters

func (*SJFStore) Get

func (store *SJFStore) Get(ctx context.Context, filters *primitive.M) (*model.SJF, error)

Get returns the SJF process with the given filters

func (*SJFStore) List

func (store *SJFStore) List(ctx context.Context, filters *bson.M, findOptions *options.FindOptions) ([]*model.SJF, error)

List returns all the SJF processes in the database

func (*SJFStore) Update

func (store *SJFStore) Update(ctx context.Context, filters *bson.M, updates *bson.M) error

Update updates the SJF process with the given filters

type Store

type Store interface {
	Create(ctx context.Context, sjf *model.SJF) (*model.SJF, error)
	List(ctx context.Context, filters *bson.M, findOptions *options.FindOptions) ([]*model.SJF, error)
	Get(ctx context.Context, filters *bson.M) (*model.SJF, error)
	Update(ctx context.Context, filters *bson.M, updates *bson.M) error
	Delete(ctx context.Context, filters *bson.M) error
	CountDocuments(ctx context.Context, filter bson.M) (int64, error)
}

Store is an interface that defines the methods that should be implemented by the store struct

func New

func New() Store

New creates a new store instance

Jump to

Keyboard shortcuts

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