Documentation ¶
Index ¶
Constants ¶
View Source
const ( DockerConfigHost = "unix:///var/run/docker.sock" DockerAPIVersion = "1.24" DockerRouterLabelHost = "mc-router.host" DockerRouterLabelPort = "mc-router.port" DockerRouterLabelDefault = "mc-router.default" DockerRouterLabelNetwork = "mc-router.network" )
View Source
const ( AnnotationExternalServerName = "mc-router.itzg.me/externalServerName" AnnotationDefaultServer = "mc-router.itzg.me/defaultServer" )
Variables ¶
View Source
var Routes = NewRoutes()
View Source
var RoutesConfig = &routesConfigImpl{}
Functions ¶
func StartApiServer ¶
func StartApiServer(apiBinding string)
Types ¶
type Connector ¶
type Connector struct {
// contains filtered or unexported fields
}
func NewConnector ¶
func NewConnector(metrics *ConnectorMetrics, sendProxyProto bool) *Connector
func (*Connector) HandleConnection ¶
func (*Connector) StartAcceptingConnections ¶
func (*Connector) WaitForConnections ¶
func (c *Connector) WaitForConnections()
type ConnectorMetrics ¶
type IDockerWatcher ¶
type IDockerWatcher interface { StartInSwarm(timeoutSeconds int, refreshIntervalSeconds int) error Stop() }
var DockerWatcher IDockerWatcher = &dockerWatcherImpl{}
type IK8sWatcher ¶
type IK8sWatcher interface { StartWithConfig(kubeConfigFile string, autoScaleUp bool) error StartInCluster(autoScaleUp bool) error Stop() }
var K8sWatcher IK8sWatcher = &k8sWatcherImpl{}
type IRoutes ¶
type IRoutes interface { Reset() RegisterAll(mappings map[string]string) // FindBackendForServerAddress returns the host:port for the external server address, if registered. // Otherwise, an empty string is returned. Also returns the normalized version of the given serverAddress. // The 3rd value returned is an (optional) "waker" function which a caller must invoke to wake up serverAddress. FindBackendForServerAddress(ctx context.Context, serverAddress string) (string, string, func(ctx context.Context) error) GetMappings() map[string]string DeleteMapping(serverAddress string) bool CreateMapping(serverAddress string, backend string, waker func(ctx context.Context) error) SetDefaultRoute(backend string) SimplifySRV(srvEnabled bool) }
Click to show internal directories.
Click to hide internal directories.