github_releases

package
v4.1.8 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 25, 2025 License: AGPL-3.0 Imports: 15 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetNextDir

func GetNextDir(wholePath string, basePath string) string

获取下一级目录

func IsAncestorDir

func IsAncestorDir(parentDir string, targetDir string) bool

判断当前目录是否是目标目录的祖先目录

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 */
	ShowSourceCode bool   `json:"show_source_code" type:"bool" default:"false" help:"show Source code (zip/tar.gz)"`
	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

func (f File) CreateTime() time.Time

func (File) GetHash

func (f File) GetHash() utils.HashInfo

func (File) GetID

func (f File) GetID() string

func (File) GetName

func (f File) GetName() string

func (File) GetPath

func (f File) GetPath() string

func (File) GetSize

func (f File) GetSize() int64

func (File) IsDir

func (f File) IsDir() bool

func (File) ModTime

func (f File) ModTime() time.Time

type FileInfo

type FileInfo struct {
	Name        string `json:"name"`
	Path        string `json:"path"`
	Sha         string `json:"sha"`
	Size        int64  `json:"size"`
	Url         string `json:"url"`
	HtmlUrl     string `json:"html_url"`
	GitUrl      string `json:"git_url"`
	DownloadUrl string `json:"download_url"`
	Type        string `json:"type"`
}

type GithubReleases

type GithubReleases struct {
	model.Storage
	Addition
	// contains filtered or unexported fields
}

func (*GithubReleases) Config

func (d *GithubReleases) Config() driver.Config

func (*GithubReleases) Copy

func (d *GithubReleases) Copy(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*GithubReleases) Drop

func (d *GithubReleases) Drop(ctx context.Context) error

func (*GithubReleases) GetAddition

func (d *GithubReleases) GetAddition() driver.Additional

func (*GithubReleases) GetRequest

func (d *GithubReleases) GetRequest(url string) (*resty.Response, error)

发送 GET 请求

func (*GithubReleases) Init

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 (*GithubReleases) List

func (d *GithubReleases) List(ctx context.Context, dir model.Obj, args model.ListArgs) ([]model.Obj, error)

func (*GithubReleases) MakeDir

func (d *GithubReleases) MakeDir(ctx context.Context, parentDir model.Obj, dirName string) (model.Obj, error)

func (*GithubReleases) Move

func (d *GithubReleases) Move(ctx context.Context, srcObj, dstDir model.Obj) (model.Obj, error)

func (*GithubReleases) ParseRepos

func (d *GithubReleases) ParseRepos(text string) ([]MountPoint, error)

解析挂载结构

func (*GithubReleases) Remove

func (d *GithubReleases) Remove(ctx context.Context, obj model.Obj) error

func (*GithubReleases) Rename

func (d *GithubReleases) Rename(ctx context.Context, srcObj model.Obj, newName string) (model.Obj, error)

type MountPoint

type MountPoint struct {
	Point     string      // 挂载点
	Repo      string      // 仓库名 owner/repo
	Release   *Release    // Release 指针 latest
	Releases  *[]Release  // []Release 指针
	OtherFile *[]FileInfo // 仓库根目录下的其他文件
}

func (*MountPoint) GetAllVersion

func (m *MountPoint) GetAllVersion() []File

获取所有版本

func (*MountPoint) GetAllVersionSize

func (m *MountPoint) GetAllVersionSize() int64

获取所有版本大小

func (*MountPoint) GetLatestRelease

func (m *MountPoint) GetLatestRelease() []File

获取最新版本

func (*MountPoint) GetLatestSize

func (m *MountPoint) GetLatestSize() int64

获取最新版本大小

func (*MountPoint) GetOtherFile

func (m *MountPoint) GetOtherFile(get func(url string) (*resty.Response, error), refresh bool) []File

func (*MountPoint) GetReleaseByTagName

func (m *MountPoint) GetReleaseByTagName(tagName string) []File

根据版本号获取版本

func (*MountPoint) GetSizeByTagName

func (m *MountPoint) GetSizeByTagName(tagName string) int64

根据版本号获取版本大小

func (*MountPoint) GetSourceCode added in v4.1.7

func (m *MountPoint) GetSourceCode() []File

func (*MountPoint) GetSourceCodeByTagName added in v4.1.7

func (m *MountPoint) GetSourceCodeByTagName(tagName string) []File

func (*MountPoint) RequestRelease

func (m *MountPoint) RequestRelease(get func(url string) (*resty.Response, error), refresh bool)

请求最新版本

func (*MountPoint) RequestReleases

func (m *MountPoint) RequestReleases(get func(url string) (*resty.Response, error), refresh bool)

请求所有版本

type Reactions

type Reactions struct {
	Url        string `json:"url"`
	TotalCount int    `json:"total_count"`
	PlusOne    int    `json:"+1"`
	MinusOne   int    `json:"-1"`
	Laugh      int    `json:"laugh"`
	Hooray     int    `json:"hooray"`
	Confused   int    `json:"confused"`
	Heart      int    `json:"heart"`
	Rocket     int    `json:"rocket"`
	Eyes       int    `json:"eyes"`
}

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"`
}

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL