safing-portmaster/updates/file.go
2019-07-04 13:54:51 +02:00

47 lines
1,005 B
Go

package updates
// File represents a file from the update system.
type File struct {
filepath string
version string
stable bool
}
// NewFile combines update file attributes into an easy to use object.
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() {
}