util

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Feb 8, 2021 License: GPL-2.0 Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func ByteToString

func ByteToString(orig []byte) string

func FindTargetDeviceID

func FindTargetDeviceID(mi *MountInfo) bool

find block device id

func HttpSendJson added in v0.1.10

func HttpSendJson(method string, url string, data string) (string, error)

func IsDir

func IsDir(FilePath string) bool
func IsSoftLink(FilePath string) bool

func MakeDev

func MakeDev(major, minor string) int

func RandString

func RandString(n int) string

func RemoveDuplicateElement

func RemoveDuplicateElement(addrs []string) []string

func RewriteFile

func RewriteFile(path string, content string, perm os.FileMode)

func SetBlockAccessible

func SetBlockAccessible(path string) error

set all block device accessible

func ShellExec

func ShellExec(shellPath string) error

ShellExec run shell script by bash

func UnixHttpSend

func UnixHttpSend(method string, unixPath string, uri string, data string) (string, error)

ref https://docs.docker.com/engine/api/v1.24/

func WriteFile

func WriteFile(path string, content string) error

Types

type MountInfo

type MountInfo struct {
	Device     string
	Fstype     string
	Root       string
	MountPoint string
	Opts       []string
	Marjor     string
	Minor      string
}

func GetMountInfo

func GetMountInfo() ([]MountInfo, error)

Jump to

Keyboard shortcuts

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