fake

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 18, 2019 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

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

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

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) Create

func (c *MockUserClient) Create(ctx context.Context, instance string, user *sqladmin.User) error

Create new user for a given instance with provided user definition

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

func (*MockUserClient) List

func (c *MockUserClient) List(ctx context.Context, instance string) ([]*sqladmin.User, error)

List and return all users for a provided instance (name)

func (*MockUserClient) Update

func (c *MockUserClient) Update(ctx context.Context, instance, userName string, user *sqladmin.User) error

Update existing user for a given instance with provided user definition

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL