service

package
v1.8.0 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2023 License: AGPL-3.0 Imports: 25 Imported by: 2

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, bindData map[string]TVariable) (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"`
	Variables   map[string]TVariable `json:"variables"`
}

func GetTemplateInfo

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

func GetTemplateList

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

type CurVersion added in v1.7.2

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

func GetCurrentVersion added in v1.7.2

func GetCurrentVersion() (c CurVersion, err error)

type ProgressWriter added in v1.8.0

type ProgressWriter struct {
	io.Writer
	// contains filtered or unexported fields
}

func (*ProgressWriter) Write added in v1.8.0

func (pw *ProgressWriter) Write(p []byte) (int, error)

type RuntimeInfo added in v1.7.2

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

func GetRuntimeInfo added in v1.7.2

func GetRuntimeInfo() (r RuntimeInfo, err error)

type TRelease added in v1.7.2

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 added in v1.7.2

func GetRelease() (data TRelease, err error)

type TReleaseAsset added in v1.7.2

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

type TVariable added in v1.8.0

type TVariable struct {
	Type  string            `json:"type"`
	Name  map[string]string `json:"name"`
	Value interface{}       `json:"value"`
}

type Upgrader added in v1.7.2

type Upgrader struct {
	Release TRelease
}

func NewUpgrader added in v1.7.2

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

func (*Upgrader) DownloadLatestRelease added in v1.7.2

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

func (*Upgrader) PerformCoreUpgrade added in v1.7.2

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

Jump to

Keyboard shortcuts

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