Skip to content

Commit

Permalink
index_view: add DropOneWithKey function (#161)
Browse files Browse the repository at this point in the history
  • Loading branch information
SVilgelm authored Sep 24, 2024
1 parent 580c703 commit f74dc72
Show file tree
Hide file tree
Showing 3 changed files with 107 additions and 0 deletions.
13 changes: 13 additions & 0 deletions index_view.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ type IndexView interface {
CreateOne(ctx context.Context, model mongo.IndexModel, opts ...*options.CreateIndexesOptions) (string, error)
DropAll(ctx context.Context, opts ...*options.DropIndexesOptions) (bson.Raw, error)
DropOne(ctx context.Context, name string, opts ...*options.DropIndexesOptions) (bson.Raw, error)
DropOneWithKey(
ctx context.Context,
keySpecDocument interface{},
opts ...*options.DropIndexesOptions,
) (bson.Raw, error)
List(ctx context.Context, opts ...*options.ListIndexesOptions) (Cursor, error)
ListSpecifications(ctx context.Context, opts ...*options.ListIndexesOptions) ([]*mongo.IndexSpecification, error)
}
Expand Down Expand Up @@ -47,6 +52,14 @@ func (i *indexView) DropOne(ctx context.Context, name string, opts ...*options.D
return i.iv.DropOne(ctx, name, opts...)
}

func (i *indexView) DropOneWithKey(
ctx context.Context,
keySpecDocument interface{},
opts ...*options.DropIndexesOptions,
) (bson.Raw, error) {
return i.iv.DropOneWithKey(ctx, keySpecDocument, opts...)
}

func (i *indexView) List(ctx context.Context, opts ...*options.ListIndexesOptions) (Cursor, error) {
cr, err := i.iv.List(ctx, opts...)
if err != nil {
Expand Down
20 changes: 20 additions & 0 deletions mocks/gomock/mocks.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

74 changes: 74 additions & 0 deletions mocks/mockery/index_view.go

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit f74dc72

Please sign in to comment.