files

package
v0.0.5 Latest Latest
Warning

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

Go to latest
Published: Dec 4, 2025 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Download

func Download(fileURL string) error

func DownloadFile

func DownloadFile(fileURL string, savePath string) error

func DownloadURL

func DownloadURL(parsedFile *url.URL, savePath string) error

func Exists

func Exists(path string) bool

func GetFileReader

func GetFileReader(fileToGet string) (io.ReadCloser, error)

func GetURLReader

func GetURLReader(parsedFile *url.URL) (io.ReadCloser, error)

func HTTPServer

func HTTPServer(serverAddr, srvDir string, allowPut bool, uploadToken string) error

func PrintFileList

func PrintFileList(files []FileInfo)

PrintFileList prints the file list in a format similar to 'ls'.

func UploadFile

func UploadFile(remoteServer, authToken, filePath string) error

Types

type FileInfo

type FileInfo struct {
	Name        string
	Size        int64
	IsDirectory bool
	Permissions string // Unix-like permissions string
}

FileInfo represents file information for listing

func GetFileInfo

func GetFileInfo(path string) ([]FileInfo, error)

GetFileInfo retrieves file information for a given path. It handles errors and provides consistent output across platforms.

type MyResponseWriter

type MyResponseWriter struct {
	http.ResponseWriter
}

Jump to

Keyboard shortcuts

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