github.com/staktrace/go-update@v0.0.0-20210525161054-fc019945f9a2/README.md (about)

     1  # go-update: Build self-updating Go programs
     2  
     3  Package update provides functionality to implement secure, self-updating Go programs (or other single-file targets)
     4  A program can update itself by replacing its executable file with a new version.
     5  
     6  It provides the flexibility to implement different updating user experiences
     7  like auto-updating, or manual user-initiated updates. It also boasts
     8  advanced features like binary patching and code signing verification.
     9  
    10  Example of updating from a URL:
    11  
    12  ```go
    13  import (
    14      "fmt"
    15      "net/http"
    16  
    17      "github.com/staktrace/go-update"
    18  )
    19  
    20  func doUpdate(url string) error {
    21      resp, err := http.Get(url)
    22      if err != nil {
    23          return err
    24      }
    25      defer resp.Body.Close()
    26      err := update.Apply(resp.Body, update.Options{})
    27      if err != nil {
    28          // error handling
    29      }
    30      return err
    31  }
    32  ```
    33  
    34  ## Features
    35  
    36  - Cross platform support (Windows too!)
    37  - Binary patch application
    38  - Checksum verification
    39  - Code signing verification
    40  - Support for updating arbitrary files
    41  
    42  ## [equinox.io](https://equinox.io)
    43  [equinox.io](https://equinox.io) is a complete ready-to-go updating solution built on top of go-update that provides:
    44  
    45  - Hosted updates
    46  - Update channels (stable, beta, nightly, ...)
    47  - Dynamically computed binary diffs
    48  - Automatic key generation and code
    49  - Release tooling with proper code signing
    50  - Update/download metrics
    51  
    52  ## API Compatibility Promises
    53  The master branch of `go-update` is *not* guaranteed to have a stable API over time. For any production application, you should vendor
    54  your dependency on `go-update` with a tool like git submodules, [gb](http://getgb.io/) or [govendor](https://github.com/kardianos/govendor).
    55  
    56  The `go-update` package makes the following promises about API compatibility:
    57  1. A list of all API-breaking changes will be documented in this README.
    58  1. `go-update` will strive for as few API-breaking changes as possible.
    59  
    60  ## API Breaking Changes
    61  - **Sept 3, 2015**: The `Options` struct passed to `Apply` was changed to be passed by value instead of passed by pointer. Old API at `28de026`.
    62  - **Aug 9, 2015**: 2.0 API. Old API at `221d034` or `gopkg.in/inconshreveable/go-update.v0`.
    63  
    64  ## Project History
    65  
    66  This project originally lived at https://github.com/inconshreveable/go-update. However, due to being unmaintained, it was forked to
    67  https://github.com/staktrace/go-update.
    68  
    69  ## License
    70  Apache