mongo

package
v0.0.0-...-d2f6642 Latest Latest
Warning

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

Go to latest
Published: Apr 20, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromOrderBson

func FromOrderBson(o *orderBson) *domain.Order

Types

type OrderRepository

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

func NewOrderRepository

func NewOrderRepository(mongoStore *Store) *OrderRepository

func (*OrderRepository) Create

func (r *OrderRepository) Create(ctx context.Context, o *domain.Order) error

func (*OrderRepository) Get

func (r *OrderRepository) Get(ctx context.Context, id string) (*domain.Order, error)

func (*OrderRepository) GetAll

func (r *OrderRepository) GetAll(ctx context.Context) ([]*domain.Order, error)

func (*OrderRepository) Update

func (r *OrderRepository) Update(ctx context.Context, o *domain.Order) error

type Store

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

func NewStore

func NewStore(uri, dbName string, timeout time.Duration) (*Store, error)

func (*Store) FindAll

func (store *Store) FindAll(ctx context.Context, collection string, query, result interface{}) error

func (*Store) FindOne

func (store *Store) FindOne(
	ctx context.Context,
	collection string,
	query interface{},
	projection interface{},
	result interface{}) error

func (*Store) Store

func (store *Store) Store(ctx context.Context, collection string, data interface{}) error

func (*Store) Update

func (store *Store) Update(ctx context.Context, collection string, query, update interface{}) error

Jump to

Keyboard shortcuts

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