files

package
v0.4.4 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2026 License: GPL-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

Functions

This section is empty.

Types

type ChmodRequest

type ChmodRequest struct {
	Path      string `json:"path" validate:"required"`
	Mode      string `json:"mode" validate:"required"`
	Recursive bool   `json:"recursive,omitempty"`
}

type ChownRequest

type ChownRequest struct {
	Path      string  `json:"path" validate:"required"`
	OwnerID   *uint32 `json:"owner_id,omitempty"`
	GroupID   *uint32 `json:"group_id,omitempty"`
	Recursive bool    `json:"recursive,omitempty"`
}

type CopyRequest

type CopyRequest struct {
	SourcePath string `json:"source_path" validate:"required"`
	TargetPath string `json:"target_path" validate:"required"`
}

type CreateDirectoryRequest

type CreateDirectoryRequest struct {
	Path    string  `json:"path" validate:"required"`
	Mode    *string `json:"mode,omitempty"`
	OwnerID *uint32 `json:"owner_id,omitempty"`
	GroupID *uint32 `json:"group_id,omitempty"`
}

type DeleteRequest

type DeleteRequest struct {
	Path string `json:"path" validate:"required"`
}

type DirectoryListing

type DirectoryListing struct {
	Path    string      `json:"path"`
	Entries []FileEntry `json:"entries"`
}

type DirectoryStats

type DirectoryStats struct {
	Path            string `json:"path"`
	MostCommonOwner uint32 `json:"most_common_owner"`
	MostCommonGroup uint32 `json:"most_common_group"`
	MostCommonMode  string `json:"most_common_mode"`
	OwnerName       string `json:"owner_name,omitempty"`
	GroupName       string `json:"group_name,omitempty"`
}

type DirectoryStatsRequest

type DirectoryStatsRequest struct {
	Path string `json:"path" validate:"required"`
}

type ErrorResponse

type ErrorResponse struct {
	Error   string `json:"error"`
	Code    string `json:"code,omitempty"`
	Details string `json:"details,omitempty"`
}

type FileContent

type FileContent struct {
	Path     string `json:"path"`
	Content  string `json:"content"`
	Size     int64  `json:"size"`
	Encoding string `json:"encoding"`
}

type FileEntry

type FileEntry struct {
	Name        string    `json:"name"`
	Path        string    `json:"path"`
	Size        int64     `json:"size"`
	IsDirectory bool      `json:"is_directory"`
	ModTime     time.Time `json:"mod_time"`
	Mode        string    `json:"mode"`
	Owner       string    `json:"owner,omitempty"`
	Group       string    `json:"group,omitempty"`
	OwnerID     uint32    `json:"owner_id,omitempty"`
	GroupID     uint32    `json:"group_id,omitempty"`
	Extension   string    `json:"extension,omitempty"`
}

type Handler

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

func NewHandler

func NewHandler(service *Service, auditService *audit.Service) *Handler

func (*Handler) Chmod

func (h *Handler) Chmod(c echo.Context) error

func (*Handler) Chown

func (h *Handler) Chown(c echo.Context) error

func (*Handler) Copy

func (h *Handler) Copy(c echo.Context) error

func (*Handler) CreateDirectory

func (h *Handler) CreateDirectory(c echo.Context) error

func (*Handler) Delete

func (h *Handler) Delete(c echo.Context) error

func (*Handler) DownloadFile

func (h *Handler) DownloadFile(c echo.Context) error

func (*Handler) GetDirectoryStats

func (h *Handler) GetDirectoryStats(c echo.Context) error

func (*Handler) ListDirectory

func (h *Handler) ListDirectory(c echo.Context) error

func (*Handler) ReadFile

func (h *Handler) ReadFile(c echo.Context) error

func (*Handler) Rename

func (h *Handler) Rename(c echo.Context) error

func (*Handler) UploadFile

func (h *Handler) UploadFile(c echo.Context) error

func (*Handler) WriteFile

func (h *Handler) WriteFile(c echo.Context) error

type RenameRequest

type RenameRequest struct {
	OldPath string `json:"old_path" validate:"required"`
	NewPath string `json:"new_path" validate:"required"`
}

type Service

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

func NewService

func NewService(cfg *config.Config, logger *logging.Logger) *Service

func (*Service) Chmod

func (s *Service) Chmod(stackName string, req ChmodRequest) error

func (*Service) Chown

func (s *Service) Chown(stackName string, req ChownRequest) error

func (*Service) Copy

func (s *Service) Copy(stackName string, req CopyRequest) error

func (*Service) CreateDirectory

func (s *Service) CreateDirectory(stackName string, req CreateDirectoryRequest) error

func (*Service) Delete

func (s *Service) Delete(stackName string, req DeleteRequest) error

func (*Service) GetDirectoryStats

func (s *Service) GetDirectoryStats(stackName string, req DirectoryStatsRequest) (*DirectoryStats, error)

func (*Service) ListDirectory

func (s *Service) ListDirectory(stackName, path string) (*DirectoryListing, error)

func (*Service) ReadFile

func (s *Service) ReadFile(stackName, path string) (*FileContent, error)

func (*Service) Rename

func (s *Service) Rename(stackName string, req RenameRequest) error

func (*Service) WriteFile

func (s *Service) WriteFile(stackName string, req WriteFileRequest) error

func (*Service) WriteUploadedFile

func (s *Service) WriteUploadedFile(stackName, path string, src io.Reader, size int64, mode *string, ownerID *uint32, groupID *uint32) error

type WriteFileRequest

type WriteFileRequest struct {
	Path     string  `json:"path" validate:"required"`
	Content  string  `json:"content"`
	Encoding string  `json:"encoding,omitempty"`
	Mode     *string `json:"mode,omitempty"`
	OwnerID  *uint32 `json:"owner_id,omitempty"`
	GroupID  *uint32 `json:"group_id,omitempty"`
}

Jump to

Keyboard shortcuts

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