data

package
v0.0.0-...-6b129f5 Latest Latest
Warning

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

Go to latest
Published: Sep 6, 2015 License: BSD-3-Clause Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var AlgorithmLabels = map[Algorithm]string{
	"round-robin":       "Round-robin",
	"least-connections": "Least Connections",
	"source-ip":         "Source IP",
}
View Source
var Algorithms = []Algorithm{
	"round-robin",
	"least-connections",
	"source-ip",
}
View Source
var Availabilities = []Availability{
	"unavailable",
	"available",
	"backup",
}
View Source
var AvailabilityLabels = map[Availability]string{
	"unavailable": "Unavailable",
	"available":   "Available",
	"backup":      "Backup",
}
View Source
var CipherSuiteLabels = map[CipherSuite]string{
	"recommended": "Recommended",
	"legacy":      "Legacy",
}
View Source
var CipherSuites = []CipherSuite{
	"recommended",
	"legacy",
}
View Source
var DB *bolt.DB
View Source
var DriverLabels = map[Driver]string{
	"nginx": "Nginx",
}
View Source
var Drivers = []Driver{
	"nginx",
}
View Source
var ProtocolLabels = map[Protocol]string{
	"http":  "HTTP",
	"https": "HTTPS",
}
View Source
var Protocols = []Protocol{
	"http",
	"https",
}

Functions

func InitDB

func InitDB() error

func OpenDB

func OpenDB(path string) error

Types

type Algorithm

type Algorithm string

func (Algorithm) Label

func (a Algorithm) Label() string

type Availability

type Availability string

func (Availability) Label

func (a Availability) Label() string

type Balancer

type Balancer struct {
	Id       bson.ObjectId
	Label    string
	Settings BalancerSettings
}

func GetBalancer

func GetBalancer(id bson.ObjectId) (*Balancer, error)

func ListBalancers

func ListBalancers() ([]Balancer, error)

func (*Balancer) Put

func (l *Balancer) Put() error

func (*Balancer) Servers

func (l *Balancer) Servers() ([]Server, error)

type BalancerSettings

type BalancerSettings struct {
	Hostname   string
	Port       int
	Protocol   Protocol
	Algorithm  Algorithm
	SSLOptions SSLOptions
}

type CipherSuite

type CipherSuite string

func (CipherSuite) Label

func (c CipherSuite) Label() string

type Driver

type Driver string

func (Driver) Label

func (a Driver) Label() string

type Password

type Password struct {
	Hash []byte
	Salt []byte
}

func (*Password) Equal

func (p *Password) Equal(clear string) bool

func (*Password) Set

func (p *Password) Set(clear string) error

type Protocol

type Protocol string

func (Protocol) Label

func (p Protocol) Label() string

type SSLOptions

type SSLOptions struct {
	CipherSuite CipherSuite
	Certificate []byte
	PrivateKey  []byte

	DNSNames    []string
	Fingerprint []byte
}

type Server

type Server struct {
	Id         bson.ObjectId
	BalancerId bson.ObjectId
	Label      string
	Settings   ServerSettings
}

func GetServer

func GetServer(id bson.ObjectId) (*Server, error)

func ListServersByBalancer

func ListServersByBalancer(bal *Balancer) ([]Server, error)

func (*Server) Balancer

func (s *Server) Balancer() (*Balancer, error)

func (*Server) Put

func (s *Server) Put() error

type ServerSettings

type ServerSettings struct {
	Address      string
	Weight       int
	Availability Availability
}

Jump to

Keyboard shortcuts

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