filemanager

package
v0.6.0-beta.3 Latest Latest
Warning

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

Go to latest
Published: Dec 1, 2024 License: GPL-2.0 Imports: 7 Imported by: 45

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 OpenFile

func OpenFile(ctx context.Context, name string, flag int, perm os.FileMode) (*os.File, 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 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
	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
}

Jump to

Keyboard shortcuts

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