Documentation
¶
Index ¶
- func ExtractFilename(filePath string) string
- func IsRemotePath(rawURL string) bool
- func IsWebDAVURL(rawURL string) bool
- func ParseRemotePath(remotePath string) (remoteName, filePath string, err error)
- func ParseURL(rawURL string) (string, error)
- type Client
- func (c *Client) GetAuthHeader() string
- func (c *Client) GetFileURL(filePath string) string
- func (c *Client) List(ctx context.Context, dirPath string) ([]FileInfo, error)
- func (c *Client) Open(ctx context.Context, filePath string) (io.ReadCloser, int64, error)
- func (c *Client) Stat(ctx context.Context, filePath string) (*FileInfo, error)
- func (c *Client) SupportsRangeRequests(ctx context.Context, filePath string) (bool, error)
- type FileInfo
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ExtractFilename ¶
ExtractFilename extracts the filename from a WebDAV path
func IsRemotePath ¶
IsRemotePath checks if the URL is a remote path format (e.g., "pikpak:/path/to/file")
func IsWebDAVURL ¶
IsWebDAVURL checks if a URL is a WebDAV URL or a remote path (remote:path)
func ParseRemotePath ¶
ParseRemotePath parses a remote path like "pikpak:/path/to/file" into remote name and path
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client wraps go-webdav client with convenience methods
func NewClient ¶
NewClient creates a new WebDAV client URL format: webdav://user:pass@host/path or https://user:pass@host/path
func NewClientFromConfig ¶
func NewClientFromConfig(server *config.WebDAVServer) (*Client, error)
NewClientFromConfig creates a WebDAV client from a configured server
func (*Client) GetAuthHeader ¶
GetAuthHeader returns the Basic Auth header value if credentials are set
func (*Client) GetFileURL ¶
GetFileURL returns the full HTTP URL for a file path