Documentation ¶
Index ¶
- Constants
- type MySQLUser
- type MySqlUserManager
- func (m *MySqlUserManager) CreateUser(ctx context.Context, secret map[string][]byte, db *sql.DB) (string, error)
- func (s *MySqlUserManager) Delete(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
- func (m *MySqlUserManager) DeleteSecrets(ctx context.Context, instance *v1alpha2.MySQLUser, ...) (bool, error)
- func (s *MySqlUserManager) Ensure(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
- func (m *MySqlUserManager) GetDB(ctx context.Context, resourceGroupName string, serverName string, ...) (db mysqlmgmt.Database, err error)
- func (m *MySqlUserManager) GetOrPrepareSecret(ctx context.Context, instance *v1alpha2.MySQLUser, ...) map[string][]byte
- func (s *MySqlUserManager) GetParents(obj runtime.Object) ([]resourcemanager.KubeParent, error)
- func (m *MySqlUserManager) GetServer(ctx context.Context, resourceGroupName, serverName string) (mysqlmgmt.Server, error)
- func (s *MySqlUserManager) GetStatus(obj runtime.Object) (*v1alpha1.ASOStatus, error)
Constants ¶
View Source
const MSecretPasswordKey = "password"
MSecretPasswordKey is the password key in secret
View Source
const MSecretUsernameKey = "username"
MSecretUsernameKey is the username key in secret
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type MySQLUser ¶
type MySQLUser interface { GetDB(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (mysql.Database, error) ConnectToMySqlDb(ctx context.Context, drivername string, server string, dbname string, port int, username string, password string) (*sql.DB, error) GrantUserRoles(ctx context.Context, user string, database string, roles []string, db *sql.DB) error CreateUser(ctx context.Context, server string, secret map[string][]byte, db *sql.DB) (string, error) UserExists(ctx context.Context, db *sql.DB, username string) (bool, error) DropUser(ctx context.Context, db *sql.DB, user string) error DeleteSecrets(ctx context.Context, instance *v1alpha1.MySQLUser, secretClient secrets.SecretClient) (bool, error) GetOrPrepareSecret(ctx context.Context, instance *v1alpha1.MySQLUser, secretClient secrets.SecretClient) map[string][]byte // also embed methods from AsyncClient resourcemanager.ARMClient }
MySQLUser interface provides the functions of mySQLUser
type MySqlUserManager ¶
type MySqlUserManager struct { Creds config.Credentials SecretClient secrets.SecretClient Scheme *runtime.Scheme }
MySqlUserManager for mysqluser manager
func NewMySqlUserManager ¶
func NewMySqlUserManager(creds config.Credentials, secretClient secrets.SecretClient, scheme *runtime.Scheme) *MySqlUserManager
NewMySqlUserManager creates a new MySqlUserManager
func (*MySqlUserManager) CreateUser ¶
func (m *MySqlUserManager) CreateUser(ctx context.Context, secret map[string][]byte, db *sql.DB) (string, error)
CreateUser creates user with secret credentials
func (*MySqlUserManager) Delete ¶
func (s *MySqlUserManager) Delete(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
Delete deletes a user
func (*MySqlUserManager) DeleteSecrets ¶
func (m *MySqlUserManager) DeleteSecrets(ctx context.Context, instance *v1alpha2.MySQLUser, secretClient secrets.SecretClient) (bool, error)
DeleteSecrets deletes the secrets associated with a SQLUser
func (*MySqlUserManager) Ensure ¶
func (s *MySqlUserManager) Ensure(ctx context.Context, obj runtime.Object, opts ...resourcemanager.ConfigOption) (bool, error)
Ensure that user exists
func (*MySqlUserManager) GetDB ¶
func (m *MySqlUserManager) GetDB(ctx context.Context, resourceGroupName string, serverName string, databaseName string) (db mysqlmgmt.Database, err error)
GetDB retrieves a database
func (*MySqlUserManager) GetOrPrepareSecret ¶
func (m *MySqlUserManager) GetOrPrepareSecret(ctx context.Context, instance *v1alpha2.MySQLUser, secretClient secrets.SecretClient) map[string][]byte
GetOrPrepareSecret gets or creates a secret
func (*MySqlUserManager) GetParents ¶
func (s *MySqlUserManager) GetParents(obj runtime.Object) ([]resourcemanager.KubeParent, error)
GetParents gets the parents of the user
Click to show internal directories.
Click to hide internal directories.