utils

package
v0.0.0-...-4cd6a09 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2017 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

View Source
const (
	B  = 1
	KB = 1024 * B
	MB = 1024 * KB
	GB = 1024 * MB
)

Variables

This section is empty.

Functions

func B2S

func B2S(buf []byte) string

func GenUUID

func GenUUID() (string, error)

func GetParentFullPath

func GetParentFullPath(in string) (parentFullPath string)

func GetParentName

func GetParentName(in string) (parentName string)

func GetSelfName

func GetSelfName(in string) (selfName string)

func Inet_aton

func Inet_aton(ipnr net.IP) int32

Convert net.IP to int32

func Inet_ntoa

func Inet_ntoa(ipnr int32) net.IP

Convert uint to net.IP

func LocalPathExists

func LocalPathExists(path string) (bool, error)

func MD5

func MD5(in string) string

func S2B

func S2B(s *string) []byte

Types

type AutoInc

type AutoInc struct {
	Cur int64
	// contains filtered or unexported fields
}

func New

func New(start, step int64) (ai *AutoInc)

func (*AutoInc) Close

func (ai *AutoInc) Close()

func (*AutoInc) Id

func (ai *AutoInc) Id() int64

type DiskStatus

type DiskStatus struct {
	All  uint64 `json:"all"`
	Used uint64 `json:"used"`
	Free uint64 `json:"free"`
}

func DiskUsage

func DiskUsage(path string) (disk DiskStatus)

disk usage of path/disk

type EtcdV3

type EtcdV3 struct {
	Client *clientv3.Client
	// contains filtered or unexported fields
}

func (*EtcdV3) DoDelete

func (etcdcli *EtcdV3) DoDelete(key string) error

func (*EtcdV3) Get

func (etcdcli *EtcdV3) Get(key string, recursive bool) (*clientv3.GetResponse, error)

Get implements storage.Interface.Get.

func (*EtcdV3) InitEtcd

func (etcdcli *EtcdV3) InitEtcd(etcdServerList []string) error

func (*EtcdV3) Set

func (etcdcli *EtcdV3) Set(key string, val string) error

Jump to

Keyboard shortcuts

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