Documentation ¶
Index ¶
- type IMongoStore
- type MongoDbConfig
- type MongoStore
- func (s MongoStore[T]) Create(ctx context.Context, obj T) error
- func (s MongoStore[T]) Delete(ctx context.Context, filter interface{}) error
- func (s MongoStore[T]) FindBy(ctx context.Context, filter interface{}) (*[]T, error)
- func (s MongoStore[T]) FindOneBy(ctx context.Context, filter interface{}) (*T, error)
- func (s MongoStore[T]) Get(ctx context.Context) (*[]T, error)
- type StoreFilter
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type IMongoStore ¶
type IMongoStore[T any] interface { FindOneBy(ctx context.Context, filter interface{}) (*T, error) FindBy(ctx context.Context, filter interface{}) (*[]T, error) Get(ctx context.Context) (*[]T, error) Delete(ctx context.Context, filter interface{}) error Create(ctx context.Context, obj T) error }
func New ¶
func New[T any](config MongoDbConfig, collection string) (IMongoStore[T], error)
type MongoDbConfig ¶
type MongoStore ¶
type MongoStore[T any] struct { // contains filtered or unexported fields }
func (MongoStore[T]) Delete ¶
func (s MongoStore[T]) Delete(ctx context.Context, filter interface{}) error
func (MongoStore[T]) FindBy ¶
func (s MongoStore[T]) FindBy(ctx context.Context, filter interface{}) (*[]T, error)
type StoreFilter ¶
Click to show internal directories.
Click to hide internal directories.