Documentation
¶
Overview ¶
Package tunnel provides management for tunnel services like Cloudflare and ngrok.
Index ¶
- type Config
- type Manager
- func (m *Manager) ActiveCount() int
- func (m *Manager) Get(id string) (*Tunnel, bool)
- func (m *Manager) List() []TunnelInfo
- func (m *Manager) Shutdown(ctx context.Context) error
- func (m *Manager) Start(ctx context.Context, id string, config Config) (*Tunnel, error)
- func (m *Manager) Stop(ctx context.Context, id string) error
- type Provider
- type State
- type Tunnel
- func (t *Tunnel) Done() <-chan struct{}
- func (t *Tunnel) Info() TunnelInfo
- func (t *Tunnel) OnURL(fn func(url string))
- func (t *Tunnel) PublicURL() string
- func (t *Tunnel) Start(ctx context.Context) error
- func (t *Tunnel) State() State
- func (t *Tunnel) Stop(ctx context.Context) error
- func (t *Tunnel) WaitForURL(ctx context.Context) (string, error)
- type TunnelInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct {
Provider Provider
LocalPort int
LocalHost string // defaults to "localhost"
BinaryPath string // optional: path to tunnel binary, otherwise uses PATH
}
Config holds tunnel configuration.
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages tunnel instances.
func (*Manager) ActiveCount ¶
ActiveCount returns the number of active tunnels.
func (*Manager) List ¶
func (m *Manager) List() []TunnelInfo
List returns information about all tunnels.
type Tunnel ¶
type Tunnel struct {
// contains filtered or unexported fields
}
Tunnel represents a running tunnel instance.
func (*Tunnel) Done ¶
func (t *Tunnel) Done() <-chan struct{}
Done returns a channel that's closed when the tunnel exits.
Click to show internal directories.
Click to hide internal directories.