Documentation
¶
Overview ¶
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2022, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Copyright (C) 2023, Ava Labs, Inc. All rights reserved. See the file LICENSE for licensing terms.
Index ¶
- func ContainsIgnoreCase(s, substr string) bool
- func ConvertInterfaceToMap(value interface{}) (map[string]interface{}, error)
- func DirectoryExists(dirName string) bool
- func FileExists(filename string) bool
- func Filter[T any](input []T, f func(T) bool) []T
- func FindErrorLogs(rootDirs ...string)
- func GetAPIContext() (context.Context, context.CancelFunc)
- func GetONRContext() (context.Context, context.CancelFunc)
- func GetRealFilePath(path string) string
- func GetSHA256FromDisk(binPath string) (string, error)
- func GetSSHConnectionString(publicIP, certFilePath string) string
- func IsExecutable(filename string) bool
- func IsSSHAgentAvailable() bool
- func IsSSHAgentIdentityValid(identity string) (bool, error)
- func IsUnsignedSlice(n []int) bool
- func ListSSHAgentIdentities() ([]string, error)
- func Map[T, U any](input []T, f func(T) U) []U
- func MapWithError[T, U any](input []T, f func(T) (U, error)) ([]U, error)
- func NewBlsSecretKeyBytes() ([]byte, error)
- func ReadSSHAgentIdentityPublicKey(identityName string) (string, error)
- func SearchSHA256File(file []byte, toSearch string) (string, error)
- func SetupRealtimeCLIOutput(cmd *exec.Cmd, redirectStdout bool, redirectStderr bool) (*bytes.Buffer, *bytes.Buffer)
- func SortUint32(arr []uint32)
- func SplitComaSeparatedInt(s string) []int
- func SplitComaSeparatedString(s string) []string
- func SplitKeyValueStringToMap(str string, delimiter string) (map[string]string, error)
- func SplitStringWithQuotes(str string, r rune) []string
- func TimedFunction(f func() (interface{}, error), name string, timeout time.Duration) (interface{}, error)
- func ToNodeID(certBytes []byte, keyBytes []byte) (ids.NodeID, error)
- func Unique(slice []string) []string
- func UserHomePath(filePath ...string) string
- func ValidateJSON(path string) ([]byte, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ContainsIgnoreCase ¶
containsIgnoreCase checks if the given string contains the specified substring, ignoring case.
func ConvertInterfaceToMap ¶
ConvertInterfaceToMap converts a given value to a map[string]interface{}.
func DirectoryExists ¶
func FindErrorLogs ¶
func FindErrorLogs(rootDirs ...string)
FindErrorLogs is a utility function, we will NOT do error handling, as this is supposed to be called during error handling itself we don't want to make it even more complex
func GetAPIContext ¶
func GetAPIContext() (context.Context, context.CancelFunc)
Context for API requests
func GetONRContext ¶
func GetONRContext() (context.Context, context.CancelFunc)
Context for ONR network operations
func GetRealFilePath ¶
func GetSHA256FromDisk ¶
func GetSSHConnectionString ¶
GetSSHConnectionString returns the SSH connection string for the given public IP and certificate file path.
func IsExecutable ¶
IsExecutable checks if a file is executable.
func IsSSHAgentAvailable ¶
func IsSSHAgentAvailable() bool
isSSHAgentAvailable checks if the SSH agent is available.
func IsSSHAgentIdentityValid ¶
func IsUnsignedSlice ¶
IsUnsignedSlice returns true if all elements in the slice are unsigned integers.
func ListSSHAgentIdentities ¶
ListSSHAgentIdentity returns a list of SSH identities from ssh-agent.
func MapWithError ¶
func NewBlsSecretKeyBytes ¶
func SetupRealtimeCLIOutput ¶
func SortUint32 ¶
func SortUint32(arr []uint32)
func SplitComaSeparatedInt ¶
SplitComaSeparatedInt splits a comma-separated string into a slice of integers.
func SplitComaSeparatedString ¶
SplitComaSeparatedString splits and trims a comma-separated string into a slice of strings.
func SplitKeyValueStringToMap ¶
SplitKeyValueStringToMap splits a string with multiple key-value pairs separated by delimiter. Delimiter must be a single character
func SplitStringWithQuotes ¶
SplitString split string with a rune comma ignore quoted
func TimedFunction ¶
func TimedFunction(f func() (interface{}, error), name string, timeout time.Duration) (interface{}, error)
TimedFunction is a function that executes the given function `f` within a specified timeout duration.
func UserHomePath ¶
UserHomePath returns the absolute path of a file located in the user's home directory.
func ValidateJSON ¶
ValidateJSON takes a json string and returns it's byte representation if it contains valid JSON
Types ¶
This section is empty.