wgengine: flesh out some docs

Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick
2020-02-11 15:21:24 -08:00
committed by Brad Fitzpatrick
parent 490e586eac
commit 819daf10e2
6 changed files with 68 additions and 24 deletions

View File

@ -5,9 +5,10 @@
package wgengine
import (
"github.com/tailscale/wireguard-go/tun"
"io"
"os"
"github.com/tailscale/wireguard-go/tun"
)
type fakeTun struct {
@ -16,6 +17,9 @@ type fakeTun struct {
closechan chan struct{}
}
// NewFakeTun returns a fake TUN device that does not depend on the
// operating system or any special permissions.
// It primarily exists for testing.
func NewFakeTun() tun.Device {
return &fakeTun{
datachan: make(chan []byte),