Documentation
¶
Overview ¶
Package tunnel manages process-local SSH forwards independently of MCP calls.
Index ¶
- Constants
- type Manager
- func (m *Manager) Create(ctx context.Context, s Spec, operationID string) (Status, error)
- func (m *Manager) List(nodeID, state string) []Status
- func (m *Manager) Retry(s Spec) (Status, bool, error)
- func (m *Manager) Shutdown(ctx context.Context) error
- func (m *Manager) Status(id string) (Status, error)
- func (m *Manager) Stop(ctx context.Context, id string) (Status, error)
- type Observer
- type Runner
- type Spec
- type Status
Constants ¶
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
func (*Manager) Create ¶
Create waits only for startup. After ready commits, cancellation of the creating call cannot stop the tunnel. Lost responses can be recovered by ID.
func (*Manager) Retry ¶
Retry returns the existing state without repeating authorization or network side effects. A subsequent Create performs the same check atomically.
type Runner ¶
Runner owns and joins all network resources before returning. It must obey ctx during both startup and serving. ready commits startup only when it returns true; report records recoverable connection-level failures.
type Spec ¶
type Spec struct {
RequestID string `json:"requestID"`
NodeID string `json:"nodeID"`
Mode string `json:"mode"`
ListenHost string `json:"listenHost"`
ListenPort int `json:"listenPort"`
TargetHost string `json:"targetHost"`
TargetPort int `json:"targetPort"`
TTLSeconds int `json:"ttlSeconds"`
}
Spec is an immutable, normalized request. A request ID is unique for the lifetime of its retained record, including after the tunnel has stopped.
func Normalize ¶
Normalize validates before authorization or any network activity. Listen hosts are literals so exposure classification cannot be changed by DNS.
func (Spec) ListenAddress ¶
func (Spec) TargetAddress ¶
type Status ¶
type Status struct {
Spec
TunnelID string `json:"tunnelID"`
OperationID string `json:"operationID"`
State string `json:"state"`
ListenAddress string `json:"listenAddress,omitempty"`
ListenScope string `json:"listenScope"`
TargetScope string `json:"targetScope"`
CreatedAt time.Time `json:"createdAt"`
ExpiresAt time.Time `json:"expiresAt,omitempty"`
FinishedAt time.Time `json:"finishedAt,omitempty"`
Error string `json:"error,omitempty"`
LastConnectionError string `json:"lastConnectionError,omitempty"`
AuditError string `json:"auditError,omitempty"`
RemoteRelease string `json:"remoteRelease,omitempty"`
}
Status is a value snapshot; callers never receive mutable task internals.