util

package
v0.2.4 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2024 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CompareVersion

func CompareVersion(v1, v2 string) int

func CopyFile

func CopyFile(src, dst string) error

func FileExists

func FileExists(filename string) bool

func GetBeginOfToday

func GetBeginOfToday() int64

func GetTimestamp

func GetTimestamp() int64

func IsBeforeToday

func IsBeforeToday(timestamp int64) bool

func MoveFiles added in v0.2.3

func MoveFiles(src, targetDir string) error

MoveFiles Move a folder or file to a specified directory

Types

type ArchType

type ArchType string
const (
	AMD64 ArchType = "amd64"
	ARM64 ArchType = "arm64"
)

func GetArchType

func GetArchType() ArchType

type Decompressor

type Decompressor interface {
	Decompress(dest string) error
}

func NewDecompressor

func NewDecompressor(src string) Decompressor

type Downloader

type Downloader struct {
	// URL is the URL to download the SDK from.
	LocalPath string `json:"local_path"`
}

func NewDownloader

func NewDownloader(localPath string) *Downloader

func (*Downloader) Download

func (d *Downloader) Download(url *url.URL) (string, error)

type GzipTarDecompressor

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

func (*GzipTarDecompressor) Decompress

func (g *GzipTarDecompressor) Decompress(dest string) error

type OSType

type OSType string
const (
	MacOS   OSType = "darwin"
	Windows OSType = "windows"
	Linux   OSType = "linux"
)

func GetOSType

func GetOSType() OSType

type XZTarDecompressor

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

func (*XZTarDecompressor) Decompress

func (g *XZTarDecompressor) Decompress(dest string) error

type ZipDecompressor

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

func (*ZipDecompressor) Decompress

func (z *ZipDecompressor) Decompress(dest string) error

Jump to

Keyboard shortcuts

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