Documentation
¶
Index ¶
- func Debugf(format string, args ...interface{})
- func Debugln(args ...interface{})
- type AboutInfo
- type Config
- type ConnLogger
- type CreateTunnelBody
- type EditTunnelBody
- type Forwarder
- type Tunnel
- type TunnelManager
- func (tm *TunnelManager) AddTunnel(nt Tunnel) (uint64, error)
- func (tm *TunnelManager) ChangeTunnel(id uint64, newName string, newSource string, newDest string) error
- func (tm *TunnelManager) GetTunnels() []Tunnel
- func (tm *TunnelManager) RemoveTunnel(id uint64) error
- func (tm *TunnelManager) Run()
- func (tm *TunnelManager) ToggleTunnel(id uint64) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type ConnLogger ¶
type ConnLogger struct {
// contains filtered or unexported fields
}
func NewConnLogger ¶
func NewConnLogger(source string, dest string) *ConnLogger
log file at ~/.gopolar/logs/
func (*ConnLogger) LogRecv ¶
func (cl *ConnLogger) LogRecv(b []byte)
func (*ConnLogger) LogSend ¶
func (cl *ConnLogger) LogSend(b []byte)
type CreateTunnelBody ¶
type EditTunnelBody ¶
type Forwarder ¶
type Forwarder struct {
// contains filtered or unexported fields
}
forward one source to one or multiple dest
type Tunnel ¶
type Tunnel struct { ID uint64 `json:"id"` Name string `json:"name"` Enable bool `json:"enable"` Source string `json:"source"` // e.g. localhost:xxxx Dest string `json:"dest"` // e.g. 192.168.1.0:7878, localhost:7878 }
func (Tunnel) MustParseDest ¶
func (Tunnel) MustParseSource ¶
type TunnelManager ¶
type TunnelManager struct {
// contains filtered or unexported fields
}
func NewTunnelManager ¶
func NewTunnelManager(cfg Config) *TunnelManager
init tunnels from config file, exit if any error occurs
func (*TunnelManager) AddTunnel ¶
func (tm *TunnelManager) AddTunnel(nt Tunnel) (uint64, error)
returns error if tunnel already exists
func (*TunnelManager) ChangeTunnel ¶
func (tm *TunnelManager) ChangeTunnel(id uint64, newName string, newSource string, newDest string) error
returns error if tunnel with id does not exist
func (*TunnelManager) GetTunnels ¶
func (tm *TunnelManager) GetTunnels() []Tunnel
always return a list sorted by tunnel ID, never errors
func (*TunnelManager) RemoveTunnel ¶
func (tm *TunnelManager) RemoveTunnel(id uint64) error
returns error if tunnel with id does not exist
func (*TunnelManager) Run ¶
func (tm *TunnelManager) Run()
func (*TunnelManager) ToggleTunnel ¶
func (tm *TunnelManager) ToggleTunnel(id uint64) error
returns error if tunnel with id does not exist
Click to show internal directories.
Click to hide internal directories.