utils

package
v0.0.0-...-adb5aae Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2017 License: Apache-2.0 Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GenTLSConfig

func GenTLSConfig(key, cert, ca string) (*tls.Config, error)

GenTLSConfig returns a tls config object according to inputting parameters.

func If

func If(cond bool, v1, v2 interface{}) interface{}

If implements ternary operator. if cond is true return v1, or return v2 instead.

func IsMountpoint

func IsMountpoint(dir string) bool

IsMountpoint is used to check the directory is mountpoint or not.

func MakeFSVolume

func MakeFSVolume(fscmd []string, devicePath string, timeout time.Duration) error

MakeFSVolume is used to make file system on device with format type and options.

func MountVolume

func MountVolume(mountCmd []string, devicePath, mountPath string, timeout time.Duration) error

MountVolume is used to mount device to directory with options.

func SetupTLSFlag

func SetupTLSFlag(fs *pflag.FlagSet, tlsCfg *TLSConfig)

SetupTLSFlag setups flags of tls arguments

Types

type TLSConfig

type TLSConfig struct {
	CA           string
	Cert         string
	Key          string
	VerifyRemote bool
}

TLSConfig contains information of tls which users can specify

Jump to

Keyboard shortcuts

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