Documentation ¶
Index ¶
- func Aggregate[T any](ctx context.Context, collection string, pipeline []interface{}) ([]T, error)
- func Collection(name string) *mongo.Collection
- func Connect(ctx context.Context, mongoURI, dbName string) error
- func DeleteMany(ctx context.Context, collection string, filter interface{}) (int64, error)
- func DeleteOne(ctx context.Context, collection string, filter interface{}) (int64, error)
- func Disconnect() error
- func FindById[T any](ctx context.Context, collection string, id string) (T, error)
- func FindMany[T any](ctx context.Context, collection string, filter interface{}) ([]T, error)
- func FindOne[T any](ctx context.Context, collection string, filter interface{}) (T, error)
- func InsertMany(ctx context.Context, collection string, documents []interface{}) ([]string, error)
- func InsertOne(ctx context.Context, collection string, document interface{}) (string, error)
- func UpdateMany(ctx context.Context, collection string, filter interface{}, update interface{}) (int64, error)
- func UpdateOne(ctx context.Context, collection string, filter interface{}, update interface{}) (string, error)
- type CatalogStoreMongo
- func (c *CatalogStoreMongo) CreateCatalog(catalog *domain.Catalog) (interface{}, error)
- func (store *CatalogStoreMongo) CreateControl(catalogId string, control *domain.Control) (interface{}, error)
- func (store *CatalogStoreMongo) DeleteCatalog(id string) error
- func (store *CatalogStoreMongo) GetCatalog(id string) (*domain.Catalog, error)
- func (store *CatalogStoreMongo) GetControl(catalogId string, controlId string) (*domain.Control, error)
- func (store *CatalogStoreMongo) UpdateCatalog(id string, catalog *domain.Catalog) error
- func (store *CatalogStoreMongo) UpdateControl(catalogId string, controlId string, control *domain.Control) (*domain.Catalog, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func Collection ¶
func Collection(name string) *mongo.Collection
func DeleteMany ¶
func Disconnect ¶
func Disconnect() error
func InsertMany ¶
func UpdateMany ¶
Types ¶
type CatalogStoreMongo ¶
type CatalogStoreMongo struct {
// contains filtered or unexported fields
}
func NewCatalogStore ¶
func NewCatalogStore() *CatalogStoreMongo
func (*CatalogStoreMongo) CreateCatalog ¶
func (c *CatalogStoreMongo) CreateCatalog(catalog *domain.Catalog) (interface{}, error)
func (*CatalogStoreMongo) CreateControl ¶
func (store *CatalogStoreMongo) CreateControl(catalogId string, control *domain.Control) (interface{}, error)
func (*CatalogStoreMongo) DeleteCatalog ¶
func (store *CatalogStoreMongo) DeleteCatalog(id string) error
func (*CatalogStoreMongo) GetCatalog ¶
func (store *CatalogStoreMongo) GetCatalog(id string) (*domain.Catalog, error)
func (*CatalogStoreMongo) GetControl ¶
func (*CatalogStoreMongo) UpdateCatalog ¶
func (store *CatalogStoreMongo) UpdateCatalog(id string, catalog *domain.Catalog) error
func (*CatalogStoreMongo) UpdateControl ¶
Click to show internal directories.
Click to hide internal directories.