common

package
v0.0.0-...-64e9426 Latest Latest
Warning

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

Go to latest
Published: Apr 7, 2019 License: Apache-2.0 Imports: 1 Imported by: 18

Documentation

Index

Constants

View Source
const (
	NODE_ROLE_MASTER  string = "master"
	NODE_ROLE_REPLICA string = "replica"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Credentials

type Credentials struct {
	Username string            `mapstructure:"username"`
	Password string            `mapstructure:"password,omitempty"`
	Database string            `mapstructure:"database"`
	SSL      SSLConfig         `mapstructure:"ssl"`
	Options  map[string]string `mapstructure:"options"`
}

type HealthCheckConfig

type HealthCheckConfig struct {
	Delay int    `mapstructure:"delay"`
	Query string `mapstructure:"query"`
}

type Node

type Node struct {
	HostPort string            `mapstructure:"hostport"` //remote host:port
	Role     string            `mapstructure:"role"`
	Metadata map[string]string `mapstructure:"metadata"`
	Healthy  bool              `mapstructure:"-"`
}

type Pool

type Pool struct {
	Channel     chan int   `mapstructure:"-"`
	Connections []net.Conn `mapstructure:"-"`
}

type SSLConfig

type SSLConfig struct {
	Enable        bool   `mapstructure:"enable"`
	SSLMode       string `mapstructure:"sslmode"`
	SSLCert       string `mapstructure:"sslcert,omitempty"`
	SSLKey        string `mapstructure:"sslkey,omitempty"`
	SSLRootCA     string `mapstructure:"sslrootca,omitempty"`
	SSLServerCert string `mapstructure:"sslservercert,omitempty"`
	SSLServerKey  string `mapstructure:"sslserverkey,omitempty"`
	SSLServerCA   string `mapstructure:"sslserverca,omitempty"`
}

Jump to

Keyboard shortcuts

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