Documentation
¶
Index ¶
- Variables
- func ChangeModeIfNot(src string, mode os.FileMode) error
- func CompareVersion(v1, v2 string) int
- func CopyFile(src, dst string) error
- func CopyToClipboard(text string) error
- func FileExists(filename string) bool
- func GetBeginOfToday() int64
- func GetTimestamp() int64
- func IsBeforeToday(timestamp int64) bool
- func IsExecutable(src string) bool
- func IsNonInteractiveTerminal() bool
- func IsTTY() bool
- func MkSymlink(oldname, newname string) (err error)
- func MoveFiles(src, targetDir string) error
- type ArchType
- type Bzip2TarDecompressor
- type Decompressor
- type Downloader
- type ErrorStore
- type GzipTarDecompressor
- type MapSet
- type OSType
- type Set
- type SevenZipDecompressor
- type SortedSet
- type VersionSort
- type XZTarDecompressor
- type ZipDecompressor
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrClipboardNotSupported is returned when the OS doesn't support clipboard operations ErrClipboardNotSupported = errors.New("clipboard not supported on this OS") // ErrClipboardUtilityNotFound is returned when clipboard utility is not available ErrClipboardUtilityNotFound = errors.New("clipboard utility not found") )
Functions ¶
func ChangeModeIfNot ¶
ChangeModeIfNot Change the permission mode of a file if it is not the same as the specified mode
func CompareVersion ¶
func CopyToClipboard ¶
CopyToClipboard copies the given text to the system clipboard Returns nil if successful, error otherwise
func FileExists ¶
func GetBeginOfToday ¶
func GetBeginOfToday() int64
func GetTimestamp ¶
func GetTimestamp() int64
func IsBeforeToday ¶
func IsNonInteractiveTerminal ¶
func IsNonInteractiveTerminal() bool
IsNonInteractiveTerminal checks if the current environment is non-interactive. Returns true if running in CI or if stdout is not a terminal (e.g., piped output).
func IsTTY ¶
func IsTTY() bool
IsTTY checks if the process is running in a TTY (interactive terminal)
Types ¶
type Bzip2TarDecompressor ¶
type Bzip2TarDecompressor struct {
// contains filtered or unexported fields
}
func (*Bzip2TarDecompressor) Decompress ¶
func (b *Bzip2TarDecompressor) Decompress(dest string) error
type Decompressor ¶
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
type ErrorStore ¶
type ErrorStore struct {
// contains filtered or unexported fields
}
ErrorStore is a struct that stores errors
func (*ErrorStore) Add ¶
func (e *ErrorStore) Add(note string, err error)
Add adds an error to the store
func (*ErrorStore) AddAndShow ¶
func (e *ErrorStore) AddAndShow(note string, err error)
Add and show in the console
func (*ErrorStore) HasError ¶
func (e *ErrorStore) HasError() bool
type GzipTarDecompressor ¶
type GzipTarDecompressor struct {
// contains filtered or unexported fields
}
func (*GzipTarDecompressor) Decompress ¶
func (g *GzipTarDecompressor) Decompress(dest string) error
type MapSet ¶
type MapSet[T comparable] struct { // contains filtered or unexported fields }
type Set ¶
type Set[T comparable] interface { Add(v T) bool Remove(v T) Contains(v T) bool Len() int Slice() []T }
func NewSet ¶
func NewSet[T comparable]() Set[T]
func NewSetWithSlice ¶
func NewSetWithSlice[T comparable](slice []T) Set[T]
func NewSortedSetWithSlice ¶
func NewSortedSetWithSlice[T comparable](slice []T) Set[T]
type SevenZipDecompressor ¶
type SevenZipDecompressor struct {
// contains filtered or unexported fields
}
func (*SevenZipDecompressor) Decompress ¶
func (s *SevenZipDecompressor) Decompress(dest string) error
type SortedSet ¶
type SortedSet[T comparable] struct { // contains filtered or unexported fields }
func NewSortedSet ¶
func NewSortedSet[T comparable]() *SortedSet[T]
func (*SortedSet[T]) AddWithIndex ¶
type VersionSort ¶
type VersionSort []string
func (VersionSort) Len ¶
func (s VersionSort) Len() int
func (VersionSort) Less ¶
func (s VersionSort) Less(i, j int) bool
func (VersionSort) Swap ¶
func (s VersionSort) Swap(i, j int)
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
Click to show internal directories.
Click to hide internal directories.