Documentation ¶
Index ¶
- Constants
- func Command() *cobra.Command
- func WithNewServiceFunc(ctx context.Context, f NewServiceFunc) context.Context
- func WithNewSessionFunc(ctx context.Context, f NewSessionFunc) context.Context
- type NewServiceFunc
- type NewSessionFunc
- type Service
- func (s *Service) As(ptr any)
- func (s *Service) Connect(ctx context.Context, info *rpc.OutboundInfo) (*rpc.DaemonStatus, error)
- func (s *Service) Disconnect(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)
- func (s *Service) GetNetworkConfig(ctx context.Context, e *empty.Empty) (nc *rpc.NetworkConfig, err error)
- func (s *Service) Quit(ctx context.Context, _ *empty.Empty) (*empty.Empty, error)
- func (s *Service) SetDnsSearchPath(ctx context.Context, paths *rpc.Paths) (*empty.Empty, error)
- func (s *Service) SetLogLevel(ctx context.Context, request *manager.LogLevelRequest) (*empty.Empty, error)
- func (s *Service) Status(_ context.Context, _ *empty.Empty) (*rpc.DaemonStatus, error)
- func (s *Service) Version(_ context.Context, _ *empty.Empty) (*common.VersionInfo, error)
- func (s *Service) WaitForNetwork(ctx context.Context, e *empty.Empty) (*empty.Empty, error)
- func (s *Service) WithSession(f func(context.Context, *Session) error) error
- type Session
Constants ¶
const (
ProcessName = "daemon"
)
Variables ¶
This section is empty.
Functions ¶
func WithNewServiceFunc ¶ added in v2.9.0
func WithNewServiceFunc(ctx context.Context, f NewServiceFunc) context.Context
func WithNewSessionFunc ¶ added in v2.9.0
func WithNewSessionFunc(ctx context.Context, f NewSessionFunc) context.Context
Types ¶
type NewServiceFunc ¶ added in v2.9.0
func GetNewServiceFunc ¶ added in v2.9.0
func GetNewServiceFunc(ctx context.Context) NewServiceFunc
type NewSessionFunc ¶ added in v2.9.0
func GetNewSessionFunc ¶ added in v2.9.0
func GetNewSessionFunc(ctx context.Context) NewSessionFunc
type Service ¶ added in v2.9.0
type Service struct { rpc.UnsafeDaemonServer // contains filtered or unexported fields }
Service represents the state of the Telepresence Daemon.
func (*Service) Connect ¶ added in v2.9.0
func (s *Service) Connect(ctx context.Context, info *rpc.OutboundInfo) (*rpc.DaemonStatus, error)
func (*Service) Disconnect ¶ added in v2.9.0
func (*Service) GetNetworkConfig ¶ added in v2.9.0
func (*Service) SetDnsSearchPath ¶ added in v2.9.0
func (*Service) SetLogLevel ¶ added in v2.9.0
func (*Service) WaitForNetwork ¶ added in v2.9.0
type Session ¶ added in v2.9.0
type Session struct {
// contains filtered or unexported fields
}
Session resolves DNS names and routes outbound traffic that is centered around a TUN device. The router is similar to a TUN-to-SOCKS5 but uses a bidirectional gRPC muxTunnel instead of SOCKS when communicating with the traffic-manager. The addresses of the device are derived from IP addresses sent to it from the user daemon (which in turn receives them from the cluster).
Data sent to the device is received as L3 IP-packets and parsed into L4 UDP and TCP before they are dispatched over the muxTunnel. Returned payloads are wrapped as IP-packets before written back to the device. This L3 <=> L4 conversation is made using gvisor.dev/gvisor/pkg/tcpip.
Connection pooling:
For UDP and TCP packets, a ConnID is created which uniquely identifies a combination of protocol, source IP, source port, destination IP, and destination port. A handler is then obtained that matches that ID (active handlers are cached in a tunnel.Pool) and the packet is then sent to that handler. The handler typically sends the ConnID and the payload of the packet over to the traffic-manager using the gRPC ClientTunnel. At the receiving en din the traffic-manager, a similar tunnel.Pool obtains a corresponding handler which manages a net.Conn matching the ConnID in the cluster.
A zero Session is invalid; you must use newSession.
func NewSession ¶ added in v2.9.0
NewSession returns a new properly initialized session object.