filemanager

package
v0.9.0 Latest Latest
Warning

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

Go to latest
Published: Sep 2, 2026 License: GPL-2.0 Imports: 9 Imported by: 72

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BasePath

func BasePath(ctx context.Context, name string) string

func Chown added in v0.2.18

func Chown(ctx context.Context, name string) error

func Create

func Create(ctx context.Context, name string) (*os.File, error)

func CreateTemp

func CreateTemp(ctx context.Context, pattern string) (*os.File, error)

func Mkdir

func Mkdir(ctx context.Context, path string, perm os.FileMode) error

func MkdirAll

func MkdirAll(ctx context.Context, path string, perm os.FileMode) error

func Open added in v0.9.0

func Open(ctx context.Context, name string) (*os.File, error)

func OpenFile

func OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (*os.File, error)

func ReadDir added in v0.9.0

func ReadDir(ctx context.Context, name string) ([]os.DirEntry, error)

func ReadFile added in v0.9.0

func ReadFile(ctx context.Context, name string) ([]byte, error)

func Remove added in v0.2.16

func Remove(ctx context.Context, path string) error

func RemoveAll added in v0.2.16

func RemoveAll(ctx context.Context, path string) error

func Rename added in v0.9.0

func Rename(ctx context.Context, oldPath string, newPath string) error

func Stat added in v0.9.0

func Stat(ctx context.Context, name string) (os.FileInfo, error)

func TempPath added in v0.9.0

func TempPath(ctx context.Context) string

func WithDefault

func WithDefault(ctx context.Context, basePath string, tempPath string, userID int, groupID int) context.Context

func WriteFile

func WriteFile(ctx context.Context, name string, data []byte, perm os.FileMode) error

Types

type Manager

type Manager interface {
	BasePath(name string) string
	TempPath() string
	OpenFile(name string, flag int, perm os.FileMode) (*os.File, error)
	Create(name string) (*os.File, error)
	CreateTemp(pattern string) (*os.File, error)
	Chown(name string) error
	Mkdir(path string, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	Remove(path string) error
	RemoveAll(path string) error
	Rename(oldPath string, newPath string) error
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL