Documentation ¶
Index ¶
- Constants
- func FormatSize(size int64) string
- func FormatTimeInterval(input int64) (formattedTime string, err error)
- func GenTLSConfig(key, cert, ca string) (*tls.Config, error)
- func If(cond bool, v1, v2 interface{}) interface{}
- func IsMountpoint(dir string) bool
- func MakeFSVolume(fscmd []string, devicePath string, timeout time.Duration) error
- func MountVolume(mountCmd []string, devicePath, mountPath string, timeout time.Duration) error
- type TLSConfig
Constants ¶
View Source
const ( Second = time.Second Minute = Second * 60 Hour = Minute * 60 Day = Hour * 24 Week = Day * 7 Month = Day * 30 Year = Day * 365 TimeLayout = "2006-01-02 15:04:05" )
Common durations that is . There are some definitions for units of Day and larger .
Variables ¶
This section is empty.
Functions ¶
func FormatTimeInterval ¶
FormatTimeInterval is used to show the time interval from input time to now.
func GenTLSConfig ¶
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 ¶
IsMountpoint is used to check the directory is mountpoint or not.
func MakeFSVolume ¶
MakeFSVolume is used to make file system on device with format type and options.
Types ¶
Click to show internal directories.
Click to hide internal directories.