Documentation
¶
Index ¶
- func IsBackgroundFork() bool
- func IsValid(filename string) error
- func NewAgentCommand(bf *client.BaseFlags) *cobra.Command
- func NewCshPrintCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
- func NewListAgentCommand(flags *AgentCommandFlags) *cobra.Command
- func NewPrintCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
- func NewRunAgentCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
- func RunAgentCommand(command *cobra.Command, flags *AgentCommandFlags, args []string) error
- type AgentCommandFlags
- type SSH
- type Tunnel
- func (r *Tunnel) CanConnect(proxy *url.URL, id, host string, port uint16, cookie *http.Cookie) error
- func (r *Tunnel) NewTunnelOptions(id string, cookie *http.Cookie) []ptunnel.GetModifier
- func (r *Tunnel) OpenAndListen(ctx context.Context, proxy *url.URL, id, host string, port uint16, ...) error
- func (r *Tunnel) Run(cmd *cobra.Command, args []string) (err error)
- func (r *Tunnel) RunBackground(listener knetwork.FileListener) error
- func (r *Tunnel) RunListener(ctx context.Context, listener net.Listener, proxy *url.URL, host string, ...) error
- func (r *Tunnel) RunTunnel(proxy *url.URL, id, host string, port uint16, cookie *http.Cookie, ...) error
- func (r *Tunnel) Username() string
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsBackgroundFork ¶
func IsBackgroundFork() bool
IsBackgroundFork returns true if this code is running in the background fork of enkit.
func NewCshPrintCommand ¶
func NewCshPrintCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
func NewListAgentCommand ¶
func NewListAgentCommand(flags *AgentCommandFlags) *cobra.Command
func NewPrintCommand ¶
func NewPrintCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
func NewRunAgentCommand ¶
func NewRunAgentCommand(parent *cobra.Command, flags *AgentCommandFlags) *cobra.Command
func RunAgentCommand ¶
func RunAgentCommand(command *cobra.Command, flags *AgentCommandFlags, args []string) error
Types ¶
type AgentCommandFlags ¶
type AgentCommandFlags struct { Base *client.BaseFlags Agent *kcerts.SSHAgentFlags }
type SSH ¶
type Tunnel ¶
type Tunnel struct { *cobra.Command *client.BaseFlags Proxy string BufferSize int TunnelFlags *ptunnel.Flags Listen string Background bool CheckAccess bool }
func (*Tunnel) CanConnect ¶
func (*Tunnel) NewTunnelOptions ¶
func (*Tunnel) OpenAndListen ¶
func (r *Tunnel) OpenAndListen(ctx context.Context, proxy *url.URL, id, host string, port uint16, cookie *http.Cookie, network string, localAddr string) error
OpenAndListen will start listening with whatever mechanism has been configured via flags.
If background is disabled, it will simply open a listening socket, and wait for connections.
If background is enabled, it will: 0) Check if OpenAndListen is being called as a result of the fork()/exec() in step 2) below.
If it is, re-use the already opened file descriptor, and finally start listening. If it is not...
- Open a listening socket - which guarantees that when the parent process exits, the port is open.
- Fork and exec enkit again - with exactly the same flags and parameters, passing the listening socket as file descriptor number 3 (this is part of the ExtraFiles API in cmd.Exec). This hopefully will get us back in this function. A simple fork() would have been significantly simpler, but the behavior with threads is undefined and evil.
func (*Tunnel) RunBackground ¶
func (r *Tunnel) RunBackground(listener knetwork.FileListener) error
func (*Tunnel) RunListener ¶
Click to show internal directories.
Click to hide internal directories.