Documentation ¶
Index ¶
- type MockInstanceClient
- func (c *MockInstanceClient) Create(ctx context.Context, instance *sqladmin.DatabaseInstance) error
- func (c *MockInstanceClient) Delete(ctx context.Context, name string) error
- func (c *MockInstanceClient) Get(ctx context.Context, name string) (*sqladmin.DatabaseInstance, error)
- func (c *MockInstanceClient) Update(ctx context.Context, name string, instance *sqladmin.DatabaseInstance) error
- type MockUserClient
- func (c *MockUserClient) Create(ctx context.Context, instance string, user *sqladmin.User) error
- func (c *MockUserClient) Delete(ctx context.Context, instance, database, user string) error
- func (c *MockUserClient) List(ctx context.Context, instance string) ([]*sqladmin.User, error)
- func (c *MockUserClient) Update(ctx context.Context, instance, userName string, user *sqladmin.User) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MockInstanceClient ¶
type MockInstanceClient struct { MockGet func(context.Context, string) (*sqladmin.DatabaseInstance, error) MockCreate func(context.Context, *sqladmin.DatabaseInstance) error MockUpdate func(context.Context, string, *sqladmin.DatabaseInstance) error MockDelete func(context.Context, string) error }
MockInstanceClient for testing purposes
func (*MockInstanceClient) Create ¶
func (c *MockInstanceClient) Create(ctx context.Context, instance *sqladmin.DatabaseInstance) error
Create new cloudsql instance with provided instance definition and return newly created instance
func (*MockInstanceClient) Delete ¶
func (c *MockInstanceClient) Delete(ctx context.Context, name string) error
Delete cloudsql instance with matching name
func (*MockInstanceClient) Get ¶
func (c *MockInstanceClient) Get(ctx context.Context, name string) (*sqladmin.DatabaseInstance, error)
Get attempts to retrieve and return cloudsql instance using provided name value
func (*MockInstanceClient) Update ¶
func (c *MockInstanceClient) Update(ctx context.Context, name string, instance *sqladmin.DatabaseInstance) error
Update cloudsql instance with matching name with provided instance definition and return newly create instance
type MockUserClient ¶
type MockUserClient struct { MockList func(context.Context, string) ([]*sqladmin.User, error) MockCreate func(context.Context, string, *sqladmin.User) error MockUpdate func(context.Context, string, string, *sqladmin.User) error MockDelete func(context.Context, string, string, string) error }
MockUserClient implements UserService interface
func (*MockUserClient) Delete ¶
func (c *MockUserClient) Delete(ctx context.Context, instance, database, user string) error
Delete existing user from a given instance database with matching name
Click to show internal directories.
Click to hide internal directories.