internal

package
v0.22.0 Latest Latest
Warning

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

Go to latest
Published: Jan 14, 2026 License: Apache-2.0 Imports: 32 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AdminServer

type AdminServer struct {
	Session    *api.GetSessionResponse
	ClientRepo *ClientRepo

	sync.Mutex
	// contains filtered or unexported fields
}

func (*AdminServer) Serve

func (s *AdminServer) Serve(ctx context.Context, sock string) error

func (*AdminServer) Shutdown

func (s *AdminServer) Shutdown(ctx context.Context) error

type ClientRepo

type ClientRepo struct {
	// contains filtered or unexported fields
}

func NewClientRepo

func NewClientRepo() *ClientRepo

func (*ClientRepo) Add

func (c *ClientRepo) Add(client *api.Client) error

func (*ClientRepo) Clients

func (c *ClientRepo) Clients() []*api.Client

func (*ClientRepo) Delete

func (c *ClientRepo) Delete(clientId string)

func (*ClientRepo) Get

func (c *ClientRepo) Get(clientId string) *api.Client

type PTY added in v0.18.0

type PTY interface {
	io.ReadWriteCloser

	// Setsize changes the terminal dimensions.
	// On Unix, this sends a SIGWINCH to the slave process.
	// On Windows, this resizes the ConPTY buffer.
	Setsize(h, w int) error

	// Wait waits for the process associated with this PTY to exit.
	// On Unix, this delegates to exec.Cmd.Wait().
	// On Windows, this waits on the process handle.
	Wait() error

	// Kill terminates the process associated with this PTY.
	// On Unix, this delegates to exec.Cmd.Process.Kill().
	// On Windows, this calls TerminateProcess on the handle.
	Kill() error
}

PTY represents a pseudo-terminal abstraction that works across platforms. On Unix, it wraps a traditional PTY created via creack/pty. On Windows, it wraps a ConPTY (Console Pseudo Terminal).

The interface provides a common abstraction for:

  • Reading/writing terminal I/O (via io.ReadWriteCloser)
  • Resizing the terminal window
  • Managing process lifecycle (Wait/Kill)

Platform-specific implementations:

  • Unix: see pty_unix.go
  • Windows: see pty_windows.go

type PermissionDeniedError

type PermissionDeniedError struct {
	// contains filtered or unexported fields
}

func (*PermissionDeniedError) Error

func (e *PermissionDeniedError) Error() string

func (*PermissionDeniedError) Unwrap

func (e *PermissionDeniedError) Unwrap() error

type ReverseTunnel

type ReverseTunnel struct {
	*ssh.Client

	Host              *url.URL
	Signers           []ssh.Signer
	AuthorizedKeys    []ssh.PublicKey
	KeepAliveDuration time.Duration
	HostKeyCallback   ssh.HostKeyCallback
	Logger            *slog.Logger
	// contains filtered or unexported fields
}

func (*ReverseTunnel) Close

func (c *ReverseTunnel) Close()

func (*ReverseTunnel) Establish

func (*ReverseTunnel) Listener

func (c *ReverseTunnel) Listener() net.Listener

type SFTPSession added in v0.22.0

type SFTPSession struct {
	// contains filtered or unexported fields
}

SFTPSession tracks permission state for a single SFTP session

type Server

type Server struct {
	Command           []string
	CommandEnv        []string
	ForceCommand      []string
	Signers           []ssh.Signer
	AuthorizedKeys    []ssh.PublicKey
	EventEmitter      *emitter.Emitter
	KeepAliveDuration time.Duration
	Stdin             *os.File
	Stdout            *os.File
	Logger            *slog.Logger
	ReadOnly          bool
	// ForceForwardingInputForTesting forces stdin forwarding even when stdin is not a TTY.
	// This is used in tests where stdin is a pipe but we still want to forward test data.
	ForceForwardingInputForTesting bool

	// SFTP configuration
	SFTPDisabled          bool                   // Disable SFTP subsystem entirely
	SFTPPermissionChecker sftp.PermissionChecker // Optional: prompts user for SFTP permissions (nil = auto-allow)
}

func (*Server) ServeWithContext

func (s *Server) ServeWithContext(ctx context.Context, l net.Listener) error

Jump to

Keyboard shortcuts

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