autoupdate

package
v2.2.4 Latest Latest
Warning

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

Go to latest
Published: Aug 21, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

README

energy lib framework auto update

Divided into three modules

  • liblcl
  • enregy
  • cef

Control whether to enable the module update based on enable

Field description

first level node is the module name

download: module download source

url: module download source url template

source: module download source, addrs

sourceSelect: Download the address source selection, select the source based on the index, and replace it with the Url template

enable: module update based on enable

latest: module latest version

versions: version list

forced: forced update, a significant update that applies to the current version

content: update logs


update json template

{
  "liblcl": {
    "download": {
      "url": "https://{url}/energye/energy/releases/download/{version}/{OSARCH}.zip",
      "source": [
        "gitee.com",
        "github.com"
      ],
      "sourceSelect": 0
    },
    "enable": true,
    "latest": "version.1",
    "versions": {
      "version.1": {
        "energyVersion": "version.1",
        "content": [
          "update log 1",
          "update log 2"
        ],
        "forced": false
      },
      "version.0": {
        "energyVersion": "",
        "content": [
          ""
        ],
        "forcede": false
      }
    }
  },
  "energy": {
    "download": {
      "url": "",
      "source": [],
      "sourceSelect": 0
    },
    "enable": false,
    "latest": "",
    "versions": {
      "": {
        "content": [
          ""
        ],
        "forcede": false
      }
    }
  },
  "cef": {
    "download": {
      "url": "",
      "source": [
        ""
      ],
      "sourceSelect": 0
    },
    "enable": false,
    "latest": "",
    "versions": {
      "": {
        "content": [
          ""
        ],
        "forcede": false
      }
    }
  }
}

Documentation

Overview

Package autoupdate Energy lib-lcl check auto update

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckUpdate

func CheckUpdate()

CheckUpdate

Check for updates, when isCheckUpdate is true

func IsCheckUpdate

func IsCheckUpdate(v bool)

IsCheckUpdate

Set whether to check for updates

func LibLCLName added in v2.2.4

func LibLCLName(version, buildSupportOSArch string) (string, bool)

Types

type LiblclCallback

type LiblclCallback func(model *Model, level int, canUpdate bool)
var (
	CanUpdateLiblcl LiblclCallback // 参数 model: 更新模块, Level: 更新版本级别, canUpdate: 是否有更新
)

type Model

type Model struct {
	CurrentVersion string                 `json:"-"`        // 当前版本
	Latest         string                 `json:"latest"`   // 最新版本
	Versions       map[string]VersionInfo `json:"versions"` // 当前模块所有版本集合 key=版本, value=版本信息
}

Model 模块

type VersionInfo

type VersionInfo struct {
	Content              string `json:"content"`              // 更新内容
	DownloadSource       string `json:"downloadSource"`       // 下载源 逗号分隔, 数组 ["gitee.com", "github.com"]
	DownloadSourceSelect int    `json:"downloadSourceSelect"` // 下载源 选择
	DownloadUrl          string `json:"downloadUrl"`          // 下载地址, https://{url}/energye/energy/releases/download/{version}/{OSARCH}.zip
	Module               string `json:"module"`               // 模块名
	BuildSupportOSArch   string `json:"supportOSArch"`        // 已提供构建支持的系统架构
	Version              string `json:"version"`              // 版本
}

版本信息

Jump to

Keyboard shortcuts

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