router

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: Nov 5, 2014 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ProtocolHttp  = "http"
	ProtocolHttps = "https"
	ProtocolTls   = "tls"
)
View Source
const (
	TERM_EDGE  = "TERM_EDGE"
	TERM_GEAR  = "TERM_GEAR"
	TERM_RESSL = "TERM_RESSL"
)
View Source
const (
	RouteFile = "/var/lib/containers/router/routes.json"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend struct {
	ID           string
	FePath       string
	BePath       string
	Protocols    []string
	EndpointIDs  []string
	SslTerm      string
	Certificates []Certificate
}

type Certificate

type Certificate struct {
	ID                 string
	Contents           []byte
	PrivateKey         []byte
	PrivateKeyPassword string
}

type Endpoint

type Endpoint struct {
	ID   string
	IP   string
	Port string
}

type Frontend

type Frontend struct {
	Name          string
	HostAliases   []string
	Backends      map[string]Backend
	EndpointTable map[string]Endpoint
}

type Router

type Router interface {
	ReadRoutes()
	WriteRoutes()
	FindFrontend(name string) (v Frontend, ok bool)
	DeleteBackends(name string)
	CreateFrontend(name string, url string)
	DeleteFrontend(frontendname string)
	AddAlias(alias string, frontendname string)
	AddRoute(frontendname string, fePath string, bePath string, protocols []string, endpoints []Endpoint)
	WriteConfig()
	ReloadRouter() bool
}

type Routes

type Routes struct {
	GlobalRoutes map[string]Frontend
}

func (*Routes) AddAlias

func (routes *Routes) AddAlias(alias string, frontendname string)

func (*Routes) AddRoute

func (routes *Routes) AddRoute(frontendname string, fePath string, bePath string, protocols []string, endpoints []Endpoint)

func (*Routes) CreateFrontend

func (routes *Routes) CreateFrontend(name string, url string)

func (*Routes) DeleteBackends

func (routes *Routes) DeleteBackends(name string)

func (*Routes) DeleteFrontend

func (routes *Routes) DeleteFrontend(frontendname string)

func (*Routes) FindFrontend

func (routes *Routes) FindFrontend(name string) (v Frontend, ok bool)

func (*Routes) ReadRoutes

func (routes *Routes) ReadRoutes()

func (*Routes) WriteRoutes

func (routes *Routes) WriteRoutes()

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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