db

package
v0.0.0-...-b61aaf9 Latest Latest
Warning

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

Go to latest
Published: Jan 21, 2016 License: Apache-2.0, Apache-2.0, BSD-2-Clause-Views, + 2 more Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	TCP_MAPPING_BASE_KEY string = "/v1/tcp_routes/router_groups"
	HTTP_ROUTE_BASE_KEY  string = "/routes"
)
View Source
const (
	KeyNotFound = "KeyNotFound"
)

Variables

This section is empty.

Functions

func NewETCD

func NewETCD(nodeURLs []string, maxWorkers uint) (*etcd, error)

Types

type DB

type DB interface {
	ReadRoutes() ([]Route, error)
	SaveRoute(route Route) error
	DeleteRoute(route Route) error

	ReadTcpRouteMappings() ([]TcpRouteMapping, error)
	SaveTcpRouteMapping(tcpMapping TcpRouteMapping) error
	DeleteTcpRouteMapping(tcpMapping TcpRouteMapping) error

	Connect() error
	Disconnect() error
	WatchRouteChanges(filter string) (<-chan storeadapter.WatchEvent, chan<- bool, <-chan error)
}

type DBError

type DBError struct {
	Type    string
	Message string
}

func (DBError) Error

func (err DBError) Error() string

type Route

type Route struct {
	Route           string `json:"route"`
	Port            uint16 `json:"port"`
	IP              string `json:"ip"`
	TTL             int    `json:"ttl"`
	LogGuid         string `json:"log_guid"`
	RouteServiceUrl string `json:"route_service_url,omitempty"`
}

type RouterGroup

type RouterGroup struct {
	Guid string          `json:"guid"`
	Name string          `json:"name"`
	Type RouterGroupType `json:"type"`
}

type RouterGroupType

type RouterGroupType string

type TcpRoute

type TcpRoute struct {
	RouterGroupGuid string `json:"router_group_guid"`
	ExternalPort    uint16 `json:"port"`
}

type TcpRouteMapping

type TcpRouteMapping struct {
	TcpRoute
	HostPort uint16 `json:"backend_port"`
	HostIP   string `json:"backend_ip"`
}

func NewTcpRouteMapping

func NewTcpRouteMapping(routerGroupGuid string, externalPort uint16, hostIP string, hostPort uint16) TcpRouteMapping

func (TcpRouteMapping) String

func (m TcpRouteMapping) String() string

Directories

Path Synopsis
This file was generated by counterfeiter
This file was generated by counterfeiter

Jump to

Keyboard shortcuts

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