Documentation ¶
Index ¶
- Constants
- Variables
- func CheckConnection(timeout time.Duration) error
- func CheckHotspotSupported(ctx context.Context) (supported bool, err error)
- func CheckIfIsConnected(ctx context.Context, interfaceName string) error
- func CheckIfIsConnectedWifi(ctx context.Context, interfaceName string) error
- func ConnectToSavedWifi(ctx context.Context) error
- func ConnectWifi(ctx context.Context, creds Credentials) error
- func DeleteConnection(ctx context.Context, connectionName string)
- func DisconnectFromExternalWifi(ctx context.Context) error
- func DisconnectWifi(ctx context.Context) error
- func FetchContainerLogs(ctx context.Context, req FetchContainerLogsRequest) (string, error)
- func FindBestAndTargetInLogs(ctx context.Context, req FindBestAndTargetInLogsRequest) (string, string, error)
- func GeneratePrivateKeyFromSeed(seed string) (string, error)
- func GenerateRandomString(length int) (string, error)
- func GetHardwareID() (string, error)
- func RunCommand(ctx context.Context, commands string) (stdout, stderr string, err error)
- func StartHotspot(ctx context.Context, forceReload bool) error
- func StopHotspot(ctx context.Context) error
- type BloxFreeSpaceRequest
- type BloxFreeSpaceResponse
- type Config
- type Credentials
- type DeleteFulaConfigRequest
- type DeleteFulaConfigResponse
- type DeleteWifiRequest
- type DeleteWifiResponse
- type DockerInfo
- type EraseBlDataRequest
- type EraseBlDataResponse
- type FetchContainerLogsRequest
- type FetchContainerLogsResponse
- type FindBestAndTargetInLogsRequest
- type FindBestAndTargetInLogsResponse
- type GetDatastoreSizeRequest
- type GetDatastoreSizeResponse
- type GetFolderSizeRequest
- type GetFolderSizeResponse
- type PartitionRequest
- type PartitionResponse
- type RebootRequest
- type RebootResponse
- type SyncInfo
- type Wifi
- type WifiRemoveallRequest
- type WifiRemoveallResponse
Constants ¶
View Source
const ( B = 1 KB = 1024 * B MB = 1024 * KB GB = 1024 * MB )
Variables ¶
View Source
var TimeLimit = 25 * time.Second
Functions ¶
func CheckConnection ¶
func CheckHotspotSupported ¶
func CheckIfIsConnectedWifi ¶ added in v1.54.11
func ConnectToSavedWifi ¶
func ConnectWifi ¶
func ConnectWifi(ctx context.Context, creds Credentials) error
func DeleteConnection ¶
func DisconnectFromExternalWifi ¶ added in v1.14.0
func DisconnectWifi ¶
func FetchContainerLogs ¶ added in v1.44.0
func FetchContainerLogs(ctx context.Context, req FetchContainerLogsRequest) (string, error)
func FindBestAndTargetInLogs ¶ added in v1.54.9
func FindBestAndTargetInLogs(ctx context.Context, req FindBestAndTargetInLogsRequest) (string, string, error)
Usage example: best, target, err := findBestAndTargetInLogs(context.Background(), "fula_node")
if err != nil { log.Fatalf("Error: %s", err) }
log.Printf("Best: %s, Target: %s", best, target)
func GenerateRandomString ¶
func GetHardwareID ¶
func RunCommand ¶
exported
func StartHotspot ¶
startHotspot can be used to get the list of available wifis and their strength If forceReload is set to true it resets the network adapter to make sure it fetches the latest list, otherwise it reads from cache wifiInterface is the name of interface that it should look for in Linux.
func StopHotspot ¶
Types ¶
type BloxFreeSpaceRequest ¶ added in v1.0.0
type BloxFreeSpaceRequest struct { }
type BloxFreeSpaceResponse ¶
type BloxFreeSpaceResponse struct { DeviceCount int `json:"device_count"` Size float32 `json:"size"` Used float32 `json:"used"` Avail float32 `json:"avail"` UsedPercentage float32 `json:"used_percentage"` }
func GetBloxFreeSpace ¶
func GetBloxFreeSpace() (BloxFreeSpaceResponse, error)
type Credentials ¶
type DeleteFulaConfigRequest ¶ added in v1.14.0
type DeleteFulaConfigRequest struct { }
type DeleteFulaConfigResponse ¶ added in v1.14.0
func DeleteFulaConfig ¶ added in v1.14.0
func DeleteFulaConfig(ctx context.Context) DeleteFulaConfigResponse
type DeleteWifiRequest ¶ added in v1.17.0
type DeleteWifiRequest struct {
ConnectionName string `json:"name"`
}
type DeleteWifiResponse ¶ added in v1.17.0
func DeleteWifi ¶ added in v1.17.0
func DeleteWifi(ctx context.Context, req DeleteWifiRequest) DeleteWifiResponse
func DisconnectNamedWifi ¶ added in v1.17.0
func DisconnectNamedWifi(ctx context.Context, req DeleteWifiRequest) DeleteWifiResponse
type DockerInfo ¶
type DockerInfo struct { Image string `json:"image"` Version string `json:"version"` ID string `json:"id"` Labels map[string]string `json:"labels"` Created string `json:"created"` RepoDigests []string `json:"repo_digests"` }
func GetContainerInfo ¶
func GetContainerInfo(containerName string) (DockerInfo, error)
type EraseBlDataRequest ¶ added in v1.30.0
type EraseBlDataRequest struct { }
type EraseBlDataResponse ¶ added in v1.30.0
func EraseBlData ¶ added in v1.30.0
func EraseBlData(ctx context.Context) EraseBlDataResponse
type FetchContainerLogsRequest ¶ added in v1.44.0
type FetchContainerLogsResponse ¶ added in v1.44.0
type FindBestAndTargetInLogsRequest ¶ added in v1.54.9
type FindBestAndTargetInLogsResponse ¶ added in v1.54.9
type GetDatastoreSizeRequest ¶ added in v1.48.0
type GetDatastoreSizeRequest struct { }
type GetDatastoreSizeResponse ¶ added in v1.48.0
type GetDatastoreSizeResponse struct { RepoSize string `json:"size"` StorageMax string `json:"storage_max"` NumObjects string `json:"count"` RepoPath string `json:"folder_path"` Version string `json:"version"` }
func GetDatastoreSize ¶ added in v1.48.0
func GetDatastoreSize(ctx context.Context, req GetDatastoreSizeRequest) (GetDatastoreSizeResponse, error)
type GetFolderSizeRequest ¶ added in v1.45.0
type GetFolderSizeRequest struct {
FolderPath string `json:"folder_path"`
}
type GetFolderSizeResponse ¶ added in v1.45.0
type GetFolderSizeResponse struct { FolderPath string `json:"folder_path"` SizeInBytes string `json:"size"` }
func GetFolderSize ¶ added in v1.45.0
func GetFolderSize(ctx context.Context, req GetFolderSizeRequest) (GetFolderSizeResponse, error)
type PartitionRequest ¶ added in v1.14.0
type PartitionRequest struct { }
type PartitionResponse ¶ added in v1.14.0
func Partition ¶ added in v1.14.0
func Partition(ctx context.Context) PartitionResponse
type RebootRequest ¶ added in v1.0.0
type RebootRequest struct { }
type RebootResponse ¶ added in v1.0.0
func Reboot ¶ added in v1.0.0
func Reboot(ctx context.Context) RebootResponse
type Wifi ¶
Wifi is the data structure containing the basic elements
type WifiRemoveallRequest ¶ added in v1.0.0
type WifiRemoveallRequest struct { }
type WifiRemoveallResponse ¶ added in v1.0.0
func WifiRemoveall ¶ added in v1.0.0
func WifiRemoveall(ctx context.Context) WifiRemoveallResponse
Click to show internal directories.
Click to hide internal directories.