Add updates module and fix issues

This commit is contained in:
Daniel
2019-01-24 15:23:02 +01:00
parent bde81d815d
commit 20af9efecc
22 changed files with 953 additions and 96 deletions

46
updates/file.go Normal file
View File

@@ -0,0 +1,46 @@
package updates
// File represents a file from the update system.
type File struct {
filepath string
version string
stable bool
}
func newFile(filepath string, version string, stable bool) *File {
return &File{
filepath: filepath,
version: version,
stable: stable,
}
}
// Path returns the filepath of the file.
func (f *File) Path() string {
return f.filepath
}
// Version returns the version of the file.
func (f *File) Version() string {
return f.version
}
// Stable returns whether the file is from a stable release.
func (f *File) Stable() bool {
return f.stable
}
// Open opens the file and returns the
func (f *File) Open() {
}
// ReportError reports an error back to Safing. This will not automatically blacklist the file.
func (f *File) ReportError() {
}
// Blacklist notifies the update system that this file is somehow broken, and should be ignored from now on.
func (f *File) Blacklist() {
}