backend

package
v0.0.0-...-93d971c Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2017 License: Apache-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

View Source
const (
	RobinFrontendRecordsAnnotationKey = "pulcy.com.robin.frontend.records"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Backend

type Backend interface {
	api.API

	// Watch for changes in the backend and return where there is a change.
	Watch() error

	// Load all registered services
	Services() (ServiceRegistrations, error)
}

func NewEtcdBackend

func NewEtcdBackend(config BackendConfig, logger *logging.Logger, c client.Client, etcdPath string) (Backend, error)

func NewKubernetesBackend

func NewKubernetesBackend(config BackendConfig, logger *logging.Logger) (Backend, error)

type BackendConfig

type BackendConfig struct {
	PublicEdgePort      int
	PrivateHttpEdgePort int
	PrivateTcpEdgePort  int
}

type RewriteRule

type RewriteRule struct {
	PathPrefix       string // Add this to the start of the request path.
	RemovePathPrefix string // Remove this from the start of the request path.
	Domain           string // Redirect to this domain
}

type ServiceInstance

type ServiceInstance struct {
	IP   string // IP address to connect to to reach the service instance
	Port int    // Port to connect to to reach the service instance
}

func (ServiceInstance) FullString

func (si ServiceInstance) FullString() string

type ServiceInstances

type ServiceInstances []ServiceInstance

func (ServiceInstances) FullString

func (list ServiceInstances) FullString() string

func (ServiceInstances) Len

func (list ServiceInstances) Len() int

Len is the number of elements in the collection.

func (ServiceInstances) Less

func (list ServiceInstances) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (ServiceInstances) Sort

func (list ServiceInstances) Sort()

func (ServiceInstances) Swap

func (list ServiceInstances) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type ServiceRegistration

type ServiceRegistration struct {
	ServiceName     string           // Name of the service
	ServicePort     int              // Port the service is listening on (inside its container)
	EdgePort        int              // Port that Robin listening on for the service.
	Public          bool             // If true, this service is exposed to the public network, otherwise it is only exposed to the private network.
	Instances       ServiceInstances // List instances of the service (can not be empty)
	Selectors       ServiceSelectors // List of selectors to match traffic to this service
	HttpCheckPath   string           // Path (on the service) used for health checks (can be empty)
	HttpCheckMethod string           // Method (on the service) used for health checks (can be empty)
	Mode            string           // http|tcp
	Sticky          bool             // Switched blancing mode to source
	Backup          bool             // If set all instances are backup only servers for their selectors
}

func (ServiceRegistration) FullString

func (sr ServiceRegistration) FullString() string

func (*ServiceRegistration) HasAllowUnauthorized

func (sr *ServiceRegistration) HasAllowUnauthorized() bool

func (ServiceRegistration) IsHttp

func (sr ServiceRegistration) IsHttp() bool

func (ServiceRegistration) IsTcp

func (sr ServiceRegistration) IsTcp() bool

func (ServiceRegistration) Normalize

type ServiceRegistrations

type ServiceRegistrations []ServiceRegistration

func (ServiceRegistrations) Contains

func (list ServiceRegistrations) Contains(sr ServiceRegistration) bool

func (ServiceRegistrations) FullString

func (list ServiceRegistrations) FullString() string

func (ServiceRegistrations) Len

func (list ServiceRegistrations) Len() int

Len is the number of elements in the collection.

func (ServiceRegistrations) Less

func (list ServiceRegistrations) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (ServiceRegistrations) Sort

func (list ServiceRegistrations) Sort()

func (ServiceRegistrations) Swap

func (list ServiceRegistrations) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type ServiceSelector

type ServiceSelector struct {
	Weight            int    // How important is this selector. (0-100), 100 being most important
	Domain            string // Domain to match on
	SslCertName       string // SSL certificate filename
	TmpSslCertPath    string // Path of generated certificate file
	PathPrefix        string // Prefix of HTTP path to match on
	Users             Users  // If set, require authentication for one of these users
	AllowUnauthorized bool   // If set, allow all for this path
	AllowInsecure     bool   // If set, allow insecure access to this path
	RewriteRules      []RewriteRule
}

func (ServiceSelector) FullString

func (fs ServiceSelector) FullString() string

func (ServiceSelector) IsSecure

func (ss ServiceSelector) IsSecure() bool

type ServiceSelectors

type ServiceSelectors []ServiceSelector

func (ServiceSelectors) Contains

func (list ServiceSelectors) Contains(sel ServiceSelector) bool

func (ServiceSelectors) FullString

func (list ServiceSelectors) FullString() string

func (ServiceSelectors) Len

func (list ServiceSelectors) Len() int

Len is the number of elements in the collection.

func (ServiceSelectors) Less

func (list ServiceSelectors) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (ServiceSelectors) Sort

func (list ServiceSelectors) Sort()

func (ServiceSelectors) Swap

func (list ServiceSelectors) Swap(i, j int)

Swap swaps the elements with indexes i and j.

type User

type User struct {
	Name         string
	PasswordHash string
}

func (User) FullString

func (user User) FullString() string

type Users

type Users []User

func (Users) Len

func (list Users) Len() int

Len is the number of elements in the collection.

func (Users) Less

func (list Users) Less(i, j int) bool

Less reports whether the element with index i should sort before the element with index j.

func (Users) Swap

func (list Users) Swap(i, j int)

Swap swaps the elements with indexes i and j.

Jump to

Keyboard shortcuts

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