Documentation ¶
Index ¶
- Constants
- func Base64Encode(data []byte, max int) string
- func Create(controller controller.Interface) (reconcile.Interface, error)
- func CreateSecrets(controller controller.Interface) (reconcile.Interface, error)
- func DefaultLinkName(ip net.IP) string
- func NewTunnelConnection(mux *Mux, conn net.Conn, link *kubelink.Link, ...) (*TunnelConnection, *ConnectionHello, error)
- func RegisterExtension(id byte, c ConnectionHelloExtensionHandler)
- func SetLinkAddress(logger logger.LogContext, link netlink.Link, addr *net.IPNet) error
- func TaskReconciler(count int) controller.ConfigurationModifier
- type APIExtension
- type APIExtensionHandler
- type BaseTask
- type CertInfo
- type Config
- type ConnectionFailHandler
- type ConnectionHandler
- type ConnectionHello
- type ConnectionHelloExtension
- type ConnectionHelloExtensionHandler
- type ConnectionHelloHeader
- func (this *ConnectionHelloHeader) GetCIDR() *net.IPNet
- func (this *ConnectionHelloHeader) GetClusterAddress() net.IP
- func (this *ConnectionHelloHeader) GetClusterCIDR() *net.IPNet
- func (this *ConnectionHelloHeader) GetExtensionLength() uint16
- func (this *ConnectionHelloHeader) GetPort() uint16
- func (this *ConnectionHelloHeader) SetCIDR(cidr *net.IPNet)
- func (this *ConnectionHelloHeader) SetClusterAddress(ip net.IP)
- func (this *ConnectionHelloHeader) SetClusterCIDR(cidr *net.IPNet)
- func (this *ConnectionHelloHeader) SetExtensionLength(len uint16)
- func (this *ConnectionHelloHeader) SetPort(port uint16)
- type DNSExtension
- type DNSExtensionHandler
- type DefaultConnectionHandler
- type Kubeconfig
- type LinkStateHandler
- type Manifest
- type Mux
- func (this *Mux) AddTunnel(t *TunnelConnection)
- func (this *Mux) AssureTunnel(logger logger.LogContext, link *kubelink.Link) (*TunnelConnection, error)
- func (this *Mux) Close(ip net.IP) error
- func (this *Mux) FindConnection(log logger.LogContext, packet []byte) *TunnelConnection
- func (this *Mux) GetConnectionForIP(ip net.IP) (*TunnelConnection, error)
- func (this *Mux) GetError(ip net.IP) error
- func (this *Mux) HandleTun() error
- func (this *Mux) Notify(t *TunnelConnection, err error)
- func (this *Mux) QueryConnectionForIP(ip net.IP) (*TunnelConnection, *kubelink.Link)
- func (this *Mux) RegisterFailHandler(handlers ...LinkStateHandler)
- func (this *Mux) RemoveTunnel(t *TunnelConnection)
- func (this *Mux) ServeConnection(ctx context.Context, conn net.Conn)
- func (this *Mux) SetAutoConnect(b bool)
- type SecretCache
- func (this *SecretCache) AllocSecret(name resources.ObjectName, link resources.ObjectName)
- func (this *SecretCache) GetSecretUsers(name resources.ObjectName) resources.ObjectNameSet
- func (this *SecretCache) ReleaseSecret(name resources.ObjectName, link resources.ObjectName)
- func (this *SecretCache) ReleaseSecretForLink(link resources.ObjectName)
- func (this *SecretCache) UpdateSecret(name resources.ObjectName, link resources.ObjectName)
- type Server
- type Task
- type Tasks
- type Tun
- type TunnelConnection
- func (this *TunnelConnection) Close() error
- func (this *TunnelConnection) ReadPacket(data []byte) (int, byte, error)
- func (this *TunnelConnection) RegisterStateHandler(handlers ...ConnectionFailHandler)
- func (this *TunnelConnection) Serve() error
- func (this *TunnelConnection) String() string
- func (this *TunnelConnection) WritePacket(ty byte, data []byte) error
Constants ¶
View Source
const BufferSize = 17000
View Source
const CLUSTER_DNS_IP = 10
View Source
const CMD_TASK_PREFIX = "task:"
View Source
const DNSMODE_DNS = "dns"
View Source
const DNSMODE_KUBERNETES = "kubernetes"
View Source
const DNSMODE_NONE = "none"
View Source
const EXT_APIACCESS = 1
View Source
const EXT_DNS = 2
View Source
const IPCHAIN = "POSTROUTING"
View Source
const IPTAB = "nat"
View Source
const KUBELINK_DNS_IP = 11
View Source
const MANAGE_MODE_CERT = "cert"
View Source
const MANAGE_MODE_NONE = "none"
View Source
const MANAGE_MODE_SELF = "self"
View Source
const PACKET_TYPE_DATA = 0
View Source
const PACKET_TYPE_HELLO = 1
Variables ¶
This section is empty.
Functions ¶
func Base64Encode ¶
func CreateSecrets ¶
func CreateSecrets(controller controller.Interface) (reconcile.Interface, error)
func DefaultLinkName ¶
func NewTunnelConnection ¶
func NewTunnelConnection(mux *Mux, conn net.Conn, link *kubelink.Link, handlers ...ConnectionFailHandler) (*TunnelConnection, *ConnectionHello, error)
func RegisterExtension ¶
func RegisterExtension(id byte, c ConnectionHelloExtensionHandler)
func SetLinkAddress ¶
func TaskReconciler ¶
func TaskReconciler(count int) controller.ConfigurationModifier
Types ¶
type APIExtension ¶
type APIExtension kubelink.LinkAccessInfo
func (*APIExtension) Data ¶
func (this *APIExtension) Data() []byte
func (*APIExtension) Id ¶
func (this *APIExtension) Id() byte
func (*APIExtension) String ¶
func (this *APIExtension) String() string
type APIExtensionHandler ¶
type APIExtensionHandler struct{}
func (*APIExtensionHandler) Add ¶
func (this *APIExtensionHandler) Add(hello *ConnectionHello, mux *Mux)
func (*APIExtensionHandler) Parse ¶
func (this *APIExtensionHandler) Parse(id byte, data []byte) (ConnectionHelloExtension, error)
type BaseTask ¶
type BaseTask struct {
// contains filtered or unexported fields
}
func NewBaseTask ¶
type CertInfo ¶
type CertInfo struct { certs.CertificateSource // contains filtered or unexported fields }
func NewCertInfo ¶
func NewCertInfo(logger logger.LogContext, source certs.CertificateSource) *CertInfo
func (*CertInfo) ClientConfig ¶
func (*CertInfo) ServerConfig ¶
type Config ¶
type Config struct { controllers.Config ClusterAddress *net.IPNet ClusterCIDR *net.IPNet ClusterName string ServiceCIDR *net.IPNet Responsible utils.StringSet Port int AdvertisedPort int CertFile string KeyFile string CACertFile string Secret string ManageMode string DNSName string Service string Interface string MeshDomain string ServiceAccount resources.ObjectName DNSAdvertisement bool DNSPropagation string CoreDNSServiceIP net.IP CoreDNSDeployment string CoreDNSSecret string CoreDNSConfigure bool DNSServiceIP net.IP ClusterDomain string AutoConnect bool DisableBridge bool // contains filtered or unexported fields }
func (*Config) AddOptionsToSet ¶
type ConnectionFailHandler ¶
type ConnectionFailHandler interface {
Notify(*TunnelConnection, error)
}
type ConnectionHandler ¶
type ConnectionHandler interface { UpdateAccess(hello *ConnectionHello) GetAccess() kubelink.LinkAccessInfo GetDNSInfo() kubelink.LinkDNSInfo }
type ConnectionHello ¶
type ConnectionHello struct { ConnectionHelloHeader Extensions map[byte]ConnectionHelloExtension Raw map[byte][]byte }
func NewConnectionHello ¶
func NewConnectionHello() *ConnectionHello
func ParseConnectionHello ¶
func ParseConnectionHello(logger logger.LogContext, header *ConnectionHelloHeader, data []byte) (*ConnectionHello, error)
func (*ConnectionHello) Data ¶
func (this *ConnectionHello) Data() []byte
type ConnectionHelloExtension ¶
func GetExtension ¶
func GetExtension(id byte, data []byte) (ConnectionHelloExtension, error)
type ConnectionHelloExtensionHandler ¶
type ConnectionHelloExtensionHandler interface { Parse(id byte, data []byte) (ConnectionHelloExtension, error) Add(hello *ConnectionHello, mux *Mux) }
type ConnectionHelloHeader ¶
func (*ConnectionHelloHeader) GetCIDR ¶
func (this *ConnectionHelloHeader) GetCIDR() *net.IPNet
func (*ConnectionHelloHeader) GetClusterAddress ¶
func (this *ConnectionHelloHeader) GetClusterAddress() net.IP
func (*ConnectionHelloHeader) GetClusterCIDR ¶
func (this *ConnectionHelloHeader) GetClusterCIDR() *net.IPNet
func (*ConnectionHelloHeader) GetExtensionLength ¶
func (this *ConnectionHelloHeader) GetExtensionLength() uint16
func (*ConnectionHelloHeader) GetPort ¶
func (this *ConnectionHelloHeader) GetPort() uint16
func (*ConnectionHelloHeader) SetCIDR ¶
func (this *ConnectionHelloHeader) SetCIDR(cidr *net.IPNet)
func (*ConnectionHelloHeader) SetClusterAddress ¶
func (this *ConnectionHelloHeader) SetClusterAddress(ip net.IP)
func (*ConnectionHelloHeader) SetClusterCIDR ¶
func (this *ConnectionHelloHeader) SetClusterCIDR(cidr *net.IPNet)
func (*ConnectionHelloHeader) SetExtensionLength ¶
func (this *ConnectionHelloHeader) SetExtensionLength(len uint16)
func (*ConnectionHelloHeader) SetPort ¶
func (this *ConnectionHelloHeader) SetPort(port uint16)
type DNSExtension ¶
type DNSExtension kubelink.LinkDNSInfo
func (*DNSExtension) Data ¶
func (this *DNSExtension) Data() []byte
func (*DNSExtension) Id ¶
func (this *DNSExtension) Id() byte
func (*DNSExtension) String ¶
func (this *DNSExtension) String() string
type DNSExtensionHandler ¶
type DNSExtensionHandler struct{}
func (*DNSExtensionHandler) Add ¶
func (this *DNSExtensionHandler) Add(hello *ConnectionHello, mux *Mux)
func (*DNSExtensionHandler) Parse ¶
func (this *DNSExtensionHandler) Parse(id byte, data []byte) (ConnectionHelloExtension, error)
type DefaultConnectionHandler ¶
type DefaultConnectionHandler struct {
// contains filtered or unexported fields
}
func (*DefaultConnectionHandler) GetAccess ¶
func (this *DefaultConnectionHandler) GetAccess() kubelink.LinkAccessInfo
func (*DefaultConnectionHandler) GetDNSInfo ¶
func (this *DefaultConnectionHandler) GetDNSInfo() kubelink.LinkDNSInfo
func (*DefaultConnectionHandler) UpdateAccess ¶
func (this *DefaultConnectionHandler) UpdateAccess(hello *ConnectionHello)
type Kubeconfig ¶
type Kubeconfig Manifest
func NewKubeconfig ¶
func NewKubeconfig() Kubeconfig
func (Kubeconfig) AddCluster ¶
func (this Kubeconfig) AddCluster(name, url, ca, token string)
type LinkStateHandler ¶
type Mux ¶
type Mux struct { logger.LogContext // contains filtered or unexported fields }
func (*Mux) AddTunnel ¶
func (this *Mux) AddTunnel(t *TunnelConnection)
func (*Mux) AssureTunnel ¶
func (this *Mux) AssureTunnel(logger logger.LogContext, link *kubelink.Link) (*TunnelConnection, error)
func (*Mux) FindConnection ¶
func (this *Mux) FindConnection(log logger.LogContext, packet []byte) *TunnelConnection
func (*Mux) GetConnectionForIP ¶
func (this *Mux) GetConnectionForIP(ip net.IP) (*TunnelConnection, error)
func (*Mux) Notify ¶
func (this *Mux) Notify(t *TunnelConnection, err error)
func (*Mux) QueryConnectionForIP ¶
func (*Mux) RegisterFailHandler ¶
func (this *Mux) RegisterFailHandler(handlers ...LinkStateHandler)
func (*Mux) RemoveTunnel ¶
func (this *Mux) RemoveTunnel(t *TunnelConnection)
func (*Mux) SetAutoConnect ¶
type SecretCache ¶
type SecretCache struct {
// contains filtered or unexported fields
}
func GetSharedSecrets ¶
func GetSharedSecrets(controller controller.Interface) *SecretCache
func NewSecretCache ¶
func NewSecretCache() *SecretCache
func (*SecretCache) AllocSecret ¶
func (this *SecretCache) AllocSecret(name resources.ObjectName, link resources.ObjectName)
func (*SecretCache) GetSecretUsers ¶
func (this *SecretCache) GetSecretUsers(name resources.ObjectName) resources.ObjectNameSet
func (*SecretCache) ReleaseSecret ¶
func (this *SecretCache) ReleaseSecret(name resources.ObjectName, link resources.ObjectName)
func (*SecretCache) ReleaseSecretForLink ¶
func (this *SecretCache) ReleaseSecretForLink(link resources.ObjectName)
func (*SecretCache) UpdateSecret ¶
func (this *SecretCache) UpdateSecret(name resources.ObjectName, link resources.ObjectName)
type Server ¶
type Server struct { logger.LogContext // contains filtered or unexported fields }
type Task ¶
type Task interface { Id() string Execute(logger logger.LogContext) reconcile.Status }
func NewConnectTask ¶
type Tasks ¶
func GetTaskClient ¶
func GetTaskClient(controller controller.Interface) Tasks
type TunnelConnection ¶
type TunnelConnection struct { logger.LogContext // contains filtered or unexported fields }
func (*TunnelConnection) Close ¶
func (this *TunnelConnection) Close() error
func (*TunnelConnection) ReadPacket ¶
func (this *TunnelConnection) ReadPacket(data []byte) (int, byte, error)
func (*TunnelConnection) RegisterStateHandler ¶
func (this *TunnelConnection) RegisterStateHandler(handlers ...ConnectionFailHandler)
func (*TunnelConnection) Serve ¶
func (this *TunnelConnection) Serve() error
func (*TunnelConnection) String ¶
func (this *TunnelConnection) String() string
func (*TunnelConnection) WritePacket ¶
func (this *TunnelConnection) WritePacket(ty byte, data []byte) error
Click to show internal directories.
Click to hide internal directories.