vdbgen

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Queries = map[QueryType]string{
	ShardCountKey:       "SELECT COUNT(*) FROM SHARDS WHERE SHARD_TYPE != 'Replica'",
	CommunalEndpointKey: "SHOW DATABASE DEFAULT ALL",
	StorageLocationKey:  "SELECT NODE_NAME, LOCATION_PATH FROM STORAGE_LOCATIONS WHERE LOCATION_USAGE = ?",
	SubclusterQueryKey:  "SELECT SUBCLUSTER_NAME, IS_PRIMARY FROM SUBCLUSTERS ORDER BY NODE_NAME",
}

Functions

func Generate

func Generate(wr io.Writer, cr VDBCreator) error

Generate will construct the VerticaDB and print it to wr

Types

type DBGenerator

type DBGenerator struct {
	Conn        *sql.DB
	Opts        *Options
	Objs        KObjs
	LicenseData []byte
}

func (*DBGenerator) Create

func (d *DBGenerator) Create() (*KObjs, error)

Create will generate a VerticaDB based the specifics gathered from a live database

type KObjs

type KObjs struct {
	Vdb                     vapi.VerticaDB
	CredSecret              corev1.Secret
	HasLicense              bool
	LicenseSecret           corev1.Secret
	SuperuserPasswordSecret corev1.Secret
	HasPassword             bool
}

type Options

type Options struct {
	User               string
	Password           string
	TLSMode            string
	VdbName            string
	Host               string
	Port               int
	DBName             string
	IgnoreClusterLease bool
	Image              string
	LicenseFile        string
}

Options contain the command line options and positional arguments

type QueryType

type QueryType string
const (
	ShardCountKey       QueryType = "shardCount"
	CommunalEndpointKey QueryType = "communalEP"
	StorageLocationKey  QueryType = "storageLocation"
	SubclusterQueryKey  QueryType = "subcluster"

	SecretAPIVersion = "v1"
	SecretKindName   = "Secret"
)

type VDBCreator

type VDBCreator interface {
	Create() (*KObjs, error)
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
JackTT - Gopher 🇻🇳