Documentation
¶
Index ¶
Constants ¶
const ( ContentLengthKey = contextKey("contentLength") RangeKey = contextKey("rangeKey") IsCopy = contextKey("isCopy") Origin = contextKey("origin") ShowCorrupted = contextKey("showCorrupted") ActiveStreamKey = contextKey("activeStream") StreamIDKey = contextKey("streamID") StreamSourceKey = contextKey("streamSource") StreamUserNameKey = contextKey("streamUserName") ClientIPKey = contextKey("clientIP") UserAgentKey = contextKey("userAgent") MaxPrefetchKey = contextKey("maxPrefetch") SuppressStreamTrackingKey = contextKey("suppressStreamTracking") )
Context keys for passing WebDAV request metadata through context
Variables ¶
This section is empty.
Functions ¶
func CheckDirectoryWritable ¶ added in v0.3.0
CheckDirectoryWritable checks if a directory exists and is writable. If the directory doesn't exist, it attempts to create it.
func CheckFileDirectoryWritable ¶ added in v0.3.0
CheckFileDirectoryWritable checks if the directory containing a file path is writable.
func JoinAbsPath ¶ added in v0.3.0
JoinAbsPath safely joins a base path with another path (which could be absolute or relative). If the second path is absolute and starts with the base path, it returns the second path as is. Otherwise, it joins them normally.
func MoveFile ¶ added in v0.3.0
MoveFile atomically renames a file from src to dst. If the rename fails due to cross-device boundaries, it falls back to a robust copy-and-delete.
func RemoveEmptyDirs ¶ added in v0.3.0
func RemoveEmptyDirs(root, path string)
RemoveEmptyDirs recursively removes empty parent directories starting from 'path' up towards 'root' (exclusive). It stops if it encounters a non-empty directory or reaches the root.
Types ¶
type RangeHeader ¶
func ParseRangeHeader ¶
func ParseRangeHeader(s string) (po *RangeHeader, err error)
ParseRangeHeader parses a RangeHeader from a Range: header. It only accepts single ranges.
func (*RangeHeader) Decode ¶
func (o *RangeHeader) Decode(size int64) (offset, limit int64)
Decode interprets the RangeOption into an offset and a limit
The offset is the start of the stream and the limit is how many bytes should be read from it. If the limit is -1 then the stream should be read to the end.