api

package
v3.2.0 Latest Latest
Warning

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

Go to latest
Published: Apr 9, 2026 License: BSD-3-Clause Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	// contains filtered or unexported fields
}

func NewAPI

func NewAPI(panelVersion, locale string, url ...string) *API

func (*API) AppBySlug

func (r *API) AppBySlug(slug string) (*App, error)

AppBySlug 根据slug返回应用

func (*API) AppCallback

func (r *API) AppCallback(slug string) error

AppCallback 应用下载回调

func (*API) Apps

func (r *API) Apps() (*Apps, error)

Apps 返回所有应用

func (*API) Categories

func (r *API) Categories() (*Categories, error)

Categories 返回所有分类

func (*API) EnvironmentCallback

func (r *API) EnvironmentCallback(typ, slug string) error

EnvironmentCallback 环境下载回调

func (*API) Environments

func (r *API) Environments() (*Environments, error)

Environments 返回所有环境

func (*API) GoogleEAB

func (r *API) GoogleEAB() (*EAB, error)

func (*API) IntermediateVersions

func (r *API) IntermediateVersions(channel string) (*Versions, error)

IntermediateVersions 返回当前版本之后的所有版本

func (*API) LatestVersion

func (r *API) LatestVersion(channel string) (*Version, error)

LatestVersion 返回最新版本

func (*API) TemplateBySlug

func (r *API) TemplateBySlug(slug string) (*Template, error)

TemplateBySlug 根据slug返回模版

func (*API) TemplateCallback

func (r *API) TemplateCallback(slug string) error

TemplateCallback 模版下载回调

func (*API) Templates

func (r *API) Templates() (*Templates, error)

Templates 返回所有模版

type App

type App struct {
	CreatedAt   time.Time `json:"created_at"`
	UpdatedAt   time.Time `json:"updated_at"`
	Slug        string    `json:"slug"`
	Name        string    `json:"name"`
	Description string    `json:"description"`
	Categories  []string  `json:"categories"`
	Depends     string    `json:"depends"` // 依赖表达式
	Channels    []struct {
		Slug      string `json:"slug"`      // 渠道代号
		Name      string `json:"name"`      // 渠道名称
		Panel     string `json:"panel"`     // 最低支持面板版本
		Install   string `json:"install"`   // 安装脚本
		Uninstall string `json:"uninstall"` // 卸载脚本
		Update    string `json:"update"`    // 更新脚本
		Version   string `json:"version"`   // 版本号
		Log       string `json:"log"`       // 更新日志
	} `json:"channels"`
	Order int `json:"order"`
}

type Apps

type Apps []*App

type Categories

type Categories []*Category

type Category

type Category struct {
	Slug  string `json:"slug"`
	Name  string `json:"name"`
	Order int    `json:"order"`
}

type EAB

type EAB struct {
	KeyID  string `json:"key_id"`
	MacKey string `json:"mac_key"`
}

type Environment

type Environment struct {
	Type        string `json:"type"`
	Slug        string `json:"slug"`
	Name        string `json:"name"`
	Version     string `json:"version"`
	Description string `json:"description"`
}

type Environments

type Environments []*Environment

type Response

type Response struct {
	Message string `json:"message"`
	Data    any    `json:"data"`
}

type Template

type Template struct {
	CreatedAt     time.Time `json:"created_at"`
	UpdatedAt     time.Time `json:"updated_at"`
	Slug          string    `json:"slug"`
	Icon          string    `json:"icon"`
	Name          string    `json:"name"`
	Description   string    `json:"description"`
	Website       string    `json:"website"`
	Categories    []string  `json:"categories"`
	Architectures []string  `json:"architectures"`
	Compose       string    `json:"compose"`
	Environments  []struct {
		Name        string            `json:"name"`              // 变量名
		Description string            `json:"description"`       // 变量描述
		Type        string            `json:"type"`              // 变量类型, text, password, number, port, select
		Options     map[string]string `json:"options,omitempty"` // 下拉框选项,key -> value
		Default     any               `json:"default,omitempty"` // 默认值,string or number
	} `json:"environments"`
	Local bool `json:"local"` // 是否为本地模板
}

type Templates

type Templates []*Template

func (Templates) FilterByCategory

func (t Templates) FilterByCategory(category string) Templates

FilterByCategory 按分类过滤模版

func (Templates) FilterByQuery added in v3.2.0

func (t Templates) FilterByQuery(query string) Templates

FilterByQuery 按关键词过滤模版

type Version

type Version struct {
	CreatedAt   time.Time         `json:"created_at"`
	UpdatedAt   time.Time         `json:"updated_at"`
	Type        string            `json:"type"`
	Version     string            `json:"version"`
	Description string            `json:"description"`
	Downloads   []VersionDownload `json:"downloads"`
}

type VersionDownload

type VersionDownload struct {
	URL      string `json:"url"`
	Arch     string `json:"arch"`
	Checksum string `json:"checksum"`
}

type Versions

type Versions []Version

Jump to

Keyboard shortcuts

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