Documentation
¶
Index ¶
- Constants
- func CalculateSHA256Checksum(filePath string) (string, error)
- func CheckWSL(afs afero.Afero) (bool, error)
- func ConvertTypedSliceToUntypedSlice(typedSlice interface{}) []interface{}
- func CreateCheckSumFile(filePath string, checksum string) (string, error)
- func CreateDirectoryIfNotExists(path string) error
- func DeleteFile(path string, backup bool) (err error)
- func DownloadFile(url string, filepath string, maxBytes int64) (err error)
- func ExtractTarGzToPath(tarGzFilePath, extractedPath string, maxBytes int64) error
- func FileExists(fs afero.Fs, filename string) bool
- func GetDirectorySize(fs afero.Fs, path string) (int64, error)
- func IntersectionSlices(slice1, slice2 []interface{}) []interface{}
- func IsExecutor(v interface{}) bool
- func IsExecutorType(v interface{}) bool
- func IsGPUVendor(v interface{}) bool
- func IsJobType(v interface{}) bool
- func IsJobTypes(v interface{}) bool
- func IsSameShallowType(a, b interface{}) bool
- func IsStrictlyContained(leftSlice, rightSlice []interface{}) bool
- func IsStrictlyContainedInt(leftSlice, rightSlice []int) bool
- func NoIntersectionSlices(slice1, slice2 []interface{}) bool
- func RandomBool() (bool, error)
- func RandomString(n int) (string, error)
- func ReadHTTPString(url string) (string, error)
- func SanitizeArchivePath(d, t string) (v string, err error)
- func SliceContains(s []string, str string) bool
- func ValidateAddress(addr string) error
- func WriteToFile(fs afero.Fs, data []byte, filePath string) (string, error)
- type HTTPClient
- type IOProgress
- type Reader
- type SyncMap
- type Writer
Constants ¶
const ( KernelFileURL = "https://d.nunet.io/fc/vmlinux" KernelFilePath = "/etc/nunet/vmlinux" FilesystemURL = "https://d.nunet.io/fc/nunet-fc-ubuntu-20.04-0.ext4" FilesystemPath = "/etc/nunet/nunet-fc-ubuntu-20.04-0.ext4" )
Variables ¶
This section is empty.
Functions ¶
func CalculateSHA256Checksum ¶ added in v0.4.159
CalculateSHA256Checksum calculates the SHA256 checksum of a file
func ConvertTypedSliceToUntypedSlice ¶ added in v0.5.0
func ConvertTypedSliceToUntypedSlice(typedSlice interface{}) []interface{}
func CreateCheckSumFile ¶ added in v0.4.159
put checksum in file
func CreateDirectoryIfNotExists ¶ added in v0.4.159
CreateDirectoryIfNotExists creates a directory if it does not exist
func DeleteFile ¶ added in v0.4.159
DeleteFile deletes a file, with or without a backup
func DownloadFile ¶
DownloadFile downloads a file from a url and saves it to a filepath
func ExtractTarGzToPath ¶ added in v0.4.159
ExtractTarGzToPath extracts a tar.gz file to a specified path
func FileExists ¶ added in v0.5.0
FileExists checks if destination file exists
func GetDirectorySize ¶ added in v0.5.0
func IntersectionSlices ¶ added in v0.5.0
func IntersectionSlices(slice1, slice2 []interface{}) []interface{}
IntersectionStringSlices returns the intersection of two slices of strings.
func IsExecutor ¶ added in v0.5.0
func IsExecutor(v interface{}) bool
func IsExecutorType ¶ added in v0.5.0
func IsExecutorType(v interface{}) bool
func IsGPUVendor ¶ added in v0.5.0
func IsGPUVendor(v interface{}) bool
func IsJobTypes ¶ added in v0.5.0
func IsJobTypes(v interface{}) bool
func IsSameShallowType ¶ added in v0.5.0
func IsSameShallowType(a, b interface{}) bool
func IsStrictlyContained ¶ added in v0.5.0
func IsStrictlyContained(leftSlice, rightSlice []interface{}) bool
IsStrictlyContained checks if all elements of rightSlice are contained in leftSlice
func IsStrictlyContainedInt ¶ added in v0.5.0
IsStrictlyContainedInt checks if all elements of rightSlice are contained in leftSlice
func NoIntersectionSlices ¶ added in v0.5.0
func NoIntersectionSlices(slice1, slice2 []interface{}) bool
func RandomBool ¶ added in v0.4.159
func RandomString ¶
RandomString generates a random string of length n
func ReadHTTPString ¶ added in v0.5.0
ReadHTTPString GET request to http endpoint and return response as string
func SanitizeArchivePath ¶ added in v0.5.0
SanitizeArchivePath Sanitize archive file pathing from "G305: Zip Slip vulnerability"
func SliceContains ¶ added in v0.4.159
SliceContains checks if a string exists in a slice
func ValidateAddress ¶ added in v0.4.159
ValidateAddress checks if the wallet address is a valid cardano address
Types ¶
type HTTPClient ¶ added in v0.5.0
func NewHTTPClient ¶ added in v0.5.0
func NewHTTPClient(baseURL, version string) *HTTPClient
func (*HTTPClient) MakeRequest ¶ added in v0.5.0
MakeRequest performs an HTTP request with the given method, path, and body It returns the response body, status code, and an error if any
type IOProgress ¶ added in v0.4.159
type IOProgress struct {
// contains filtered or unexported fields
}
func (IOProgress) Complete ¶ added in v0.4.159
func (p IOProgress) Complete() bool
func (IOProgress) Estimated ¶ added in v0.4.159
func (p IOProgress) Estimated() time.Time
func (IOProgress) N ¶ added in v0.4.159
func (p IOProgress) N() float64
func (IOProgress) Percent ¶ added in v0.4.159
func (p IOProgress) Percent() float64
Percent calculates the percentage complete.
func (IOProgress) Remaining ¶ added in v0.4.159
func (p IOProgress) Remaining() time.Duration
func (IOProgress) Size ¶ added in v0.4.159
func (p IOProgress) Size() float64
type Reader ¶ added in v0.4.159
type Reader struct { Progress IOProgress // contains filtered or unexported fields }
func ReaderWithProgress ¶ added in v0.4.159
type SyncMap ¶ added in v0.5.0
type SyncMap[K comparable, V any] struct { sync.Map }
A SyncMap is a concurrency-safe sync.Map that uses strongly-typed method signatures to ensure the types of its stored data are known.
func SyncMapFromMap ¶ added in v0.5.0
func SyncMapFromMap[K comparable, V any](m map[K]V) *SyncMap[K, V]
SyncMapFromMap converts a standard Go map to a concurrency-safe SyncMap.
func (*SyncMap[K, V]) Get ¶ added in v0.5.0
Get retrieves the value associated with the given key from the map. It returns the value and a boolean indicating whether the key was found.
func (*SyncMap[K, V]) Iter ¶ added in v0.5.0
Iter iterates over each key-value pair in the map, executing the provided function on each pair. The iteration stops if the provided function returns false.
func (*SyncMap[K, V]) Keys ¶ added in v0.5.0
func (m *SyncMap[K, V]) Keys() []K
Keys returns a slice containing all the keys present in the map.
type Writer ¶ added in v0.4.159
type Writer struct { Progress IOProgress // contains filtered or unexported fields }