Documentation ¶
Index ¶
Constants ¶
const ( PanicLevel logrus.Level = iota FatalLevel ErrorLevel WarnLevel InfoLevel DebugLevel TraceLevel )
const GO_DL_SERVER = "https://go.dev/dl"
const LTS = "lts"
Variables ¶
var ( ErrReleaseNotFound = errors.New("release not found") ErrBadResponse = errors.New("github API responde with a non success code") ErrEmptyTags = errors.New("no tags found") ErrHashNotFound = errors.New("release hash not found") ErrHashInvalid = errors.New("release hash doesn't match") )
Functions ¶
func CopyFolder ¶
func UpdateRelease ¶
Types ¶
type Alias ¶
type Alias struct {
// contains filtered or unexported fields
}
func (*Alias) GetAliasVersion ¶
func (*Alias) GetAllAlias ¶
func (*Alias) RenameAlias ¶
func (*Alias) WriteAliasFile ¶
type Aliaser ¶
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
func (*Hash) AddHash ¶
AddHash adds a hash to the hash table by writing the "hashTable" property and the file.
func (*Hash) CompareReleaseHash ¶
CompareReleaseHash compares the hash of the release with the hash in the hash table.
func (*Hash) GetFolderHash ¶
GetFolderHash returns the hash of the folder by using the Merkle tree.
func (*Hash) RemoveHash ¶
RemoveHash removes a hash from the hash table.
func (*Hash) ReplaceHash ¶
ReplaceHash replaces the hash in the hash table with the new hash.
type HashActions ¶
type HashActions interface { GetFolderHash(path string) (string, error) CompareReleaseHash(path string, hash string) error AddHash(path, hash string) error ReplaceHash(path, hash string) error RemoveHash(path string) error // contains filtered or unexported methods }
func NewHash ¶
func NewHash(hashFile string) (HashActions, error)
NewHash returns a new Hash object. It reads the hashes from the ~/.local/doggofetcher/hashes.txt file then loads them into the hash table.
type LoggerFormatter ¶
type LoggerFormatter struct{}
type Release ¶
type Release struct {
// contains filtered or unexported fields
}
func (*Release) CheckReleaseExists ¶
CheckReleaseExists checks if the release exists in doggofetcher folder
func (*Release) DownloadRelease ¶
DownloadRelease downloads the golang release
func (*Release) ExtractRelease ¶
ExtractRelease extracts the golang release
func (*Release) GetReleaseFolder ¶
GetReleaseFolder returns the release folder
type ReleaseActions ¶
type ReleaseActions interface { DownloadRelease() error ExtractRelease() error CheckReleaseExists() error GetReleaseFolder() string // contains filtered or unexported methods }
func NewRelease ¶
func NewRelease(release, releaseFolder string) ReleaseActions
NewRelease returns a Release object
type Tags ¶
type Tags struct {
// contains filtered or unexported fields
}
func (*Tags) GetRelease ¶
GetRelease retrieves tags from "golang/go" and check whether the given release exists in it
Returns the found release or an error