Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

enhancement: build for wasi #4105

Draft
wants to merge 7 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
32 changes: 32 additions & 0 deletions activ.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
package restic

import (
"context"
"time"

"github.com/restic/restic/internal/restic"
)

type Snapshot struct {
paths, tags []string
hostname string
time time.Time
}

type Filter struct {
ctx context.Context
be restic.Lister
loader restic.LoaderUnpacked
hosts, snapshotIDs []string
tags restic.TagList
paths []restic.TagList
cb restic.SnapshotFindCb
}

func New(s *Snapshot) (*restic.Snapshot, error) {
return restic.NewSnapshot(s.paths, s.tags, s.hostname, s.time)
}

func Find(f *Filter) {
restic.FindFilteredSnapshots(f.ctx, f.be, f.loader, f.hosts, f.paths, f.tags, f.snapshotIDs, f.cb)
}
19 changes: 19 additions & 0 deletions internal/fs/const_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
//go:build js
// +build js

package fs

// Flags to OpenFile wrapping those of the underlying system. Not all flags may
// be implemented on a given system.
const (
O_RDONLY int = 0
O_WRONLY int = 0
O_RDWR int = 0
O_APPEND int = 0
O_CREATE int = 0
O_EXCL int = 0
O_SYNC int = 0
O_TRUNC int = 0
O_NONBLOCK int = 0
O_NOFOLLOW int = 0
)
15 changes: 15 additions & 0 deletions internal/fs/stat_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
//go:build js
// +build js

package fs

import (
"os"
// "syscall"
// "time"
)

// extendedStat extracts info into an ExtendedFileInfo for unix based operating systems.
func extendedStat(fi os.FileInfo) ExtendedFileInfo {
return ExtendedFileInfo{}
}
3 changes: 3 additions & 0 deletions internal/ui/signals/signals_js.go
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
package signals

func setupSignals() {}