update

package
v0.0.0-...-9317598 Latest Latest
Warning

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

Go to latest
Published: Apr 17, 2015 License: GPL-3.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	FilePerm         = 0640
	DirectoryPerm    = 0750
	CheckSumPostix   = ".sha256"
	TempPostix       = ".tmp"
	SignatirePostfix = ".sig"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Error

type Error struct {

	// Error message
	HTTPStatus string

	// The request sent to the server
	Request string
}

Error represents an Error reported in the HTTP session.

func (*Error) Error

func (e *Error) Error() string

Error returns a string representation of the HTTP error

type Update

type Update struct {

	// Path to file
	FileName string

	// URL of update
	URL string

	// Checksum of remote file
	CheckSum []byte

	// Signature of file
	Signature []byte
}

func New

func New() *Update

func (*Update) Check

func (u *Update) Check() (ok bool, err error)

Check for updates to file. Returns true for updates and false for no updates

func (*Update) Fetch

func (u *Update) Fetch() (b []byte, err error)

func (*Update) GetCheckSum

func (u *Update) GetCheckSum() ([]byte, error)

func (*Update) GetSignature

func (u *Update) GetSignature() ([]byte, error)

func (*Update) Update

func (u *Update) Update() (err error)

func (*Update) UpdateExec

func (u *Update) UpdateExec() (err error)

Jump to

Keyboard shortcuts

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