datastore

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 19, 2024 License: Apache-2.0 Imports: 23 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 NATSConnection added in v0.6.0

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

NATSConnection represents a connection to a NATS KV store.

func NewNATSConnection added in v0.6.0

func NewNATSConnection(config ConnectionConfig) (*NATSConnection, error)

NewNATSConnection initializes a connection to NATS and sets up the KV store.

func (*NATSConnection) Check added in v0.6.0

func (nc *NATSConnection) Check(_ context.Context) error

func (*NATSConnection) Close added in v0.6.0

func (nc *NATSConnection) Close() error

func (*NATSConnection) CreateDB added in v0.6.0

func (nc *NATSConnection) CreateDB(_ context.Context, dbName string) error

func (*NATSConnection) CreateUser added in v0.6.0

func (nc *NATSConnection) CreateUser(_ context.Context, _, _ string) error

func (*NATSConnection) DBExists added in v0.6.0

func (nc *NATSConnection) DBExists(_ context.Context, dbName string) (bool, error)

func (*NATSConnection) DeleteDB added in v0.6.0

func (nc *NATSConnection) DeleteDB(_ context.Context, dbName string) error

func (*NATSConnection) DeleteUser added in v0.6.0

func (nc *NATSConnection) DeleteUser(_ context.Context, _ string) error

func (*NATSConnection) Driver added in v0.6.0

func (nc *NATSConnection) Driver() string

func (*NATSConnection) GetConfig added in v0.6.0

func (nc *NATSConnection) GetConfig() ConnectionConfig

func (*NATSConnection) GetConnectionString added in v0.6.0

func (nc *NATSConnection) GetConnectionString() string

func (*NATSConnection) GrantPrivileges added in v0.6.0

func (nc *NATSConnection) GrantPrivileges(_ context.Context, _, _ string) error

func (*NATSConnection) GrantPrivilegesExists added in v0.6.0

func (nc *NATSConnection) GrantPrivilegesExists(_ context.Context, _, _ string) (bool, error)

func (*NATSConnection) Migrate added in v0.6.0

func (*NATSConnection) RevokePrivileges added in v0.6.0

func (nc *NATSConnection) RevokePrivileges(_ context.Context, _, _ string) error

func (*NATSConnection) UserExists added in v0.6.0

func (nc *NATSConnection) UserExists(_ context.Context, _ 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