Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type S3UpdateProvider ¶
type S3UpdateProvider struct { BucketName string ExecutablePath string ChecksumPath string S3Downloader *s3manager.Downloader }
func NewS3UpdateProvider ¶
func NewS3UpdateProvider(bucket string, region string, executable string, checksum string) *S3UpdateProvider
func (*S3UpdateProvider) DownloadTo ¶
func (p *S3UpdateProvider) DownloadTo(file *os.File) error
func (*S3UpdateProvider) Hash ¶
func (p *S3UpdateProvider) Hash() hash.Hash
func (*S3UpdateProvider) RemoteChecksum ¶
func (p *S3UpdateProvider) RemoteChecksum() (string, error)
type SelfUpdater ¶
type SelfUpdater struct { LocalExecutablePath string LocalExecutableChecksum string Provider UpdateProvider }
func NewSelfUpdater ¶
func NewSelfUpdater(provider UpdateProvider) *SelfUpdater
func (*SelfUpdater) CalcFileChecksum ¶
func (s *SelfUpdater) CalcFileChecksum(file string) string
func (*SelfUpdater) Restart ¶
func (s *SelfUpdater) Restart()
func (*SelfUpdater) Update ¶
func (s *SelfUpdater) Update() error
func (*SelfUpdater) UpdateLocalExecutableChecksum ¶
func (s *SelfUpdater) UpdateLocalExecutableChecksum()
type UpdateProvider ¶
type UpdateProvider interface { // Download latest executable file from remote source to the open file descriptor provide by SelfUpdater. DownloadTo(file *os.File) error // Fetch the checksum of the executable file from remote source. RemoteChecksum() (string, error) // Return the hash.Hash interface that should be used to calculate the checksum of executable files. Hash() hash.Hash }
Click to show internal directories.
Click to hide internal directories.