api

package
v1.1.40 Latest Latest
Warning

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

Go to latest
Published: May 8, 2024 License: BSD-3-Clause Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AzureInstance

type AzureInstance struct {
}

AzureInstance connection parameters for an Azure db

func (AzureInstance) IsProd

func (a AzureInstance) IsProd() bool

func (AzureInstance) IsShared

func (a AzureInstance) IsShared() bool

func (AzureInstance) Name

func (a AzureInstance) Name() string

type Connection

type Connection struct {
	// Provider where the database is running
	Provider Provider
	// GoogleInstance CloudSQL connection parameters
	GoogleInstance GoogleInstance
	// AzureInstance Azure connection parameters
	AzureInstance AzureInstance
	// KubernetesInstance Kubernetes connection parameters
	KubernetesInstance KubernetesInstance
	// Options cross-platform connection options
	Options ConnectionOptions
}

Connection parameters for a thelma sql connection

func (Connection) Instance

func (c Connection) Instance() Instance

type ConnectionOptions

type ConnectionOptions struct {
	// Database (within the instance) to connect to
	Database string
	// PrivilegeLevel permission level to use for connection
	PrivilegeLevel PrivilegeLevel
	// ProxyCluster terra Kubernetes cluster to connect through
	ProxyCluster terra.Cluster
	// Release (nil if the target database instance has no association with a Terra release)
	Release terra.Release
	// Shell for `thelma sql connect`, optionally launch an interactive Bash shell instead of the default psql/mysql command
	Shell bool
}

type Credentials

type Credentials struct {
	Username string
	Password string
}

type DBMS

type DBMS int64

DBMS kind of database (MySQL or Postgres)

const (
	Postgres DBMS = iota
	MySQL
)

func (DBMS) AdminUser

func (d DBMS) AdminUser() string

func (DBMS) CLIClient

func (d DBMS) CLIClient() string

func (DBMS) String

func (d DBMS) String() string

type GoogleInstance

type GoogleInstance struct {
	InstanceName string // required; CloudSQL instance name
	Project      string // required; CloudSQL google project name
}

GoogleInstance connection parameters for a Google CloudSQL instance

func (GoogleInstance) IsProd

func (g GoogleInstance) IsProd() bool

func (GoogleInstance) IsShared

func (g GoogleInstance) IsShared() bool

func (GoogleInstance) Name

func (g GoogleInstance) Name() string

type Instance

type Instance interface {
	// Name returns a descriptive name for the instance (eg. CloudSQL instance name)
	Name() string
	// IsProd returns true if this instance is in production
	IsProd() bool
	// IsShared returns true if this is a shared instance
	IsShared() bool
}

type KubernetesInstance

type KubernetesInstance struct {
	Release terra.Release
}

KubernetesInstance connection parameters for a K8s-hosted db instance

func (KubernetesInstance) IsProd

func (k KubernetesInstance) IsProd() bool

func (KubernetesInstance) IsShared

func (k KubernetesInstance) IsShared() bool

func (KubernetesInstance) Name

func (k KubernetesInstance) Name() string

type PrivilegeLevel

type PrivilegeLevel int64
const (
	ReadOnly PrivilegeLevel = iota
	ReadWrite
	Admin
)

type Provider

type Provider int64

Provider cloud provider/infra platform where database is hosted (TODO should probably be moved to state api)

const (
	Kubernetes Provider = iota
	Google
	Azure
)

func (Provider) String

func (p Provider) String() string

Jump to

Keyboard shortcuts

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