flypg

package
v0.0.8 Latest Latest
Warning

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

Go to latest
Published: Nov 24, 2021 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BackendStoreConsul      = "consul"
	BackendStoreEtcd        = "etcdv3"
	BackendStoreUnspecified = ""
)

Variables

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

Functions

func InitConfig

func InitConfig(filename string) error

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"`
}

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)

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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