Documentation
¶
Index ¶
- func GetNextDir(wholePath string, basePath string) string
- func IsAncestorDir(parentDir string, targetDir string) bool
- type Addition
- type Asset
- type File
- type FileInfo
- type GithubReleases
- func (d *GithubReleases) Config() driver.Config
- func (d *GithubReleases) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *GithubReleases) Drop(ctx context.Context) error
- func (d *GithubReleases) GetAddition() driver.Additional
- func (d *GithubReleases) GetRequest(url string) (*resty.Response, error)
- func (d *GithubReleases) Init(ctx context.Context) error
- func (d *GithubReleases) Link(ctx context.Context, file model.Obj, args model.LinkArgs) (*model.Link, error)
- func (d *GithubReleases) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)
- func (d *GithubReleases) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)
- func (d *GithubReleases) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)
- func (d *GithubReleases) ParseRepos(text string) ([]MountPoint, error)
- func (d *GithubReleases) Remove(ctx context.Context, obj model.Obj) error
- func (d *GithubReleases) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)
- type MountPoint
- func (m *MountPoint) GetAllVersion() []File
- func (m *MountPoint) GetAllVersionSize() int64
- func (m *MountPoint) GetLatestRelease() []File
- func (m *MountPoint) GetLatestSize() int64
- func (m *MountPoint) GetOtherFile(get func(url string) (*resty.Response, error), refresh bool) []File
- func (m *MountPoint) GetReleaseByTagName(tagName string) []File
- func (m *MountPoint) GetSizeByTagName(tagName string) int64
- func (m *MountPoint) RequestRelease(get func(url string) (*resty.Response, error), refresh bool)
- func (m *MountPoint) RequestReleases(get func(url string) (*resty.Response, error), refresh bool)
- type Reactions
- type Release
- type User
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Addition ¶
type Addition struct {
driver.RootID
RepoStructure string `json:"repo_structure" type:"text" required:"true" default:"OpenListTeam/OpenList" help:"structure:[path:]org/repo"`
ShowReadme bool `json:"show_readme" type:"bool" default:"true" help:"show README、LICENSE file"`
Token string `` /* 134-byte string literal not displayed */
ShowAllVersion bool `json:"show_all_version" type:"bool" default:"false" help:"show all versions"`
GitHubProxy string `` /* 133-byte string literal not displayed */
}
type Asset ¶
type Asset struct {
Url string `json:"url"`
Id int `json:"id"`
NodeId string `json:"node_id"`
Name string `json:"name"`
Label string `json:"label"`
Uploader User `json:"uploader"`
ContentType string `json:"content_type"`
State string `json:"state"`
Size int64 `json:"size"`
DownloadCount int `json:"download_count"`
CreatedAt string `json:"created_at"`
UpdatedAt string `json:"updated_at"`
BrowserDownloadUrl string `json:"browser_download_url"`
}
type File ¶
type File struct {
Path string // 文件路径
FileName string // 文件名
Size int64 // 文件大小
Type string // 文件类型
UpdateAt string // 更新时间 eg:"2025-01-27T16:10:16Z"
CreateAt string // 创建时间
Url string // 下载链接
}
func (File) CreateTime ¶
type GithubReleases ¶
func (*GithubReleases) Config ¶
func (d *GithubReleases) Config() driver.Config
func (*GithubReleases) GetAddition ¶
func (d *GithubReleases) GetAddition() driver.Additional
func (*GithubReleases) GetRequest ¶
func (d *GithubReleases) GetRequest(url string) (*resty.Response, error)
发送 GET 请求
func (*GithubReleases) ParseRepos ¶
func (d *GithubReleases) ParseRepos(text string) ([]MountPoint, error)
解析挂载结构
type MountPoint ¶
type MountPoint struct {
Point string // 挂载点
Repo string // 仓库名 owner/repo
Release *Release // Release 指针 latest
Releases *[]Release // []Release 指针
OtherFile *[]FileInfo // 仓库根目录下的其他文件
}
func (*MountPoint) GetOtherFile ¶
func (*MountPoint) GetReleaseByTagName ¶
func (m *MountPoint) GetReleaseByTagName(tagName string) []File
根据版本号获取版本
func (*MountPoint) GetSizeByTagName ¶
func (m *MountPoint) GetSizeByTagName(tagName string) int64
根据版本号获取版本大小
func (*MountPoint) RequestRelease ¶
请求最新版本
func (*MountPoint) RequestReleases ¶
请求所有版本
type Release ¶
type Release struct {
Url string `json:"url"`
AssetsUrl string `json:"assets_url"`
UploadUrl string `json:"upload_url"`
HtmlUrl string `json:"html_url"`
Id int `json:"id"`
Author User `json:"author"`
NodeId string `json:"node_id"`
TagName string `json:"tag_name"`
TargetCommitish string `json:"target_commitish"`
Name string `json:"name"`
Draft bool `json:"draft"`
Prerelease bool `json:"prerelease"`
CreatedAt string `json:"created_at"`
PublishedAt string `json:"published_at"`
Assets []Asset `json:"assets"`
TarballUrl string `json:"tarball_url"`
ZipballUrl string `json:"zipball_url"`
Body string `json:"body"`
Reactions Reactions `json:"reactions"`
}
type User ¶
type User struct {
Login string `json:"login"`
Id int `json:"id"`
NodeId string `json:"node_id"`
AvatarUrl string `json:"avatar_url"`
GravatarId string `json:"gravatar_id"`
Url string `json:"url"`
HtmlUrl string `json:"html_url"`
FollowersUrl string `json:"followers_url"`
FollowingUrl string `json:"following_url"`
GistsUrl string `json:"gists_url"`
StarredUrl string `json:"starred_url"`
SubscriptionsUrl string `json:"subscriptions_url"`
OrganizationsUrl string `json:"organizations_url"`
ReposUrl string `json:"repos_url"`
EventsUrl string `json:"events_url"`
ReceivedEventsUrl string `json:"received_events_url"`
Type string `json:"type"`
UserViewType string `json:"user_view_type"`
SiteAdmin bool `json:"site_admin"`
}
Click to show internal directories.
Click to hide internal directories.