all: fix some js/wasm compilation issues

Change-Id: I05a3a4835e225a1e413ec3540a7c7e4a2d477084
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
Brad Fitzpatrick 2021-10-20 09:41:36 -07:00 committed by Brad Fitzpatrick
parent 0bf515e780
commit 9310713bfb
7 changed files with 37 additions and 8 deletions

9
paths/paths_js.go Normal file
View File

@ -0,0 +1,9 @@
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package paths
func ensureStateDirPerms(dirPath string) error {
return nil
}

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !windows
// +build !windows
//go:build !windows && !js
// +build !windows,!js
package paths

17
portlist/portlist_js.go Normal file
View File

@ -0,0 +1,17 @@
// Copyright (c) 2021 Tailscale Inc & AUTHORS All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package portlist
import "time"
const pollInterval = 365 * 24 * time.Hour
func listPorts() (List, error) {
return nil, nil
}
func addProcesses(pl []Port) ([]Port, error) {
return pl, nil
}

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !linux && !windows && !darwin
// +build !linux,!windows,!darwin
//go:build !linux && !windows && !darwin && !js
// +build !linux,!windows,!darwin,!js
package portlist

View File

@ -2,6 +2,9 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build windows || js
// +build windows js
package logger
func rusageMaxRSS() float64 {

View File

@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
//go:build !windows
// +build !windows
//go:build !windows && !js
// +build !windows,!js
package logger

View File

@ -16,8 +16,8 @@ import (
"tailscale.com/wgengine/monitor"
)
func newUserspaceRouter(logf logger.Logf, tunname string, tunDev tun.Device, linkMon *monitor.Mon) Router {
panic(fmt.Sprintf("unsupported OS %q", runtime.GOOS))
func newUserspaceRouter(logf logger.Logf, tunDev tun.Device, linkMon *monitor.Mon) (Router, error) {
return nil, fmt.Errorf("unsupported OS %q", runtime.GOOS)
}
func cleanup(logf logger.Logf, interfaceName string) {