Documentation ¶
Index ¶
- Constants
- type InstanceClient
- func (c *InstanceClient) Create(ctx context.Context, instance *sqladmin.DatabaseInstance) error
- func (c *InstanceClient) Delete(ctx context.Context, name string) error
- func (c *InstanceClient) Get(ctx context.Context, name string) (*sqladmin.DatabaseInstance, error)
- func (c *InstanceClient) Update(ctx context.Context, name string, instance *sqladmin.DatabaseInstance) error
- type InstanceService
- type UserClient
- func (c *UserClient) Create(ctx context.Context, instance string, user *sqladmin.User) error
- func (c *UserClient) Delete(ctx context.Context, instance, database, user string) error
- func (c *UserClient) List(ctx context.Context, instance string) ([]*sqladmin.User, error)
- func (c *UserClient) Update(ctx context.Context, instance, userName string, user *sqladmin.User) error
- type UserService
Constants ¶
const DefaultScope = sqladmin.SqlserviceAdminScope
DefaultScope for sqladmin client
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type InstanceClient ¶
type InstanceClient struct {
// contains filtered or unexported fields
}
InstanceClient implements InstanceService interface
func NewInstanceClient ¶
func NewInstanceClient(ctx context.Context, creds *google.Credentials) (*InstanceClient, error)
NewInstanceClient creates a new instance of an InstanceClient
func (*InstanceClient) Create ¶
func (c *InstanceClient) Create(ctx context.Context, instance *sqladmin.DatabaseInstance) error
Create new cloudsql instance with provided instance definition and return newly created instance
func (*InstanceClient) Delete ¶
func (c *InstanceClient) Delete(ctx context.Context, name string) error
Delete cloudsql instance with matching name
func (*InstanceClient) Get ¶
func (c *InstanceClient) Get(ctx context.Context, name string) (*sqladmin.DatabaseInstance, error)
Get attempts to retrieve and return cloudsql instance using provided name value
func (*InstanceClient) Update ¶
func (c *InstanceClient) 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 InstanceService ¶
type InstanceService interface { Get(context.Context, string) (*sqladmin.DatabaseInstance, error) Create(context.Context, *sqladmin.DatabaseInstance) error Update(context.Context, string, *sqladmin.DatabaseInstance) error Delete(context.Context, string) error }
InstanceService provides an interface for operations on CloudSQL instances
type UserClient ¶
type UserClient struct {
// contains filtered or unexported fields
}
UserClient implements UserService interface
func NewUserClient ¶
func NewUserClient(ctx context.Context, creds *google.Credentials) (*UserClient, error)
NewUserClient creates new instance of UserClient
func (*UserClient) Delete ¶
func (c *UserClient) Delete(ctx context.Context, instance, database, user string) error
Delete existing user from a given instance database with matching name
type UserService ¶
type UserService interface { List(context.Context, string) ([]*sqladmin.User, error) Create(context.Context, string, *sqladmin.User) error Update(context.Context, string, string, *sqladmin.User) error Delete(context.Context, string, string, string) error }
UserService provides an interface for operations on cloudsql users