helper

package
v0.16.1 Latest Latest
Warning

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

Go to latest
Published: Oct 25, 2022 License: MIT Imports: 20 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetExtractor

func GetExtractor() interfaces.IExtractor

GetExtractor ...

func ProvideHelper

func ProvideHelper(logger interfaces.ILogger) interfaces.IHelper

ProvideHelper ...

func ProvideNetworker

func ProvideNetworker(logger interfaces.ILogger) interfaces.INetworker

ProvideNetworker ...

func ProvideUpdater

func ProvideUpdater(logger interfaces.ILogger, networker interfaces.INetworker) interfaces.IUpdater

ProvideNetworker ...

Types

type Category

type Category struct {
	Targets map[string]Target `yaml:"target"`
}

Category ...

type Connection

type Connection struct {
	Endpoint string
	TimeOut  int
	Success  bool
}

Connection ...

type DownloadMetadata

type DownloadMetadata struct {
	Author       string
	Description  string
	Md5          string
	Released     time.Time
	Size         int
	URL          string
	ReleaseNotes string
}

DownloadMetadata ...

type Extractor

type Extractor struct {
}

Extractor ...

func (*Extractor) GetCore

func (h *Extractor) GetCore(i interface{}) interfaces.ICore

ExtractProfile ...

func (*Extractor) GetMetadata

func (h *Extractor) GetMetadata(m map[string]interface{}, key string, container interface{}) error

GetMetadata ...

func (*Extractor) GetMetadataFatal

func (h *Extractor) GetMetadataFatal(m map[string]interface{}, key string, container interface{})

ExtractMetadataFatal calls ExtractMetadata but fails fataly before returning to caller if extraction has error this allows for less lines in calling code for essential extractions that would need to interrupt the application anyways

type Helper

type Helper struct {
	// contains filtered or unexported fields
}

Helper ...

func (*Helper) CatchOutput

func (h *Helper) CatchOutput(script string, silent bool, args ...string) (string, error)

func (*Helper) CheckFlag

func (h *Helper) CheckFlag(flag string) bool

CheckFlag ...

func (*Helper) CheckFlagArg

func (h *Helper) CheckFlagArg(flag string) string

CheckFlagArg ...

func (*Helper) CheckOrCreateFolder

func (h *Helper) CheckOrCreateFolder(pathToCheck string, permissions os.FileMode)

CheckOrCreateFolder ...

func (*Helper) CheckOrCreateParentFolder

func (h *Helper) CheckOrCreateParentFolder(pathToCheck string, permissions os.FileMode)

CheckOrCreateParentFolder ...

func (*Helper) CheckUserProfile

func (h *Helper) CheckUserProfile() string

CheckUserProfile ...

func (*Helper) CurrentWorkdir

func (h *Helper) CurrentWorkdir(i ...string) string

CurrentWorkdir ...

func (*Helper) HomeDir

func (h *Helper) HomeDir(i ...string) string

HomeDir ...

func (*Helper) LoadBootConfig

func (h *Helper) LoadBootConfig() *interfaces.Bootconfig

LoadBootConfig ...

func (*Helper) PathExists

func (h *Helper) PathExists(path string) bool

PathExists ...

func (*Helper) ReadFile

func (h *Helper) ReadFile(path string) ([]byte, error)

func (*Helper) UpdateOrWriteFile

func (h *Helper) UpdateOrWriteFile(path string, content []byte, permissions os.FileMode) error

type IndexObject

type IndexObject struct {
	Releases map[string]Category `yaml:"category"`
}

IndexObject ...

type Networker

type Networker struct {
	// contains filtered or unexported fields
}

Networker ...

func (*Networker) CheckConnections

func (n *Networker) CheckConnections(conns map[string]interface{})

CheckConnections ...

func (*Networker) Load

func (n *Networker) Load(filepath string, url string) error

Load ...

type Target

type Target struct {
	Versions map[string]DownloadMetadata `yaml:"version"`
}

type Updater

type Updater struct {
	// contains filtered or unexported fields
}

func (*Updater) CheckSinceLastUpdate

func (u *Updater) CheckSinceLastUpdate(version string, core interfaces.ICore) error

func (*Updater) CheckUpdate

func (u *Updater) CheckUpdate(version string, core interfaces.ICore) error

CheckUpdate ...

type WriteCounter

type WriteCounter struct {
	Total uint64
}

WriteCounter ...

func (WriteCounter) PrintProgress

func (wc WriteCounter) PrintProgress()

PrintProgress ...

func (*WriteCounter) Write

func (wc *WriteCounter) Write(p []byte) (int, error)

Jump to

Keyboard shortcuts

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