carlos / platform Public

Clone
git clone https://amadan.net/carlos/platform

Plain git — no account needed to clone.

Download

Download this file

1//go:build !unix
2
3package hostfiles
4
5import (
6 "context"
7 "errors"
8 "os"
9)
10
11// The publisher reads a files directory by descriptor, without following
12// links, which needs openat. The agent runs on Linux; elsewhere this
13// package builds, restores and reads manifests, and does not publish.
14var errNoPublish = errors.New("hostfiles: publishing a directory is not supported on this OS")
15
16// restoreDirFlags is Restore's directory open off unix, where there is no
17// FIFO to wait on.
18const restoreDirFlags = os.O_RDONLY
19
20type dirHandle struct{ f *os.File }
21
22func openTree(path string) (*dirHandle, error) { return nil, errNoPublish }
23func handleOf(f *os.File) (*dirHandle, error) { return nil, errNoPublish }
24func (d *dirHandle) Close() error { return nil }
25func (d *dirHandle) Name() string { return "" }
26
27func syncTree(ctx context.Context, d *dirHandle, p *Publisher, skip func(string, bool) bool, visit func(*dirHandle, string, string) error) error {
28 return errNoPublish
29}
30
31func (d *dirHandle) descend(rel string) (*dirHandle, bool, error) { return nil, false, errNoPublish }
32
33func readStable(d *dirHandle, name string) ([]byte, uint32, fileState, error) {
34 return nil, 0, fileUnreadable, errNoPublish
35}
36