Documentation
¶
Index ¶
- Constants
- type Config
- type Connection
- func (c *Connection) AccessTokenFetch(notify bool) (accessToken string, err error)
- func (c *Connection) AccessTokenRefresh(notify bool)
- func (c *Connection) Code() (code string)
- func (c *Connection) Connect()
- func (c *Connection) DPD()
- func (c *Connection) Disconnect(notify bool)
- func (c *Connection) ExternalIPs() (err error)
- func (c *Connection) Filter()
- func (c *Connection) Init() (err error)
- func (c *Connection) NotifySystemd(notifySystemd bool)
- func (c *Connection) PortForward()
- func (c *Connection) ScheduleConnect(in time.Duration)
- func (c *Connection) SetConnectNotify(connectNotify func(err error))
- func (c *Connection) Shutdown(notify bool)
- func (c *Connection) State() *State
- func (c *Connection) StateNotify(state *State)
- func (c *Connection) StateNotifyFnAdd(stateNotifyFn *func(state *State))
- func (c *Connection) StateNotifyFnDel(stateNotifyFn *func(state *State))
- type State
Constants ¶
View Source
const ( Clean = "clean" Routed = "routed" Connecting = "connecting" Connected = "connected" TokenUpdate = "token update" TokenUpdateDone = "token update done" ConfigurationGet = "configuration get" ConfigurationSet = "configuration set" LogDump = "logs dumped" Disconnecting = "disconnecting" DpdTimeout = "dpd timeout" DnsLookup = "dns lookup" ExternalIps = "external ips" )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Connection ¶
func New ¶
func New(config *Config) *Connection
func (*Connection) AccessTokenFetch ¶
func (c *Connection) AccessTokenFetch(notify bool) (accessToken string, err error)
func (*Connection) AccessTokenRefresh ¶
func (c *Connection) AccessTokenRefresh(notify bool)
func (*Connection) Code ¶
func (c *Connection) Code() (code string)
func (*Connection) Connect ¶
func (c *Connection) Connect()
func (*Connection) DPD ¶
func (c *Connection) DPD()
func (*Connection) Disconnect ¶
func (c *Connection) Disconnect(notify bool)
func (*Connection) ExternalIPs ¶
func (c *Connection) ExternalIPs() (err error)
func (*Connection) Filter ¶
func (c *Connection) Filter()
func (*Connection) Init ¶
func (c *Connection) Init() (err error)
func (*Connection) NotifySystemd ¶
func (c *Connection) NotifySystemd(notifySystemd bool)
func (*Connection) PortForward ¶
func (c *Connection) PortForward()
func (*Connection) ScheduleConnect ¶
func (c *Connection) ScheduleConnect(in time.Duration)
func (*Connection) SetConnectNotify ¶
func (c *Connection) SetConnectNotify(connectNotify func(err error))
func (*Connection) Shutdown ¶
func (c *Connection) Shutdown(notify bool)
func (*Connection) State ¶
func (c *Connection) State() *State
func (*Connection) StateNotify ¶
func (c *Connection) StateNotify(state *State)
func (*Connection) StateNotifyFnAdd ¶
func (c *Connection) StateNotifyFnAdd(stateNotifyFn *func(state *State))
func (*Connection) StateNotifyFnDel ¶
func (c *Connection) StateNotifyFnDel(stateNotifyFn *func(state *State))
type State ¶
type State struct {
Code string `json:"code"`
Timestamp time.Time `json:"timestamp"`
*rest.ConnectResponse `json:",omitempty"`
Rx int64 `json:"rx,omitempty"`
Tx int64 `json:"tx,omitempty"`
Host string `json:"host,omitempty"`
ExternalIpv4 net.IP `json:"external_ip,omitempty"`
ExternalIpv6 net.IP `json:"external_ipv6,omitempty"`
}
Click to show internal directories.
Click to hide internal directories.