Documentation
¶
Index ¶
- Constants
- func ByteSize(bytes uint64) string
- func CopyInterface(dst interface{}, src interface{}) (err error)
- func GetGlobalUniCastIpFromHostname() (ipv4 string)
- func ParseTime(value string) (result time.Time, err error)
- func ToBytes(s string) (uint64, error)
- func ToMegabytes(s string) (uint64, error)
- func ValidateFieldMessage(_type reflect.Type, exp string) (key string, msg string)
- func ValidateRegisterDefault(validate *validator.Validate) *validator.Validate
- func ValidateRegisterNotBlank(validate *validator.Validate) *validator.Validate
- func ValidateRegisterNotEmpty(validate *validator.Validate) *validator.Validate
- func ValidateRegisterRegex(validate *validator.Validate) *validator.Validate
- type SafeFlag
- type Wildcard
Constants ¶
View Source
const ( BYTE = 1 << (10 * iota) KILOBYTE MEGABYTE GIGABYTE TERABYTE PETABYTE EXABYTE )
Variables ¶
This section is empty.
Functions ¶
func ByteSize ¶
ByteSize returns a human-readable byte string of the form 10M, 12.5K, and so forth. The following units are available:
E: Exabyte P: Petabyte T: Terabyte G: Gigabyte M: Megabyte K: Kilobyte B: Byte
The unit that results in the smallest number greater than or equal to 1 is always chosen.
func CopyInterface ¶
func CopyInterface(dst interface{}, src interface{}) (err error)
func GetGlobalUniCastIpFromHostname ¶
func GetGlobalUniCastIpFromHostname() (ipv4 string)
func ToBytes ¶
ToBytes parses a string formatted by ByteSize as bytes. Note binary-prefixed and SI prefixed units both mean a base-2 units KB = K = KiB = 1024 MB = M = MiB = 1024 * K GB = G = GiB = 1024 * M TB = T = TiB = 1024 * G PB = P = PiB = 1024 * T EB = E = EiB = 1024 * P
func ToMegabytes ¶
ToMegabytes parses a string formatted by ByteSize as megabytes.
func ValidateFieldMessage ¶
func ValidateRegisterDefault ¶
func ValidateRegisterDefault(validate *validator.Validate) *validator.Validate
func ValidateRegisterNotBlank ¶
func ValidateRegisterNotBlank(validate *validator.Validate) *validator.Validate
func ValidateRegisterNotEmpty ¶
func ValidateRegisterNotEmpty(validate *validator.Validate) *validator.Validate
func ValidateRegisterRegex ¶
func ValidateRegisterRegex(validate *validator.Validate) *validator.Validate
Types ¶
type SafeFlag ¶
type SafeFlag struct {
// contains filtered or unexported fields
}
func NewSafeFlag ¶
Source Files
¶
Click to show internal directories.
Click to hide internal directories.