Documentation
¶
Overview ¶
Package tunnel manages the sshuttle profiles a site offers.
A profile says which networks to route, through which host, and what to keep off the tunnel. It replaces the per site shell scripts that carried the same arguments, and it resolves network names and the workstation's own address from the configuration instead of hard coding them.
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Manager ¶
type Manager struct {
// Profiles are the configured tunnels.
Profiles map[string]v1alpha1.TunnelSpec
// Networks maps a network name to a CIDR.
Networks map[string]string
// Host resolves a role name to the host sshuttle connects to.
Host func(role string) (host, user string, err error)
// StateDir holds the process id files.
StateDir string
// Binary is the sshuttle to run.
Binary string
// Vars are the template values a profile may refer to, such as
// {workstation.host}.
Vars map[string]string
}
Manager starts, stops and reports on the tunnels of a site.
func (*Manager) Start ¶
Start brings a profile up. Starting one that is already running is reported rather than producing a second tunnel for the same networks.
type Status ¶
type Status struct {
Name string `json:"name" yaml:"name"`
Running bool `json:"running" yaml:"running"`
PID int `json:"pid,omitempty" yaml:"pid,omitempty"`
Remote string `json:"remote" yaml:"remote"`
Subnets string `json:"subnets" yaml:"subnets"`
Description string `json:"description,omitempty" yaml:"description,omitempty"`
}
Status describes one profile.