datastore

package
v0.5.1 Latest Latest
Warning

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

Go to latest
Published: Apr 24, 2024 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

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 kamajiv1alpha1.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 added in v0.2.0

func NewStorageConnection(ctx context.Context, client client.Client, ds kamajiv1alpha1.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 added in v0.2.0

func NewConnectionConfig(ctx context.Context, client client.Client, ds kamajiv1alpha1.DataStore) (*ConnectionConfig, error)

type ConnectionEndpoint

type ConnectionEndpoint struct {
	Host string
	Port int
}

func (ConnectionEndpoint) String

func (r ConnectionEndpoint) String() string

type EtcdClient

type EtcdClient struct {
	Client etcdclient.Client
}

func (*EtcdClient) Check

func (e *EtcdClient) Check(ctx context.Context) error

func (*EtcdClient) Close

func (e *EtcdClient) Close() error

func (*EtcdClient) CreateDB

func (e *EtcdClient) CreateDB(context.Context, string) error

func (*EtcdClient) CreateUser

func (e *EtcdClient) CreateUser(ctx context.Context, user, password string) error

func (*EtcdClient) DBExists

func (e *EtcdClient) DBExists(context.Context, string) (bool, 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 (e *EtcdClient) GrantPrivilegesExists(ctx context.Context, username, dbName string) (bool, error)

func (*EtcdClient) Migrate added in v0.2.0

func (*EtcdClient) RevokePrivileges

func (e *EtcdClient) RevokePrivileges(ctx context.Context, _, dbName string) error

func (*EtcdClient) UserExists

func (e *EtcdClient) UserExists(ctx context.Context, user string) (bool, error)

type MySQLConnection

type MySQLConnection struct {
	// contains filtered or unexported fields
}

func (*MySQLConnection) Check

func (c *MySQLConnection) Check(ctx context.Context) error

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

func (c *MySQLConnection) DBExists(ctx context.Context, dbName string) (bool, 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 (c *MySQLConnection) GrantPrivilegesExists(_ context.Context, user, dbName string) (bool, error)

func (*MySQLConnection) Migrate added in v0.2.0

func (*MySQLConnection) RevokePrivileges

func (c *MySQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error

func (*MySQLConnection) UserExists

func (c *MySQLConnection) UserExists(ctx context.Context, user string) (bool, error)

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

func (r *PostgreSQLConnection) DBExists(ctx context.Context, dbName string) (bool, 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 (r *PostgreSQLConnection) GrantPrivilegesExists(ctx context.Context, user, dbName string) (bool, error)

func (*PostgreSQLConnection) Migrate added in v0.2.0

func (*PostgreSQLConnection) RevokePrivileges

func (r *PostgreSQLConnection) RevokePrivileges(ctx context.Context, user, dbName string) error

func (*PostgreSQLConnection) UserExists

func (r *PostgreSQLConnection) UserExists(ctx context.Context, user string) (bool, error)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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