utils

package
v0.0.0-...-d7ba063 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2025 License: BSD-3-Clause Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CheckLocalDNS

func CheckLocalDNS(resolvConf []byte) bool

CheckLocalDNS 会查看 /etc/resolv.conf,如果第一条生效的 那么nameserver是 127 的本地dns,则返回true

func CopyFile

func CopyFile(src, dst string) (int64, error)

CopyFile 从 src 文件拷贝到 dst 文件,返回拷贝的文件字节数

func DockergshInitPath

func DockergshInitPath(localCopy string) string

DockergshInitPath 找出 dockergshinit 的路径

func EncodeSha256

func EncodeSha256(b []byte) string

将 id 进行 base32 编码

func GetLines

func GetLines(input []byte, commentMarker []byte) [][]byte

GetLines 从 input 内容中去掉 commentMarker 注释内容

func NewId

func NewId() string

生成 32 位的随机 id

func NewPipe

func NewPipe() (*os.File, *os.File, error)

创建一个管道 返回: - 只读管道 - *os.File - 只写管道 - *os.File - err - error

func PathExists

func PathExists(path string) (bool, error)

判断文件夹是否存在

func SelfPath

func SelfPath() string

SelfPath 找到当前可执行文件的绝对路径

func TruncateID

func TruncateID(id string) string

TruncateID 截断容器 id 的前 12 位作为容器名称,有可能重复

Types

This section is empty.

Jump to

Keyboard shortcuts

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