Documentation
¶
Index ¶
- Constants
- Variables
- func SetLogger(l pnet.Logger)
- type Dialer
- type TSCapability
- type Tailscale
- type TcpHolePunch
- func (d *TcpHolePunch) Init(conf config.Config) (err error)
- func (d *TcpHolePunch) IntoReceiver(ctx context.Context, info pnet.PeerInfo) (io.ReadCloser, error)
- func (d *TcpHolePunch) IntoSender(ctx context.Context, info pnet.PeerInfo) (io.WriteCloser, error)
- func (d *TcpHolePunch) SetInfo(info *pnet.SelfInfo)
Constants ¶
View Source
const TmpArcName = "acp-tmp.tar.gz"
Variables ¶
View Source
var ErrNotAvailable = errors.New("this dialer is not available")
Functions ¶
Types ¶
type Dialer ¶
type Dialer interface { // Initialize Dialer from config and environment, while checking availability. // Return ErrNotAvailable if Dialer is not supported Init(conf config.Config) error // Populate the info struct to be sent to rendezvous service for information exchange SetInfo(info *pnet.SelfInfo) // Base on the info received, establish a stream as the sender IntoSender(ctx context.Context, info pnet.PeerInfo) (io.WriteCloser, error) // Base on the info received, establish a stream as the receiver IntoReceiver(ctx context.Context, info pnet.PeerInfo) (io.ReadCloser, error) }
A Dialer establishes a stream for sending / receiving files, with the help of a rendezvous service.
After implementing a new Dialer: 1. Register
func init() { registerDialer("dialer_name", &DialerImpl{}) }
2. Specify information exchange in pnet.SelfInfo and pnet.PeerInfo 3. (optional) Provide configurable options in config.Config
type Tailscale ¶
type Tailscale struct {
// contains filtered or unexported fields
}
func (*Tailscale) IntoReceiver ¶
func (*Tailscale) IntoSender ¶
type TcpHolePunch ¶
type TcpHolePunch struct {
// contains filtered or unexported fields
}
func (*TcpHolePunch) IntoReceiver ¶
func (d *TcpHolePunch) IntoReceiver(ctx context.Context, info pnet.PeerInfo) (io.ReadCloser, error)
func (*TcpHolePunch) IntoSender ¶
func (d *TcpHolePunch) IntoSender(ctx context.Context, info pnet.PeerInfo) (io.WriteCloser, error)
func (*TcpHolePunch) SetInfo ¶
func (d *TcpHolePunch) SetInfo(info *pnet.SelfInfo)
Click to show internal directories.
Click to hide internal directories.