internal

package
v0.8.8 Latest Latest
Warning

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

Go to latest
Published: Mar 19, 2024 License: GPL-3.0 Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const (
	GHStatusInvalid     = "invalid"
	GHStatusOk          = "ok"
	GHStatusPrimary     = "primary"
	GHStatusStandby     = "standby"
	GHStatusUnavailable = "unavailable"
)

Variables

This section is empty.

Functions

func Initialize

func Initialize()

func RunAPI

func RunAPI()

Types

type PgRouteHandler

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

func NewPgRouteHandler

func NewPgRouteHandler() *PgRouteHandler

func (PgRouteHandler) CreateAvailabilityTable added in v0.8.5

func (prh PgRouteHandler) CreateAvailabilityTable()

func (PgRouteHandler) GetNodeAvailability added in v0.8.5

func (prh PgRouteHandler) GetNodeAvailability(name string, limit float64) string

func (PgRouteHandler) GetNodeStatus

func (prh PgRouteHandler) GetNodeStatus(name string) string

func (PgRouteHandler) GetPrimaries

func (prh PgRouteHandler) GetPrimaries(group string) (primaries []string)

func (PgRouteHandler) GetStandbys

func (prh PgRouteHandler) GetStandbys(group string) (standbys []string)

func (PgRouteHandler) UpdateNodeAvailability added in v0.8.5

func (prh PgRouteHandler) UpdateNodeAvailability()

type RouteConfig

type RouteConfig struct {
	Hosts    RouteHostsConfig `yaml:"hosts"`
	Groups   RouteHostGroups  `yaml:"groups"`
	Bind     string           `yaml:"bind"`
	Port     int              `yaml:"port"`
	Ssl      RouteSSLConfig   `yaml:"ssl"`
	LogLevel string           `yaml:"loglevel"`
	LogFile  string           `yaml:"logfile"`
}

func NewConfig

func NewConfig() (config RouteConfig, err error)

func (RouteConfig) BindTo

func (rc RouteConfig) BindTo() string

func (RouteConfig) Debug added in v0.8.4

func (rc RouteConfig) Debug() bool

func (RouteConfig) GroupHosts added in v0.8.5

func (rc RouteConfig) GroupHosts(groupName string) RouteHostGroup

GroupHosts returns a list of hosts that are part of a group as defined in rc.HostGroups. HostGroup "all" is a special placeholder for all hosts defined in rc.Hosts.

type RouteConnections added in v0.8.5

type RouteConnections map[string]*pg.Conn

func (RouteConnections) FilteredConnections added in v0.8.5

func (rcs RouteConnections) FilteredConnections(filter []string) RouteConnections

type RouteHostGroup added in v0.8.5

type RouteHostGroup []string

type RouteHostGroups added in v0.8.5

type RouteHostGroups map[string]RouteHostGroup

type RouteHostsConfig

type RouteHostsConfig map[string]pg.Dsn

type RouteSSLConfig

type RouteSSLConfig struct {
	Cert string `yaml:"b64cert"`
	Key  string `yaml:"b64key"`
}

func (RouteSSLConfig) CertBytes

func (rsc RouteSSLConfig) CertBytes() ([]byte, error)

func (RouteSSLConfig) Enabled

func (rsc RouteSSLConfig) Enabled() bool

func (RouteSSLConfig) KeyBytes

func (rsc RouteSSLConfig) KeyBytes() ([]byte, error)

func (RouteSSLConfig) MustCertBytes

func (rsc RouteSSLConfig) MustCertBytes() []byte

func (RouteSSLConfig) MustKeyBytes

func (rsc RouteSSLConfig) MustKeyBytes() []byte

Jump to

Keyboard shortcuts

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