healthcheck: exclude unsupported syscalls from JS builds
Because the health check uses OS specific syscalls for determining the available space on a disk that aren't available in JS/WASM builds, we need to make sure we don't reference that code at all. Otherwise we can't use parts of lnd as a library in projects that are being compiled down to a WASM binary.
This commit is contained in:
parent
724ca7a358
commit
537880e634
@ -1,4 +1,4 @@
|
|||||||
// +build !windows,!solaris,!netbsd,!openbsd
|
// +build !windows,!solaris,!netbsd,!openbsd,!js
|
||||||
|
|
||||||
package healthcheck
|
package healthcheck
|
||||||
|
|
||||||
|
13
healthcheck/diskcheck_js.go
Normal file
13
healthcheck/diskcheck_js.go
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
package healthcheck
|
||||||
|
|
||||||
|
// AvailableDiskSpaceRatio returns ratio of available disk space to total
|
||||||
|
// capacity.
|
||||||
|
func AvailableDiskSpaceRatio(path string) (float64, error) {
|
||||||
|
return 0, fmt.Errorf("disk space check not supported in WebAssembly")
|
||||||
|
}
|
||||||
|
|
||||||
|
// AvailableDiskSpace returns the available disk space in bytes of the given
|
||||||
|
// file system.
|
||||||
|
func AvailableDiskSpace(path string) (uint64, error) {
|
||||||
|
return 0, fmt.Errorf("disk space check not supported in WebAssembly")
|
||||||
|
}
|
Loading…
Reference in New Issue
Block a user