util

package
v0.0.0-...-57f92f0 Latest Latest
Warning

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

Go to latest
Published: May 11, 2017 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

View Source
const (
	VolumeStackPrefix     = "volume-"
	ControllerServiceName = "controller"
	ReplicaServiceName    = "replica"
)

Variables

This section is empty.

Functions

func Backoff

func Backoff(maxDuration time.Duration, timeoutMessage string, f func() (bool, error)) error

func CmdOutLines

func CmdOutLines(cmd *exec.Cmd, cancel <-chan interface{}) (<-chan string, <-chan error)

func ControllerAddress

func ControllerAddress(volumeName string) string

func ConvertSize

func ConvertSize(size interface{}) (int64, error)

func CopyReq

func CopyReq(req *http.Request) *http.Request

func CopyVolumeProperties

func CopyVolumeProperties(volume0 *types.VolumeInfo) *types.VolumeInfo

func Execute

func Execute(binary string, args ...string) (string, error)

func ExecuteWithTimeout

func ExecuteWithTimeout(timeout time.Duration, binary string, args ...string) (string, error)

func FormatLocalTime

func FormatLocalTime(t time.Time, loc *time.Location) string

func FormatTimeZ

func FormatTimeZ(t time.Time) string

func FromMillis

func FromMillis(t int64) time.Time

func GetLocalIPs

func GetLocalIPs() ([]string, error)

func LimitToPeriod

func LimitToPeriod(p, t [2]time.Time) [2]time.Time

func Now

func Now() string

func ParseLocalTime

func ParseLocalTime(ts string, loc *time.Location) (time.Time, error)

func ParsePeriod

func ParsePeriod(s string, loc *time.Location) ([2]time.Time, error)

func ParseTime

func ParseTime(t string) (time.Time, error)

func ParseTimeZ

func ParseTimeZ(s string) (time.Time, error)

func RandomID

func RandomID() string

func ReplicaAddress

func ReplicaAddress(name, volumeName string) string

func ReplicaName

func ReplicaName(address, volumeName string) string

func RoundUpSize

func RoundUpSize(size int64) int64

func UUID

func UUID() string

func VolumeStackName

func VolumeStackName(volumeName string) string

func WaitForAPI

func WaitForAPI(url string, timeout int) error

WaitForAPI timeout in second

func WaitForDevice

func WaitForDevice(dev string, timeout int) error

WaitForDevice timeout in second

Types

type MetadataConfig

type MetadataConfig struct {
	DriverName          string
	Image               string
	OrcImage            string
	DriverContainerName string
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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