github_releases

package
v3.42.0 Latest Latest
Warning

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

Go to latest
Published: Jan 27, 2025 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ClearCache

func ClearCache()

func GetAllVersion

func GetAllVersion(repo string, path string) (*[]Release, error)

获取所有的版本号

func GetGithubOtherFile

func GetGithubOtherFile(repo string, basePath string, cacheExpiration int) (*[]File, error)

获取 README、LICENSE 等文件

func GetNextDir

func GetNextDir(wholePath string, basePath string) string

获取下一级目录

func GetRequest

func GetRequest(url string, cacheExpiration int) (*resty.Response, error)

发送 GET 请求

func SetHeader

func SetHeader(token string)

Types

type Addition

type Addition struct {
	driver.RootID
	RepoStructure  string `` /* 166-byte string literal not displayed */
	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"`
}

type File

type File struct {
	FileName string    `json:"name"`
	Size     int64     `json:"size"`
	CreateAt time.Time `json:"time"`
	UpdateAt time.Time `json:"chtime"`
	Url      string    `json:"url"`
	Type     string    `json:"type"`
	Path     string    `json:"path"`
}

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

func (File) Thumb

func (f File) Thumb() string

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) 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) Put

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 Release

type Release struct {
	Path     string // 挂载路径
	RepoName string // 仓库名称
	Version  string // 版本号, tag
	ID       string // 版本ID
}

func ParseRepos

func ParseRepos(text string, allVersion bool) ([]Release, error)

解析仓库列表

type ReleasesData

type ReleasesData struct {
	Files    []File    `json:"files"`
	Size     int64     `json:"size"`
	UpdateAt time.Time `json:"chtime"`
	CreateAt time.Time `json:"time"`
	Url      string    `json:"url"`
}

func GetRepoReleaseInfo

func GetRepoReleaseInfo(repo string, version string, basePath string, cacheExpiration int) (*ReleasesData, error)

获取 GitHub Release 详细信息

Jump to

Keyboard shortcuts

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