gorb

package
v2.0.0+incompatible Latest Latest
Warning

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

Go to latest
Published: Aug 28, 2019 License: BSD-3-Clause Imports: 19 Imported by: 0

Documentation

Overview

Package gorb provide the ability to register and deregister the backend

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(c *Config) (controller.Updater, error)

New creates a gorb handler

Types

type BackendConfig

type BackendConfig struct {
	Host   string `json:"host"`
	Port   int    `json:"port"`
	Method string `json:"method"`
	Weight int    `json:"weight"`
	Pulse  Pulse  `json:"pulse"`
}

BackendConfig defines the backend configuration

type CommandRunner

type CommandRunner interface {
	Execute(cmd string) ([]byte, error)
}

CommandRunner is a cut down version of exec.Cmd for running commands

type Config

type Config struct {
	ServerBaseURL              string
	InstanceIP                 string
	DrainDelay                 time.Duration
	ServicesDefinition         []VirtualService
	BackendWeight              int
	BackendMethod              string
	VipLoadbalancer            string
	ManageLoopback             bool
	BackendHealthcheckInterval string
	BackendHealthcheckType     string
	InterfaceProcFsPath        string
}

Config defines all the configuration required for gorb

type Pulse

type Pulse struct {
	TypeHealthcheck string    `json:"type"`
	Args            PulseArgs `json:"args"`
	Interval        string    `json:"interval"`
}

Pulse defines backend health check

type PulseArgs

type PulseArgs struct {
	Method string `json:"method"`
	Path   string `json:"path"`
	Expect string `json:"expect"`
}

PulseArgs defines health check URI

type SimpleCommandRunner

type SimpleCommandRunner struct {
}

SimpleCommandRunner implements CommandRunner

func (*SimpleCommandRunner) Execute

func (c *SimpleCommandRunner) Execute(cmd string) ([]byte, error)

Execute runs the given command and returns its output

type VirtualService

type VirtualService struct {
	Name string
	Port int
}

VirtualService defines the virtual services

Jump to

Keyboard shortcuts

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