Documentation
¶
Index ¶
- Constants
- func AddMyPublicKey(c *gin.Context)
- func AddOfflineDownload(c *gin.Context)
- func ArchiveDown(c *gin.Context)
- func ArchiveExtensions(c *gin.Context)
- func ArchiveInternalExtract(c *gin.Context)
- func ArchiveProxy(c *gin.Context)
- func BeginAuthnLogin(c *gin.Context)
- func BeginAuthnRegistration(c *gin.Context)
- func BuildIndex(c *gin.Context)
- func Cancel2FAById(c *gin.Context)
- func ClearIndex(c *gin.Context)
- func CreateMeta(c *gin.Context)
- func CreateStorage(c *gin.Context)
- func CreateUser(c *gin.Context)
- func CurrentUser(c *gin.Context)
- func DelUserCache(c *gin.Context)
- func DeleteAuthnLogin(c *gin.Context)
- func DeleteMeta(c *gin.Context)
- func DeleteMyPublicKey(c *gin.Context)
- func DeletePublicKey(c *gin.Context)
- func DeleteSetting(c *gin.Context)
- func DeleteStorage(c *gin.Context)
- func DeleteUser(c *gin.Context)
- func DisableStorage(c *gin.Context)
- func Down(c *gin.Context)
- func EnableStorage(c *gin.Context)
- func Favicon(c *gin.Context)
- func FinishAuthnLogin(c *gin.Context)
- func FinishAuthnRegistration(c *gin.Context)
- func FsArchiveDecompress(c *gin.Context)
- func FsArchiveList(c *gin.Context)
- func FsArchiveMeta(c *gin.Context)
- func FsBatchRename(c *gin.Context)
- func FsCopy(c *gin.Context)
- func FsDirs(c *gin.Context)
- func FsForm(c *gin.Context)
- func FsGet(c *gin.Context)
- func FsList(c *gin.Context)
- func FsMkdir(c *gin.Context)
- func FsMove(c *gin.Context)
- func FsOther(c *gin.Context)
- func FsRecursiveMove(c *gin.Context)
- func FsRegexRename(c *gin.Context)
- func FsRemove(c *gin.Context)
- func FsRemoveEmptyDirectory(c *gin.Context)
- func FsRename(c *gin.Context)
- func FsStream(c *gin.Context)
- func Generate2FA(c *gin.Context)
- func GetAuthnCredentials(c *gin.Context)
- func GetDriverInfo(c *gin.Context)
- func GetMeta(c *gin.Context)
- func GetOIDCClient(c *gin.Context, useCompatibility bool, redirectUri, method string) (*oauth2.Config, error)
- func GetProgress(c *gin.Context)
- func GetSetting(c *gin.Context)
- func GetStorage(c *gin.Context)
- func GetUser(c *gin.Context)
- func Link(c *gin.Context)
- func ListDriverInfo(c *gin.Context)
- func ListDriverNames(c *gin.Context)
- func ListMetas(c *gin.Context)
- func ListMyPublicKey(c *gin.Context)
- func ListPublicKeys(c *gin.Context)
- func ListSettings(c *gin.Context)
- func ListStorages(c *gin.Context)
- func ListUsers(c *gin.Context)
- func LoadAllStorages(c *gin.Context)
- func LogOut(c *gin.Context)
- func Login(c *gin.Context)
- func LoginHash(c *gin.Context)
- func LoginLdap(c *gin.Context)
- func OIDCLoginCallback(c *gin.Context)
- func OfflineDownloadTools(c *gin.Context)
- func Plist(c *gin.Context)
- func Proxy(c *gin.Context)
- func PublicSettings(c *gin.Context)
- func ResetToken(c *gin.Context)
- func Robots(c *gin.Context)
- func SSOLoginCallback(c *gin.Context)
- func SSOLoginRedirect(c *gin.Context)
- func SaveSettings(c *gin.Context)
- func Search(c *gin.Context)
- func Set115(c *gin.Context)
- func SetAria2(c *gin.Context)
- func SetPikPak(c *gin.Context)
- func SetQbittorrent(c *gin.Context)
- func SetThunder(c *gin.Context)
- func SetThunderBrowser(c *gin.Context)
- func SetTransmission(c *gin.Context)
- func SetupTaskRoute(g *gin.RouterGroup)
- func StopIndex(c *gin.Context)
- func UpdateCurrent(c *gin.Context)
- func UpdateIndex(c *gin.Context)
- func UpdateMeta(c *gin.Context)
- func UpdateStorage(c *gin.Context)
- func UpdateUser(c *gin.Context)
- func Verify2FA(c *gin.Context)
- type AddOfflineDownloadReq
- type ArchiveContentResp
- type ArchiveDecompressReq
- type ArchiveListReq
- type ArchiveListResp
- type ArchiveMetaReq
- type ArchiveMetaResp
- type BatchRenameReq
- type BatchTaskRequest
- type DeleteAuthnRequest
- type DirReq
- type DirResp
- type FsGetReq
- type FsGetResp
- type FsListResp
- type FsOtherReq
- type ListReq
- type LoginRequest
- type MkdirOrLinkReq
- type MoveCopyReq
- type ObjResp
- type RecursiveMoveReq
- type RegexRenameReq
- type RemoveEmptyDirectoryReq
- type RemoveReq
- type RenameReq
- type SSHKeyAddReq
- type SearchRequest
- type SearchResponse
- type Set115Req
- type SetAria2Req
- type SetPikPakReq
- type SetQbittorrentReq
- type SetThunderBrowserReq
- type SetThunderReq
- type SetTransmissionReq
- type StringOrArray
- type TaskInfo
- type UpdateIndexReq
- type UpdateUserRequest
- type UserResponse
- type Verify2FARequest
- type WebAuthnCredential
Constants ¶
const ( // CANCEL aborts the operation when a conflict is detected CANCEL = "cancel" // OVERWRITE replaces the existing file/folder with the new one OVERWRITE = "overwrite" // SKIP ignores the current file/folder and continues with the next item SKIP = "skip" )
File operation conflict resolution strategies
const ( PlatformGithub = "Github" PlatformMicrosoft = "Microsoft" PlatformGoogle = "Google" PlatformDingtalk = "Dingtalk" PlatformCasdoor = "Casdoor" PlatformOIDC = "OIDC" )
支持的SSO平台
const ( MethodGetSSOID = "get_sso_id" MethodGetToken = "sso_get_token" )
SSO方法类型
const ( // 会话数据头名称 HeaderSessionData = "Session" // 用户名查询参数 QueryUsername = "username" // 错误消息 ErrWebAuthnNotEnabled = "WebAuthn 未启用" // 成功消息 MsgRegisteredSuccess = "注册成功" MsgDeletedSuccess = "删除成功" )
WebAuthn 相关常量
Variables ¶
This section is empty.
Functions ¶
func AddMyPublicKey ¶
func ArchiveInternalExtract ¶
ArchiveInternalExtract 内部提取归档文件内容
func BeginAuthnLogin ¶
BeginAuthnLogin 开始 WebAuthn 登录流程 支持两种模式: 1. 用户名登录:通过查询参数提供用户名 2. 可发现凭证登录:不提供用户名,由客户端选择凭证
func BeginAuthnRegistration ¶
BeginAuthnRegistration 开始 WebAuthn 注册流程 为当前用户生成注册选项
func BuildIndex ¶
func Cancel2FAById ¶
func ClearIndex ¶
func CreateStorage ¶
func CreateUser ¶
func DelUserCache ¶
func DeleteMyPublicKey ¶
func DeletePublicKey ¶
func DeleteStorage ¶
func DeleteUser ¶
func DisableStorage ¶
func EnableStorage ¶
func FinishAuthnLogin ¶
FinishAuthnLogin 完成 WebAuthn 登录流程 验证客户端提供的凭证,成功后生成登录令牌
func FinishAuthnRegistration ¶
FinishAuthnRegistration 完成 WebAuthn 注册流程 验证并保存客户端提供的凭证
func FsRemoveEmptyDirectory ¶
FsRemoveEmptyDirectory 删除空目录处理函数
func GetAuthnCredentials ¶
GetAuthnCredentials 获取用户的 WebAuthn 凭证列表
func GetDriverInfo ¶
GetDriverInfo returns detailed information about a specific storage driver The driver name must be provided as a query parameter
func GetOIDCClient ¶
func GetOIDCClient(c *gin.Context, useCompatibility bool, redirectUri, method string) (*oauth2.Config, error)
GetOIDCClient 获取OIDC客户端配置
func GetProgress ¶
func GetStorage ¶
func ListDriverInfo ¶
ListDriverInfo returns information about all available storage drivers This includes their configuration options and capabilities
func ListDriverNames ¶
ListDriverNames returns a list of all available storage driver names This is useful for UI components that need to display driver selection options
func ListMyPublicKey ¶
func ListPublicKeys ¶
func ListStorages ¶
func LoadAllStorages ¶
func OfflineDownloadTools ¶
OfflineDownloadTools 获取可用的离线下载工具列表
func Plist ¶
Plist generates an iOS plist file for app installation The link_name parameter is expected to be a base64 encoded string containing URL and name information
func SSOLoginRedirect ¶
SSOLoginRedirect 处理SSO登录重定向 根据不同的SSO平台,构建相应的授权URL并重定向
func UpdateIndex ¶
func UpdateMeta ¶
UpdateMeta updates an existing metadata configuration
func UpdateStorage ¶
func UpdateUser ¶
Types ¶
type AddOfflineDownloadReq ¶
type AddOfflineDownloadReq struct {
Urls []string `json:"urls" binding:"required"`
Path string `json:"path" binding:"required"`
Tool string `json:"tool" binding:"required"`
DeletePolicy string `json:"delete_policy"`
}
AddOfflineDownloadReq 添加离线下载请求
type ArchiveContentResp ¶
type ArchiveContentResp struct {
ObjResp
Children []ArchiveContentResp `json:"children"` // 子项
}
ArchiveContentResp 归档内容响应
type ArchiveDecompressReq ¶
type ArchiveDecompressReq struct {
SrcDir string `json:"src_dir" form:"src_dir" binding:"required"`
DstDir string `json:"dst_dir" form:"dst_dir" binding:"required"`
Name StringOrArray `json:"name" form:"name" binding:"required"`
ArchivePass string `json:"archive_pass" form:"archive_pass"`
InnerPath string `json:"inner_path" form:"inner_path"`
CacheFull bool `json:"cache_full" form:"cache_full"`
PutIntoNewDir bool `json:"put_into_new_dir" form:"put_into_new_dir"`
}
ArchiveDecompressReq 归档文件解压请求参数
type ArchiveListReq ¶
type ArchiveListReq struct {
ArchiveMetaReq
model.PageReq
InnerPath string `json:"inner_path" form:"inner_path"`
}
ArchiveListReq 归档文件列表请求参数
type ArchiveListResp ¶
type ArchiveListResp struct {
Content []ObjResp `json:"content"` // 内容列表
Total int64 `json:"total"` // 总数
}
ArchiveListResp 归档文件列表响应
type ArchiveMetaReq ¶
type ArchiveMetaReq struct {
Path string `json:"path" form:"path" binding:"required"`
Password string `json:"password" form:"password"`
Refresh bool `json:"refresh" form:"refresh"`
ArchivePass string `json:"archive_pass" form:"archive_pass"`
}
ArchiveMetaReq 归档文件元数据请求参数
type ArchiveMetaResp ¶
type ArchiveMetaResp struct {
Comment string `json:"comment"` // 归档文件注释
IsEncrypted bool `json:"encrypted"` // 是否加密
Content []ArchiveContentResp `json:"content"` // 归档内容
Sort *model.Sort `json:"sort,omitempty"` // 排序信息
RawURL string `json:"raw_url"` // 原始URL
Sign string `json:"sign"` // 签名
}
ArchiveMetaResp 归档文件元数据响应
type BatchRenameReq ¶
type BatchRenameReq struct {
SrcDir string `json:"src_dir" binding:"required"` // 源目录
RenameObjects []struct {
SrcName string `json:"src_name" binding:"required"` // 原文件名
NewName string `json:"new_name" binding:"required"` // 新文件名
} `json:"rename_objects" binding:"required"` // 重命名对象列表
}
BatchRenameReq 批量重命名请求参数
type DeleteAuthnRequest ¶
type DeleteAuthnRequest struct {
ID string `json:"id" binding:"required"` // 凭证ID
}
DeleteAuthnRequest WebAuthn 凭证删除请求
type DirReq ¶
type DirReq struct {
Path string `json:"path" form:"path" binding:"required"`
Password string `json:"password" form:"password"`
ForceRoot bool `json:"force_root" form:"force_root"`
}
DirReq 目录请求参数
type FsGetReq ¶
type FsGetReq struct {
Path string `json:"path" form:"path" binding:"required"`
Password string `json:"password" form:"password"`
}
FsGetReq 获取文件请求参数
type FsGetResp ¶
type FsGetResp struct {
ObjResp
RawURL string `json:"raw_url"`
Readme string `json:"readme"`
Header string `json:"header"`
Provider string `json:"provider"`
Related []ObjResp `json:"related"`
}
FsGetResp 获取文件响应结构
type FsListResp ¶
type FsListResp struct {
Content []ObjResp `json:"content"`
Total int64 `json:"total"`
Readme string `json:"readme"`
Header string `json:"header"`
Write bool `json:"write"`
Provider string `json:"provider"`
}
FsListResp 文件列表响应结构
type FsOtherReq ¶
type FsOtherReq struct {
model.FsOtherArgs
Password string `json:"password" form:"password"`
}
FsOtherReq 其他文件系统操作请求参数
type ListReq ¶
type ListReq struct {
model.PageReq
Path string `json:"path" form:"path" binding:"required"`
Password string `json:"password" form:"password"`
Refresh bool `json:"refresh"`
}
ListReq 文件列表请求参数
type LoginRequest ¶
type LoginRequest struct {
Username string `json:"username" binding:"required"`
Password string `json:"password" binding:"required"`
OtpCode string `json:"otp_code"`
}
LoginRequest 登录请求参数
type MkdirOrLinkReq ¶
type MkdirOrLinkReq struct {
Path string `json:"path" form:"path" binding:"required"`
}
MkdirOrLinkReq 创建目录或获取链接请求
type MoveCopyReq ¶
type MoveCopyReq struct {
SrcDir string `json:"src_dir" binding:"required"`
DstDir string `json:"dst_dir" binding:"required"`
Names []string `json:"names" binding:"required"`
Overwrite bool `json:"overwrite"`
}
MoveCopyReq 移动或复制请求
type ObjResp ¶
type ObjResp struct {
Id string `json:"id"`
Path string `json:"path"`
Name string `json:"name"`
Size int64 `json:"size"`
IsDir bool `json:"is_dir"`
Modified time.Time `json:"modified"`
Created time.Time `json:"created"`
Sign string `json:"sign"`
Thumb string `json:"thumb"`
Type int `json:"type"`
HashInfoStr string `json:"hashinfo"`
HashInfo map[*utils.HashType]string `json:"hash_info"`
}
ObjResp 对象响应结构
type RecursiveMoveReq ¶
type RecursiveMoveReq struct {
SrcDir string `json:"src_dir" binding:"required"` // 源目录
DstDir string `json:"dst_dir" binding:"required"` // 目标目录
ConflictPolicy string `json:"conflict_policy" binding:"required"` // 冲突处理策略
}
RecursiveMoveReq 递归移动请求参数
type RegexRenameReq ¶
type RegexRenameReq struct {
SrcDir string `json:"src_dir" binding:"required"` // 源目录
SrcNameRegex string `json:"src_name_regex" binding:"required"` // 源文件名正则表达式
NewNameRegex string `json:"new_name_regex" binding:"required"` // 新文件名正则表达式
}
RegexRenameReq 正则表达式重命名请求参数
type RemoveEmptyDirectoryReq ¶
type RemoveEmptyDirectoryReq struct {
SrcDir string `json:"src_dir" binding:"required"`
}
RemoveEmptyDirectoryReq 删除空目录请求
type RemoveReq ¶
type RemoveReq struct {
Dir string `json:"dir" binding:"required"`
Names []string `json:"names" binding:"required"`
}
RemoveReq 删除文件请求
type RenameReq ¶
type RenameReq struct {
Path string `json:"path" binding:"required"`
Name string `json:"name" binding:"required"`
Overwrite bool `json:"overwrite"`
}
RenameReq 重命名请求
type SSHKeyAddReq ¶
type SearchRequest ¶
SearchRequest extends the base search request with password for accessing protected folders
type SearchResponse ¶
type SearchResponse struct {
model.SearchNode
Type int `json:"type"` // File type for UI rendering
}
SearchResponse extends SearchNode with additional type information for UI rendering
type Set115Req ¶
type Set115Req struct {
TempDir string `json:"temp_dir" form:"temp_dir"`
}
Set115Req 115云设置请求
type SetAria2Req ¶
type SetAria2Req struct {
Uri string `json:"uri" form:"uri" binding:"required"`
Secret string `json:"secret" form:"secret"`
}
SetAria2Req Aria2设置请求
type SetPikPakReq ¶
type SetPikPakReq struct {
TempDir string `json:"temp_dir" form:"temp_dir"`
}
SetPikPakReq PikPak设置请求
type SetQbittorrentReq ¶
type SetQbittorrentReq struct {
Url string `json:"url" form:"url" binding:"required"`
Seedtime string `json:"seedtime" form:"seedtime"`
}
SetQbittorrentReq qBittorrent设置请求
type SetThunderBrowserReq ¶
type SetThunderBrowserReq struct {
TempDir string `json:"temp_dir" form:"temp_dir"`
}
SetThunderBrowserReq 迅雷浏览器设置请求
type SetThunderReq ¶
type SetThunderReq struct {
TempDir string `json:"temp_dir" form:"temp_dir"`
}
SetThunderReq 迅雷设置请求
type SetTransmissionReq ¶
type SetTransmissionReq struct {
Uri string `json:"uri" form:"uri" binding:"required"`
Seedtime string `json:"seedtime" form:"seedtime"`
}
SetTransmissionReq Transmission设置请求
type StringOrArray ¶
type StringOrArray []string
StringOrArray 可以是字符串或字符串数组的类型
func (*StringOrArray) UnmarshalJSON ¶
func (s *StringOrArray) UnmarshalJSON(data []byte) error
UnmarshalJSON 实现JSON反序列化接口
type TaskInfo ¶
type TaskInfo struct {
ID string `json:"id"` // 任务ID
Name string `json:"name"` // 任务名称
Creator string `json:"creator"` // 创建者用户名
CreatorRole int `json:"creator_role"` // 创建者角色
State tache.State `json:"state"` // 任务状态
Status string `json:"status"` // 任务状态描述
Progress float64 `json:"progress"` // 任务进度(0-100)
StartTime *time.Time `json:"start_time"` // 开始时间
EndTime *time.Time `json:"end_time"` // 结束时间
TotalBytes int64 `json:"total_bytes"` // 总字节数
Error string `json:"error"` // 错误信息
}
TaskInfo 任务信息结构体
type UpdateIndexReq ¶
type UpdateUserRequest ¶
type UpdateUserRequest struct {
Username string `json:"username"`
Password string `json:"password"`
SsoID string `json:"sso_id"`
}
UpdateUserRequest 更新用户请求参数
type UserResponse ¶
UserResponse 扩展 User 模型,用于 API 响应
type Verify2FARequest ¶
type Verify2FARequest struct {
Code string `json:"code" binding:"required"`
Secret string `json:"secret" binding:"required"`
}
Verify2FARequest 验证并启用 2FA 的请求参数
type WebAuthnCredential ¶
type WebAuthnCredential struct {
ID []byte `json:"id"` // 凭证ID
FingerPrint string `json:"fingerprint"` // 指纹(AAGUID的十六进制表示)
}
WebAuthnCredential WebAuthn 凭证信息