2023-12-06 15:24:02 +01:00
|
|
|
<!-- Code generated by gomarkdoc. DO NOT EDIT -->
|
|
|
|
|
|
|
|
# update
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
```go
|
2023-12-06 15:24:02 +01:00
|
|
|
import "katenary/update"
|
|
|
|
```
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
Update package is used to check if a new version of katenary is available.
|
2023-12-06 15:24:02 +01:00
|
|
|
|
|
|
|
## Variables
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
<a name="Version"></a>
|
|
|
|
|
|
|
|
```go
|
|
|
|
var (
|
|
|
|
Version = "master" // reset by cmd/main.go
|
|
|
|
)
|
2023-12-06 15:24:02 +01:00
|
|
|
```
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
<a name="DownloadFile"></a>
|
|
|
|
## func [DownloadFile](<https://github.com/metal3d/katenary/blob/develop/update/main.go#L134>)
|
2023-12-06 15:24:02 +01:00
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
```go
|
2023-12-06 15:24:02 +01:00
|
|
|
func DownloadFile(url, exe string) error
|
|
|
|
```
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
DownloadFile will download a url to a local file. It also ensure that the file is executable.
|
2023-12-06 15:24:02 +01:00
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
<a name="DownloadLatestVersion"></a>
|
|
|
|
## func [DownloadLatestVersion](<https://github.com/metal3d/katenary/blob/develop/update/main.go#L80>)
|
2023-12-06 15:24:02 +01:00
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
```go
|
2023-12-06 15:24:02 +01:00
|
|
|
func DownloadLatestVersion(assets []Asset) error
|
|
|
|
```
|
|
|
|
|
|
|
|
DownloadLatestVersion will download the latest version of katenary.
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
<a name="Asset"></a>
|
|
|
|
## type [Asset](<https://github.com/metal3d/katenary/blob/develop/update/main.go#L23-L26>)
|
2023-12-06 15:24:02 +01:00
|
|
|
|
|
|
|
Asset is a github asset from release url.
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
```go
|
2023-12-06 15:24:02 +01:00
|
|
|
type Asset struct {
|
|
|
|
Name string `json:"name"`
|
|
|
|
URL string `json:"browser_download_url"`
|
|
|
|
}
|
|
|
|
```
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
<a name="CheckLatestVersion"></a>
|
|
|
|
### func [CheckLatestVersion](<https://github.com/metal3d/katenary/blob/develop/update/main.go#L29>)
|
2023-12-06 15:24:02 +01:00
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
```go
|
2023-12-06 15:24:02 +01:00
|
|
|
func CheckLatestVersion() (string, []Asset, error)
|
|
|
|
```
|
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
CheckLatestVersion check katenary latest version from release and propose to download it
|
2023-12-06 15:24:02 +01:00
|
|
|
|
2024-04-10 04:51:45 +02:00
|
|
|
Generated by [gomarkdoc](<https://github.com/princjef/gomarkdoc>)
|