util

package
v0.0.0-...-27d2469 Latest Latest
Warning

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

Go to latest
Published: Mar 11, 2024 License: MIT Imports: 21 Imported by: 2

Documentation

Index

Constants

View Source
const APP_NAME string = "vertcoin-ocm"

Variables

This section is empty.

Functions

func CheckBackendStatus

func CheckBackendStatus(backend string) bool

Returns true if backend is good

func DataDirectory

func DataDirectory() string

func FileExists

func FileExists(filename string) bool

func GetAutoStart

func GetAutoStart() bool

func GetCoinsPerDay

func GetCoinsPerDay(th int64) float64

func GetDifficulty

func GetDifficulty() float64

func GetJson

func GetJson(url string, target interface{}) error

func GetNetHash

func GetNetHash() uint64

func GetTipHeight

func GetTipHeight() int64

func OpenBrowser

func OpenBrowser(url string)

func ParseVerthashMinerDeviceCfg

func ParseVerthashMinerDeviceCfg(cfg string) map[int]VerthashMinerDeviceConfig

func PostJson

func PostJson(url string, payload interface{}, target interface{}) error

func PrepareBackgroundCommand

func PrepareBackgroundCommand(cmd *exec.Cmd)

func ReplaceInFile

func ReplaceInFile(file string, find string, replace string) error

func SetAutoStart

func SetAutoStart(autoStart bool) string

func ShaSum

func ShaSum(file string) ([]byte, error)

func UnpackTar

func UnpackTar(archive, unpackPath string) error

func UnpackZip

func UnpackZip(archive, unpackPath string) error

func VersionStringToNumeric

func VersionStringToNumeric(ver string) int64

Types

type Block

type Block struct {
	Hash   string `json:"hash"`
	Height int64  `json:"height"`
}

type BlockResponse

type BlockResponse struct {
	Bits uint32 `json:"bits"`
}

type BlocksResponse

type BlocksResponse struct {
	Blocks     []Block           `json:"blocks"`
	Pagination InsightPagination `json:"pagination"`
}

type GPU

type GPU struct {
	OSName string
	Type   GPUType
}

func GetGPUs

func GetGPUs() []GPU

func GetGPUsFromStrings

func GetGPUsFromStrings(names []string) []GPU

type GPUType

type GPUType int
const (
	GPUTypeOther  GPUType = 0
	GPUTypeAMD    GPUType = 1
	GPUTypeNVidia GPUType = 2
	GPUTypeIntel  GPUType = 3
)

type GithubRelease

type GithubRelease struct {
	URL        string `json:"html_url"`
	Tag        string `json:"tag_name"`
	Body       string `json:"body"`
	Draft      bool   `json:"draft"`
	Prerelease bool   `json:"prerelease"`
}

func GetLatestRelease

func GetLatestRelease() (GithubRelease, error)

type InsightPagination

type InsightPagination struct {
	Next string `json:"next"`
	Prev string `json:"prev"`
}

type KnownGPU

type KnownGPU struct {
	RegExPattern string
	Type         GPUType
	RegExp       *regexp.Regexp
}

type VerthashMinerDeviceConfig

type VerthashMinerDeviceConfig struct {
	DeviceIndex int
	PCIeBus     string
	OpenCL      bool
	Name        string
	Platform    string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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