service

package
v0.0.0-...-77baf9d Latest Latest
Warning

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

Go to latest
Published: Feb 23, 2023 License: AGPL-3.0 Imports: 20 Imported by: 0

Documentation

Index

Constants

View Source
const GithubLatestReleaseAPI = "https://api.github.com/repos/0xJacky/nginx-ui/releases/latest"

Variables

This section is empty.

Functions

This section is empty.

Types

type ConfigDetail

type ConfigDetail struct {
	Custom string `json:"custom"`
	nginx.NgxServer
}

func ParseTemplate

func ParseTemplate(path, name string) (c ConfigDetail, err error)

type ConfigInfoItem

type ConfigInfoItem struct {
	Name        string            `json:"name"`
	Description map[string]string `json:"description"`
	Author      string            `json:"author"`
	Filename    string            `json:"filename"`
}

func GetTemplateInfo

func GetTemplateInfo(path, name string) (configListItem ConfigInfoItem)

func GetTemplateList

func GetTemplateList(path string) (configList []ConfigInfoItem, err error)

type CurVersion

type CurVersion struct {
	Version    string `json:"version"`
	BuildID    int    `json:"build_id"`
	TotalBuild int    `json:"total_build"`
}

func GetCurrentVersion

func GetCurrentVersion() (c CurVersion, err error)

type RuntimeInfo

type RuntimeInfo struct {
	OS     string `json:"os"`
	Arch   string `json:"arch"`
	ExPath string `json:"ex_path"`
}

func GetRuntimeInfo

func GetRuntimeInfo() (r RuntimeInfo, err error)

type TRelease

type TRelease struct {
	TagName     string          `json:"tag_name"`
	Name        string          `json:"name"`
	PublishedAt time.Time       `json:"published_at"`
	Body        string          `json:"body"`
	Assets      []TReleaseAsset `json:"assets"`
	RuntimeInfo
}

func GetRelease

func GetRelease() (data TRelease, err error)

type TReleaseAsset

type TReleaseAsset struct {
	Name               string `json:"name"`
	BrowserDownloadUrl string `json:"browser_download_url"`
	Size               uint   `json:"size"`
}

type Upgrader

type Upgrader struct {
	Release TRelease
}

func NewUpgrader

func NewUpgrader() (u *Upgrader, err error)

func (*Upgrader) DownloadLatestRelease

func (u *Upgrader) DownloadLatestRelease() (tarName string, err error)

func (*Upgrader) PerformCoreUpgrade

func (u *Upgrader) PerformCoreUpgrade(dir, tarPath string) (err error)

Jump to

Keyboard shortcuts

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