qdr

package
v0.0.0-...-0c3390c Latest Latest
Warning

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

Go to latest
Published: Mar 7, 2021 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DistributionBalanced  Distribution = "balanced"
	DistributionMulticast              = "multicast"
	DistributionClosest                = "closest"
)

Variables

This section is empty.

Functions

func GetConnectedSites

func GetConnectedSites(dd driver.Driver) (types.TransportConnectedSites, error)

func GetRouterConfigForProxy

func GetRouterConfigForProxy(definition types.ServiceInterface, siteId string) (string, error)

func GetTransportMode

func GetTransportMode(qdr *dockertypes.ContainerJSON) types.TransportMode

func IsInterior

func IsInterior(qdr *dockertypes.ContainerJSON) bool

func MarshalRouterConfig

func MarshalRouterConfig(config RouterConfig) (string, error)

Types

type Address

type Address struct {
	Prefix       string `json:"prefix,omitempty"`
	Distribution string `json:"distribution,omitempty"`
}

type BridgeConfig

type BridgeConfig struct {
	TcpListeners   TcpEndpointMap
	TcpConnectors  TcpEndpointMap
	HttpListeners  HttpEndpointMap
	HttpConnectors HttpEndpointMap
}

func NewBridgeConfig

func NewBridgeConfig() BridgeConfig

func (*BridgeConfig) AddHttpConnector

func (bc *BridgeConfig) AddHttpConnector(e HttpEndpoint)

func (*BridgeConfig) AddHttpListener

func (bc *BridgeConfig) AddHttpListener(e HttpEndpoint)

func (*BridgeConfig) AddTcpConnector

func (bc *BridgeConfig) AddTcpConnector(e TcpEndpoint)

func (*BridgeConfig) AddTcpListener

func (bc *BridgeConfig) AddTcpListener(e TcpEndpoint)

type ConnectedSites

type ConnectedSites struct {
	Direct   int
	Indirect int
	Total    int
}

type Connection

type Connection struct {
	Container  string `json:"container"`
	OperStatus string `json:"operStatus"`
	Host       string `json:"host"`
	Role       string `json:"role"`
	Active     bool   `json:"active"`
	Dir        string `json:"dir"`
}

func GetConnections

func GetConnections(dd driver.Driver) ([]Connection, error)

func GetInterRouterOrEdgeConnection

func GetInterRouterOrEdgeConnection(host string, connections []Connection) *Connection

type Connector

type Connector struct {
	Name           string `json:"name,omitempty"`
	Role           Role   `json:"role,omitempty"`
	Host           string `json:"host"`
	Port           string `json:"port"`
	RouteContainer bool   `json:"routeContainer,omitempty"`
	Cost           int32  `json:"cost,omitempty"`
	VerifyHostname bool   `json:"verifyHostname,omitempty"`
	SslProfile     string `json:"sslProfile,omitempty"`
	LinkCapacity   int32  `json:"linkCapacity,omitempty"`
}

type Distribution

type Distribution string

type ExecResult

type ExecResult struct {
	ExitCode int
	// contains filtered or unexported fields
}

func Exec

func Exec(dd libdocker.Interface, id string, cmd []string) (ExecResult, error)

func (*ExecResult) Stderr

func (res *ExecResult) Stderr() string

func (*ExecResult) Stdout

func (res *ExecResult) Stdout() string

type HttpEndpoint

type HttpEndpoint struct {
	Name            string `json:"name,omitempty"`
	Host            string `json:"host,omitempty"`
	Port            string `json:"port,omitempty"`
	Address         string `json:"address,omitempty"`
	SiteId          string `json:"siteId,omitempty"`
	ProtocolVersion string `json:"protocolVersion,omitempty"`
	Aggregation     string `json:"aggregation,omitempty"`
	EventChannel    bool   `json:"eventChannel,omitempty"`
	HostOverride    string `json:"hostOverride,omitempty"`
}

type HttpEndpointMap

type HttpEndpointMap map[string]HttpEndpoint

type Listener

