files

package
v0.4.0-beta.1 Latest Latest
Warning

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

Go to latest
Published: Jul 29, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type FileInfo

type FileInfo struct {
	Name        string    `json:"name"`
	Path        string    `json:"path"`
	Size        int64     `json:"size"`
	IsDir       bool      `json:"is_dir"`
	ModTime     time.Time `json:"mod_time"`
	Permissions string    `json:"permissions"`
	ChildCount  int       `json:"child_count,omitempty"`
}

type Manager

type Manager struct {
	// contains filtered or unexported fields
}

func NewManager

func NewManager(deploymentsPath string) *Manager

func (*Manager) Chmod added in v0.2.0

func (m *Manager) Chmod(deploymentName, relativePath string, mode os.FileMode) error

func (*Manager) CreateDirectory

func (m *Manager) CreateDirectory(deploymentName, relativePath string) error

func (*Manager) CreateFile added in v0.2.0

func (m *Manager) CreateFile(deploymentName, relativePath string) error

func (*Manager) DeleteFile

func (m *Manager) DeleteFile(deploymentName, relativePath string) error

func (*Manager) GetDiskUsage

func (m *Manager) GetDiskUsage(deploymentName string) (int64, error)

func (*Manager) GetFileInfo

func (m *Manager) GetFileInfo(deploymentName, relativePath string) (*FileInfo, error)

func (*Manager) GetMountPath

func (m *Manager) GetMountPath(deploymentName, relativePath string) (string, error)

func (*Manager) ListFiles

func (m *Manager) ListFiles(deploymentName, relativePath string) ([]FileInfo, error)

func (*Manager) ReadFile

func (m *Manager) ReadFile(deploymentName, relativePath string) (io.ReadCloser, *FileInfo, error)

func (*Manager) Rename

func (m *Manager) Rename(deploymentName, oldPath, newPath string) error

func (*Manager) WriteFile

func (m *Manager) WriteFile(deploymentName, relativePath string, content io.Reader) error

type SystemManager added in v0.2.0

type SystemManager struct {
	// contains filtered or unexported fields
}

SystemManager provides filesystem access scoped to a configurable root path. Unlike Manager, it does not require a deployment name; operations are taken against paths relative to the root.

func NewSystemManager added in v0.2.0

func NewSystemManager(rootPath string) *SystemManager

NewSystemManager constructs a SystemManager rooted at rootPath. If rootPath is empty or invalid it defaults to "/" and a warning is logged: operations against the root filesystem are very permissive and should be gated by an admin-only permission.

func (*SystemManager) Chmod added in v0.2.0

func (m *SystemManager) Chmod(relativePath string, mode os.FileMode) error

func (*SystemManager) CreateDirectory added in v0.2.0

func (m *SystemManager) CreateDirectory(relativePath string) error

func (*SystemManager) CreateFile added in v0.2.0

func (m *SystemManager) CreateFile(relativePath string) error

func (*SystemManager) DeleteFile added in v0.2.0

func (m *SystemManager) DeleteFile(relativePath string) error

func (*SystemManager) GetDiskUsage added in v0.2.0

func (m *SystemManager) GetDiskUsage(relativePath string) (int64, int64, error)

GetDiskUsage returns the total byte size of regular files under relativePath. The walk only traverses paths that resolve inside the root. Callers should be aware that walking the entire root (e.g. "/") can be very slow.

func (*SystemManager) GetFileInfo added in v0.2.0

func (m *SystemManager) GetFileInfo(relativePath string) (*FileInfo, error)

func (*SystemManager) List added in v0.2.0

func (m *SystemManager) List(relativePath string) ([]FileInfo, error)

func (*SystemManager) ReadFile added in v0.2.0

func (m *SystemManager) ReadFile(relativePath string) (io.ReadCloser, *FileInfo, error)

func (*SystemManager) Root added in v0.2.0

func (m *SystemManager) Root() string

Root returns the configured root path.

func (*SystemManager) WriteFile added in v0.2.0

func (m *SystemManager) WriteFile(relativePath string, content io.Reader) error

Jump to

Keyboard shortcuts

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