flypg

package
v0.0.41 Latest Latest
Warning

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

Go to latest
Published: May 19, 2023 License: Apache-2.0 Imports: 22 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendStoreConsul      = "consul"
	BackendStoreEtcd        = "etcdv3"
	BackendStoreUnspecified = ""
)
View Source
const InitModeExisting = "existing"
View Source
const InitModeNew = "new"

Variables

View Source
var ErrClusterNotInitialized = errors.New("cluster not initialized")

Functions

func PGPort

func PGPort() string

Types

type Config

type Config struct {
	InitMode                  string            `json:"initMode"`
	ExistingConfig            map[string]string `json:"existingConfig"`
	PGParameters              map[string]string `json:"pgParameters"`
	MaxStandbysPerSender      int               `json:"maxStandbysPerSender"`
	DeadKeeperRemovalInterval string            `json:"deadKeeperRemovalInterval"`
}

func InitConfig

func InitConfig(filename string) (*Config, error)

type Credentials

type Credentials struct {
	Username string
	Password string
}

type KeeperState

type KeeperState struct {
	UID        string `json:"UID"`
	ClusterUID string `json:"ClusterUID"`
}

type Node

type Node struct {
	AppName       string
	PrivateIP     net.IP
	Region        string
	PrimaryRegion string
	DataDir       string

	SUCredentials       Credentials
	ReplCredentials     Credentials
	OperatorCredentials Credentials

	BackendStore    string
	BackendStoreURL *url.URL

	KeeperUID string
	StoreNode string

	PGPort      int
	PGProxyPort int
}

func NewNode

func NewNode() (*Node, error)

func (*Node) GetStolonClusterData

func (n *Node) GetStolonClusterData() (s stolon.ClusterData, err error)

func (*Node) IsPrimaryRegion

func (n *Node) IsPrimaryRegion() bool

func (*Node) NewLeaderConnection

func (n *Node) NewLeaderConnection(ctx context.Context) (*pgx.Conn, error)

func (*Node) NewLocalConnection

func (n *Node) NewLocalConnection(ctx context.Context) (*pgx.Conn, error)

func (*Node) NewProxyConnection

func (n *Node) NewProxyConnection(ctx context.Context) (*pgx.Conn, error)

type Setting added in v0.0.20

type Setting struct {
	Name           *string   `json:"name,omitempty"`
	Setting        *string   `json:"setting,omitempty"`
	Context        *string   `json:"context,omitempty"`
	VarType        *string   `json:"vartype,omitempty"`
	MinVal         *string   `json:"min_val,omitempty"`
	MaxVal         *string   `json:"max_val,omitempty"`
	EnumVals       []*string `json:"enumvals,omitempty"`
	Unit           *string   `json:"unit,omitempty"`
	ShortDesc      *string   `json:"short_desc,omitempty"`
	PendingChange  *string   `json:"pending_change,omitempty"`
	PendingRestart bool      `json:"pending_restart,omitempty"`
}

type Settings added in v0.0.20

type Settings struct {
	Settings []Setting `json:"settings,omitempty"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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