type Listener struct {
	Name             string `json:"name,omitempty"`
	Role             Role   `json:"role,omitempty"`
	Host             string `json:"host,omitempty"`
	Port             int32  `json:"port"`
	RouteContainer   bool   `json:"routeContainer,omitempty"`
	Http             bool   `json:"http,omitempty"`
	Cost             int32  `json:"cost,omitempty"`
	SslProfile       string `json:"sslProfile,omitempty"`
	SaslMechanisms   string `json:"saslMechanisms,omitempty"`
	AuthenticatePeer bool   `json:"authenticatePeer,omitempty"`
	LinkCapacity     int32  `json:"linkCapacity,omitempty"`
	HttpRootDir      string `json:"httpRootDir,omitempty"`
	Websockets       bool   `json:"websockets,omitempty"`
	Healthz          bool   `json:"healthz,omitempty"`
	Metrics          bool   `json:"metrics,omitempty"`
}

type Mode

type Mode string
const (
	ModeInterior Mode = "interior"
	ModeEdge          = "edge"
)

type Role

type Role string
const (
	RoleInterRouter Role = "inter-router"
	RoleEdge             = "edge"
)

type RouterConfig

type RouterConfig struct {
	Metadata    RouterMetadata
	SslProfiles map[string]SslProfile
	Listeners   map[string]Listener
	Connectors  map[string]Connector
	Addresses   map[string]Address
	Bridges     BridgeConfig
}

func GetRouterConfigFromFile

func GetRouterConfigFromFile(name string) (*RouterConfig, error)

func InitialConfig

func InitialConfig(id string, metadata string, edge bool) RouterConfig

func UnmarshalRouterConfig

func UnmarshalRouterConfig(config string) (RouterConfig, error)

func (*RouterConfig) AddAddress

func (r *RouterConfig) AddAddress(a Address)

func (*RouterConfig) AddConnSslProfile

func (r *RouterConfig) AddConnSslProfile(s SslProfile)

func (*RouterConfig) AddConnector

func (r *RouterConfig) AddConnector(c Connector)

func (*RouterConfig) AddHttpConnector

func (r *RouterConfig) AddHttpConnector(e HttpEndpoint)

func (*RouterConfig) AddHttpListener

func (r *RouterConfig) AddHttpListener(e HttpEndpoint)

func (*RouterConfig) AddListener

func (r *RouterConfig) AddListener(l Listener)

func (*RouterConfig) AddSslProfile

func (r *RouterConfig) AddSslProfile(s SslProfile)

func (*RouterConfig) AddTcpConnector

func (r *RouterConfig) AddTcpConnector(e TcpEndpoint)

func (*RouterConfig) AddTcpListener

func (r *RouterConfig) AddTcpListener(e TcpEndpoint)

func (*RouterConfig) IsEdge

func (r *RouterConfig) IsEdge() bool

func (*RouterConfig) RemoveConnSslProfile

func (r *RouterConfig) RemoveConnSslProfile(name string) bool

func (*RouterConfig) RemoveConnector

func (r *RouterConfig) RemoveConnector(name string) bool

func (*RouterConfig) UpdateBridgeConfig

func (r *RouterConfig) UpdateBridgeConfig(desired BridgeConfig) bool

func (*RouterConfig) WriteToConfigFile

func (r *RouterConfig) WriteToConfigFile(configFile string) error

type RouterMetadata

type RouterMetadata struct {
	Id       string `json:"id,omitempty"`
	Mode     Mode   `json:"mode,omitempty"`
	Metadata string `json:"metadata,omitempty"`
}

type RouterNode

type RouterNode struct {
	Id      string `json:"id"`
	Name    string `json:"name"`
	NextHop string `json:"nextHop"`
}

func GetNodes

func GetNodes(dd driver.Driver) ([]RouterNode, error)

type SslProfile

type SslProfile struct {
	Name           string `json:"name,omitempty"`
	CertFile       string `json:"certFile,omitempty"`
	PrivateKeyFile string `json:"privateKeyFile,omitempty"`
	CaCertFile     string `json:"caCertFile,omitempty"`
}

type TcpEndpoint

type TcpEndpoint struct {
	Name    string `json:"name,omitempty"`
	Host    string `json:"host,omitempty"`
	Port    string `json:"port,omitempty"`
	Address string `json:"address,omitempty"`
	SiteId  string `json:"siteId,omitempty"`
}

type TcpEndpointMap

type TcpEndpointMap map[string]TcpEndpoint

Jump to

Keyboard shortcuts

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