Documentation
¶
Index ¶
- Variables
- func CapitalizeFirst(s string) string
- func CheckErr(source string, err error)
- func CheckForUpdates() (updateInfo, error)
- func GenerateKey() string
- func GenerateRandomPath(levels int) string
- func GenerateRandomSearchTerms(numTerms int) []string
- func GetChecksum(fullPath, algo string) (string, error)
- func GetLastComponent(path string) string
- func GetParentDirectoryPath(path string) string
- func GetRandomExtension() string
- func GetRandomTerm() string
- func GetUpdateAvailableUrl() string
- func HashSHA256(data string) string
- func InsecureRandomIdentifier(length int) string
- func JoinPathAsUnix(parts ...string) string
- func NonNilSlice[T any](in []T) []T
- func PrintStructFields(v interface{})
- func StartCheckForUpdates()
- func Ternary[T any](cond bool, vtrue, vfalse T) T
- type FileOptions
- type Tag
Constants ¶
This section is empty.
Variables ¶
View Source
var ( DiskUsageCache = cache.NewCache[bool](30*time.Second, 24*time.Hour) RealPathCache = cache.NewCache[string](48*time.Hour, 72*time.Hour) SearchResultsCache = cache.NewCache[string](15*time.Second, 1*time.Hour) OnlyOfficeCache = cache.NewCache[string](48*time.Hour, 1*time.Hour) JwtCache = cache.NewCache[string](1*time.Hour, 72*time.Hour) )
Functions ¶
func CapitalizeFirst ¶
CapitalizeFirst returns the input string with the first letter capitalized.
func CheckForUpdates ¶
func CheckForUpdates() (updateInfo, error)
func GenerateKey ¶
func GenerateKey() string
func GenerateRandomPath ¶
func GetChecksum ¶
GetChecksum calculates the checksum of a file using the specified algorithm. Returns the checksum as a hex-encoded string.
func GetLastComponent ¶
func GetParentDirectoryPath ¶
func GetRandomExtension ¶
func GetRandomExtension() string
func GetRandomTerm ¶
func GetRandomTerm() string
func GetUpdateAvailableUrl ¶
func GetUpdateAvailableUrl() string
func HashSHA256 ¶
func JoinPathAsUnix ¶
func NonNilSlice ¶
func NonNilSlice[T any](in []T) []T
func PrintStructFields ¶
func PrintStructFields(v interface{})
func StartCheckForUpdates ¶
func StartCheckForUpdates()
starts a background process to check for updates periodically.
Types ¶
type FileOptions ¶
type FileOptions struct { Username string // username for access control Path string // realpath Source string IsDir bool Modify bool Expand bool ReadHeader bool Content bool Recursive bool // whether to recursively index directories Metadata bool // whether to get metadata ExtractEmbeddedSubtitles bool // whether to extract embedded subtitles from media files }
FileOptions are the options when getting a file info.
Click to show internal directories.
Click to hide internal directories.