Movatterモバイル変換


[0]ホーム

URL:


dirfs

package
v1.92.3Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 16, 2025 License:BSD-3-ClauseImports:9Imported by:2

Details

Repository

github.com/tailscale/tailscale

Links

Documentation

Overview

Package dirfs provides a webdav.FileSystem that looks like a read-onlydirectory containing only subdirectories.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

typeChild

type Child struct {// Name is the name of the childNamestring// Available is a function indicating whether or not the child is currently// available. Unavailable children are excluded from the FS's directory// listing. Available must be safe for concurrent use.Available func()bool}

Child is subdirectory of an FS.

typeFS

type FS struct {// Children configures the full set of children of this FS.Children []*Child// Clock, if given, will cause this FS to use Clock.now() as the current// time.Clocktstime.Clock// StaticRoot, if given, will insert the given name as a static root into// every path.StaticRootstring}

FS is a read-only webdav.FileSystem that is composed of multiple childfolders.

When listing the contents of this FileSystem's root directory, children willbe ordered in the order they're given to the FS.

Children in an FS cannot be added, removed or renamed via operations on thewebdav.FileSystem interface like filesystem.Mkdir or filesystem.OpenFile.

Any attempts to perform operations on paths inside of children will resultin a panic, as these are not expected to be performed on this FS.

An FS can optionally have a StaticRoot, which will insert a folder with thatStaticRoot into the tree, like this:

-- <StaticRoot>----- <Child>----- <Child>

func (*FS)Mkdir

func (dfs *FS) Mkdir(ctxcontext.Context, namestring, permos.FileMode)error

Mkdir implements webdav.FileSystem. All attempts to Mkdir a directory thatalready exists will succeed. All other attempts will fail withos.ErrPermission.

func (*FS)OpenFile

func (dfs *FS) OpenFile(ctxcontext.Context, namestring, flagint, permos.FileMode) (webdav.File,error)

OpenFile implements interface webdav.Filesystem.

func (*FS)RemoveAll

func (dfs *FS) RemoveAll(ctxcontext.Context, namestring)error

RemoveAll implements webdav.File. No removal is supported and this alwaysreturns os.ErrPermission.

func (*FS)Rename

func (dfs *FS) Rename(ctxcontext.Context, oldName, newNamestring)error

Rename implements interface webdav.FileSystem. No renaming is supported andthis always returns os.ErrPermission.

func (*FS)Stat

func (dfs *FS) Stat(ctxcontext.Context, namestring) (fs.FileInfo,error)

Stat implements webdav.FileSystem.

Source Files

View all Source files

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f orF : Jump to
y orY : Canonical URL
go.dev uses cookies from Google to deliver and enhance the quality of its services and to analyze traffic.Learn more.

[8]ページ先頭

©2009-2025 Movatter.jp