Documentation
¶
Index ¶
- type Connection
- func NewETCDConnection(config ConnectionConfig) (Connection, error)
- func NewMySQLConnection(config ConnectionConfig) (Connection, error)
- func NewPostgreSQLConnection(config ConnectionConfig) (Connection, error)
- func NewStorageConnection(ctx context.Context, client client.Client, ds stewardv1alpha1.DataStore) (Connection, error)
- type ConnectionConfig
- type ConnectionEndpoint
- type EtcdClient
- func (e *EtcdClient) Check(ctx context.Context) error
- func (e *EtcdClient) Close() error
- func (e *EtcdClient) CreateDB(context.Context, string) error
- func (e *EtcdClient) CreateUser(ctx context.Context, user, password string) error
- func (e *EtcdClient) DBExists(context.Context, string) (bool, error)
- func (e *EtcdClient) DeleteDB(ctx context.Context, dbName string) error
- func (e *EtcdClient) DeleteUser(ctx context.Context, user string) error
- func (e *EtcdClient) Driver() string
- func (e *EtcdClient) GetConnectionString() string
- func (e *EtcdClient) GrantPrivileges(ctx context.Context, user, dbName string) error
- func (e *EtcdClient) GrantPrivilegesExists(ctx context.Context, username, dbName string) (bool, error)
- func (e *EtcdClient) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
- func (e *EtcdClient) RevokePrivileges(ctx context.Context, _, dbName string) error
- func (e *EtcdClient) UserExists(ctx context.Context, user string) (bool, error)
- type MySQLConnection
- func (c *MySQLConnection) Check(ctx context.Context) error
- func (c *MySQLConnection) Close() error
- func (c *MySQLConnection) CreateDB(ctx context.Context, dbName string) error
- func (c *MySQLConnection) CreateUser(ctx context.Context, user, password string) error
- func (c *MySQLConnection) DBExists(ctx context.Context, dbName string) (bool, error)
- func (c *MySQLConnection) DeleteDB(ctx context.Context, dbName string) error
- func (c *MySQLConnection) DeleteUser(ctx context.Context, user string) error
- func (c *MySQLConnection) Driver() string
- func (c *MySQLConnection) GetConnectionString() string
- func (c *MySQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
- func (c *MySQLConnection) GrantPrivilegesExists(_ context.Context, user, dbName string) (bool, error)
- func (c *MySQLConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
- func (c *MySQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
- func (c *MySQLConnection) UserExists(ctx context.Context, user string) (bool, error)
- type NATSConnection
- func (nc *NATSConnection) Check(_ context.Context) error
- func (nc *NATSConnection) Close() error
- func (nc *NATSConnection) CreateDB(_ context.Context, dbName string) error
- func (nc *NATSConnection) CreateUser(_ context.Context, _, _ string) error
- func (nc *NATSConnection) DBExists(_ context.Context, dbName string) (bool, error)
- func (nc *NATSConnection) DeleteDB(_ context.Context, dbName string) error
- func (nc *NATSConnection) DeleteUser(_ context.Context, _ string) error
- func (nc *NATSConnection) Driver() string
- func (nc *NATSConnection) GetConfig() ConnectionConfig
- func (nc *NATSConnection) GetConnectionString() string
- func (nc *NATSConnection) GrantPrivileges(_ context.Context, _, _ string) error
- func (nc *NATSConnection) GrantPrivilegesExists(_ context.Context, _, _ string) (bool, error)
- func (nc *NATSConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
- func (nc *NATSConnection) RevokePrivileges(_ context.Context, _, _ string) error
- func (nc *NATSConnection) UserExists(_ context.Context, _ string) (bool, error)
- type PostgreSQLConnection
- func (r *PostgreSQLConnection) Check(ctx context.Context) error
- func (r *PostgreSQLConnection) Close() error
- func (r *PostgreSQLConnection) CreateDB(ctx context.Context, dbName string) error
- func (r *PostgreSQLConnection) CreateUser(ctx context.Context, user, password string) error
- func (r *PostgreSQLConnection) DBExists(ctx context.Context, dbName string) (bool, error)
- func (r *PostgreSQLConnection) DeleteDB(ctx context.Context, dbName string) error
- func (r *PostgreSQLConnection) DeleteUser(ctx context.Context, user string) error
- func (r *PostgreSQLConnection) Driver() string
- func (r *PostgreSQLConnection) GetConnectionString() string
- func (r *PostgreSQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
- func (r *PostgreSQLConnection) GrantPrivilegesExists(ctx context.Context, user, dbName string) (bool, error)
- func (r *PostgreSQLConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
- func (r *PostgreSQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
- func (r *PostgreSQLConnection) UserExists(ctx context.Context, user string) (bool, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
type Connection interface {
CreateUser(ctx context.Context, user, password string) error
CreateDB(ctx context.Context, dbName string) error
GrantPrivileges(ctx context.Context, user, dbName string) error
UserExists(ctx context.Context, user string) (bool, error)
DBExists(ctx context.Context, dbName string) (bool, error)
GrantPrivilegesExists(ctx context.Context, user, dbName string) (bool, error)
DeleteUser(ctx context.Context, user string) error
DeleteDB(ctx context.Context, dbName string) error
RevokePrivileges(ctx context.Context, user, dbName string) error
GetConnectionString() string
Close() error
Check(ctx context.Context) error
Driver() string
Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
}
func NewETCDConnection ¶
func NewETCDConnection(config ConnectionConfig) (Connection, error)
func NewMySQLConnection ¶
func NewMySQLConnection(config ConnectionConfig) (Connection, error)
func NewPostgreSQLConnection ¶
func NewPostgreSQLConnection(config ConnectionConfig) (Connection, error)
func NewStorageConnection ¶
func NewStorageConnection(ctx context.Context, client client.Client, ds stewardv1alpha1.DataStore) (Connection, error)
type ConnectionConfig ¶
type ConnectionConfig struct {
User string
Password string
Endpoints []ConnectionEndpoint
DBName string
TLSConfig *tls.Config
Parameters map[string][]string
}
func NewConnectionConfig ¶
func NewConnectionConfig(ctx context.Context, client client.Client, ds stewardv1alpha1.DataStore) (*ConnectionConfig, error)
type ConnectionEndpoint ¶
func (ConnectionEndpoint) String ¶
func (r ConnectionEndpoint) String() string
type EtcdClient ¶
type EtcdClient struct {
Client etcdclient.Client
}
func (*EtcdClient) Close ¶
func (e *EtcdClient) Close() error
func (*EtcdClient) CreateUser ¶
func (e *EtcdClient) CreateUser(ctx context.Context, user, password string) error
func (*EtcdClient) DeleteDB ¶
func (e *EtcdClient) DeleteDB(ctx context.Context, dbName string) error
func (*EtcdClient) DeleteUser ¶
func (e *EtcdClient) DeleteUser(ctx context.Context, user string) error
func (*EtcdClient) Driver ¶
func (e *EtcdClient) Driver() string
func (*EtcdClient) GetConnectionString ¶
func (e *EtcdClient) GetConnectionString() string
func (*EtcdClient) GrantPrivileges ¶
func (e *EtcdClient) GrantPrivileges(ctx context.Context, user, dbName string) error
func (*EtcdClient) GrantPrivilegesExists ¶
func (*EtcdClient) Migrate ¶
func (e *EtcdClient) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
func (*EtcdClient) RevokePrivileges ¶
func (e *EtcdClient) RevokePrivileges(ctx context.Context, _, dbName string) error
func (*EtcdClient) UserExists ¶
type MySQLConnection ¶
type MySQLConnection struct {
// contains filtered or unexported fields
}
func (*MySQLConnection) Close ¶
func (c *MySQLConnection) Close() error
func (*MySQLConnection) CreateDB ¶
func (c *MySQLConnection) CreateDB(ctx context.Context, dbName string) error
func (*MySQLConnection) CreateUser ¶
func (c *MySQLConnection) CreateUser(ctx context.Context, user, password string) error
func (*MySQLConnection) DeleteDB ¶
func (c *MySQLConnection) DeleteDB(ctx context.Context, dbName string) error
func (*MySQLConnection) DeleteUser ¶
func (c *MySQLConnection) DeleteUser(ctx context.Context, user string) error
func (*MySQLConnection) Driver ¶
func (c *MySQLConnection) Driver() string
func (*MySQLConnection) GetConnectionString ¶
func (c *MySQLConnection) GetConnectionString() string
func (*MySQLConnection) GrantPrivileges ¶
func (c *MySQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
func (*MySQLConnection) GrantPrivilegesExists ¶
func (*MySQLConnection) Migrate ¶
func (c *MySQLConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
func (*MySQLConnection) RevokePrivileges ¶
func (c *MySQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
func (*MySQLConnection) UserExists ¶
type NATSConnection ¶
type NATSConnection struct {
// contains filtered or unexported fields
}
NATSConnection represents a connection to a NATS KV store.
func NewNATSConnection ¶
func NewNATSConnection(config ConnectionConfig) (*NATSConnection, error)
NewNATSConnection initializes a connection to NATS and sets up the KV store.
func (*NATSConnection) Close ¶
func (nc *NATSConnection) Close() error
func (*NATSConnection) CreateDB ¶
func (nc *NATSConnection) CreateDB(_ context.Context, dbName string) error
func (*NATSConnection) CreateUser ¶
func (nc *NATSConnection) CreateUser(_ context.Context, _, _ string) error
func (*NATSConnection) DeleteDB ¶
func (nc *NATSConnection) DeleteDB(_ context.Context, dbName string) error
func (*NATSConnection) DeleteUser ¶
func (nc *NATSConnection) DeleteUser(_ context.Context, _ string) error
func (*NATSConnection) Driver ¶
func (nc *NATSConnection) Driver() string
func (*NATSConnection) GetConfig ¶
func (nc *NATSConnection) GetConfig() ConnectionConfig
func (*NATSConnection) GetConnectionString ¶
func (nc *NATSConnection) GetConnectionString() string
func (*NATSConnection) GrantPrivileges ¶
func (nc *NATSConnection) GrantPrivileges(_ context.Context, _, _ string) error
func (*NATSConnection) GrantPrivilegesExists ¶
func (*NATSConnection) Migrate ¶
func (nc *NATSConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
func (*NATSConnection) RevokePrivileges ¶
func (nc *NATSConnection) RevokePrivileges(_ context.Context, _, _ string) error
func (*NATSConnection) UserExists ¶
type PostgreSQLConnection ¶
type PostgreSQLConnection struct {
// contains filtered or unexported fields
}
func (*PostgreSQLConnection) Check ¶
func (r *PostgreSQLConnection) Check(ctx context.Context) error
func (*PostgreSQLConnection) Close ¶
func (r *PostgreSQLConnection) Close() error
func (*PostgreSQLConnection) CreateDB ¶
func (r *PostgreSQLConnection) CreateDB(ctx context.Context, dbName string) error
func (*PostgreSQLConnection) CreateUser ¶
func (r *PostgreSQLConnection) CreateUser(ctx context.Context, user, password string) error
func (*PostgreSQLConnection) DeleteDB ¶
func (r *PostgreSQLConnection) DeleteDB(ctx context.Context, dbName string) error
func (*PostgreSQLConnection) DeleteUser ¶
func (r *PostgreSQLConnection) DeleteUser(ctx context.Context, user string) error
func (*PostgreSQLConnection) Driver ¶
func (r *PostgreSQLConnection) Driver() string
func (*PostgreSQLConnection) GetConnectionString ¶
func (r *PostgreSQLConnection) GetConnectionString() string
func (*PostgreSQLConnection) GrantPrivileges ¶
func (r *PostgreSQLConnection) GrantPrivileges(ctx context.Context, user, dbName string) error
func (*PostgreSQLConnection) GrantPrivilegesExists ¶
func (*PostgreSQLConnection) Migrate ¶
func (r *PostgreSQLConnection) Migrate(ctx context.Context, tcp stewardv1alpha1.TenantControlPlane, target Connection) error
func (*PostgreSQLConnection) RevokePrivileges ¶
func (r *PostgreSQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error
func (*PostgreSQLConnection) UserExists ¶
Click to show internal directories.
Click to hide internal directories.