-
Notifications
You must be signed in to change notification settings - Fork 52
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Phani Raj
committed
Aug 13, 2021
1 parent
5875424
commit 33ee312
Showing
5 changed files
with
47 additions
and
10 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
package mock | ||
|
||
import ( | ||
"context" | ||
|
||
ps "github.com/planetscale/planetscale-go/planetscale" | ||
) | ||
|
||
type PasswordsService struct { | ||
CreateFn func(context.Context, *ps.DatabaseBranchPasswordRequest) (*ps.DatabaseBranchPassword, error) | ||
CreateFnInvoked bool | ||
ListFn func(context.Context, *ps.ListDatabaseBranchPasswordRequest) ([]*ps.DatabaseBranchPassword, error) | ||
ListFnInvoked bool | ||
GetFn func(context.Context, *ps.GetDatabaseBranchPasswordRequest) (*ps.DatabaseBranchPassword, error) | ||
GetFnInvoked bool | ||
DeleteFn func(context.Context, *ps.DeleteDatabaseBranchPasswordRequest) error | ||
DeleteFnInvoked bool | ||
} | ||
|
||
func (b *PasswordsService) Create(ctx context.Context, req *ps.DatabaseBranchPasswordRequest) (*ps.DatabaseBranchPassword, error) { | ||
b.CreateFnInvoked = true | ||
return b.CreateFn(ctx, req) | ||
} | ||
|
||
func (b *PasswordsService) List(ctx context.Context, req *ps.ListDatabaseBranchPasswordRequest) ([]*ps.DatabaseBranchPassword, error) { | ||
b.ListFnInvoked = true | ||
return b.ListFn(ctx, req) | ||
} | ||
|
||
func (b *PasswordsService) Get(ctx context.Context, req *ps.GetDatabaseBranchPasswordRequest) (*ps.DatabaseBranchPassword, error) { | ||
b.GetFnInvoked = true | ||
return b.GetFn(ctx, req) | ||
} | ||
|
||
func (b *PasswordsService) Delete(ctx context.Context, req *ps.DeleteDatabaseBranchPasswordRequest) error { | ||
b.DeleteFnInvoked = true | ||
return b.DeleteFn(ctx, req) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters