beam

package
v0.2.5 Latest Latest
Warning

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

Go to latest
Published: May 17, 2026 License: AGPL-3.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FormatFileSize

func FormatFileSize(size int64) string

func FormatModTime

func FormatModTime(modTime string) string

func GetLocalIP

func GetLocalIP() string

func IsDir

func IsDir(path string) bool

func IsFile

func IsFile(path string) bool

func ResolvePath

func ResolvePath(sharedDir, raw string) (string, error)

ResolvePath returns the absolute safe path inside sharedDir

func SendJSON added in v0.2.0

func SendJSON(w http.ResponseWriter, data any, status int)

SendJSON is a helper function to send JSON responses

Types

type File

type File struct {
	Name    string `json:"name"`
	Size    string `json:"size"`
	IsDir   bool   `json:"isDir"`
	ModTime string `json:"modTime"`
	Path    string `json:"path"`
}

type ServerStats

type ServerStats struct {
	Downloads int       `json:"downloads"`
	Requests  int       `json:"requests"`
	Uploads   int       `json:"uploads"`
	StartTime time.Time `json:"startTime"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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