Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/minio/selfupdate
Build self-updating Go programs
https://github.com/minio/selfupdate
Last synced: 11 days ago
JSON representation
Build self-updating Go programs
- Host: GitHub
- URL: https://github.com/minio/selfupdate
- Owner: minio
- License: apache-2.0
- Created: 2020-07-21T22:44:05.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2023-12-01T13:33:56.000Z (7 months ago)
- Last Synced: 2024-04-15T01:24:44.983Z (2 months ago)
- Language: Go
- Size: 113 KB
- Stars: 614
- Watchers: 10
- Forks: 38
- Open Issues: 3
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Lists
- go-awesome - selfupdate - 二进制文件自动升级 (开源类库 / 优雅升级)
- go-awesome - selfupdate - Binary automatic update (Open source library / Elegant Upgrade)
- go-awesome - selfupdate - 二进制文件自动升级 (开源类库 / 优雅升级)
README
[![API Reference](https://img.shields.io/badge/api-reference-blue.svg)](https://pkg.go.dev/github.com/minio/selfupdate?tab=doc) [![Apache V2 License](https://img.shields.io/badge/license-Apache%20V2-blue.svg)](https://github.com/minio/selfupdate/blob/master/LICENSE)
# selfupdate: Build self-updating Go programs
> NOTE: Original work at github.com/inconshreveable/go-update, modified for the needs within MinIO project
Package update provides functionality to implement secure, self-updating Go programs (or other single-file targets)
A program can update itself by replacing its executable file with a new version.It provides the flexibility to implement different updating user experiences
like auto-updating, or manual user-initiated updates. It also boasts
advanced features like binary patching and code signing verification.Example of updating from a URL:
```go
import (
"fmt"
"net/http""github.com/minio/selfupdate"
)func doUpdate(url string) error {
resp, err := http.Get(url)
if err != nil {
return err
}
defer resp.Body.Close()
err = selfupdate.Apply(resp.Body, selfupdate.Options{})
if err != nil {
// error handling
}
return err
}
```## Features
- Cross platform support (Windows too!)
- Binary patch application
- Checksum verification
- Code signing verification
- Support for updating arbitrary files## License
This SDK is distributed under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0), see LICENSE for more information. Original work was also distributed under the same license.