Documentation ¶
Index ¶
- func AbsPathify(inPath string) string
- func CIDRToIPv4Range(cidr string) (string, string, error)
- func CIDRToLongRange(cidr string) (uint32, uint32, error)
- func Capitalize(value string) string
- func Check(port int) (status bool, err error)
- func ExtractRetCode(err error) (string, int, error)
- func GeneratePassword(length uint8) (string, error)
- func IPv4ToLong(ip string) uint32
- func IsCIDRRoutable(cidr string) (bool, error)
- func IsEmpty(v interface{}) bool
- func LazyRemove(path string) error
- func LongToIPv4(value uint32) string
- func New() (port int, err error)
- func Plural(value int) string
- func UserConfirmed(msg string) bool
- type Cache
- type MapCache
- func (c *MapCache) ForceSet(key string, value interface{}) error
- func (c *MapCache) ForceSetBy(key string, by func() (interface{}, error)) error
- func (c *MapCache) Get(key string) (value interface{}, ok bool)
- func (c *MapCache) GetOrDefault(key string, def interface{}) (value interface{})
- func (c *MapCache) Reset(key string) Cache
- func (c *MapCache) Set(key string, value interface{}) error
- func (c *MapCache) SetBy(key string, by func() (interface{}, error)) error
- type Valid
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CIDRToIPv4Range ¶
CIDRToIPv4Range converts CIDR to IPv4 range
func CIDRToLongRange ¶
CIDRToLongRange converts CIDR to range of long values (representing IPv4 addresses)
func Capitalize ¶
Capitalize makes the first letter of the first word uppercased
func ExtractRetCode ¶
ExtractRetCode extracts info from the error
func GeneratePassword ¶
GeneratePassword generates a password with length at least 12
func IsCIDRRoutable ¶
IsCIDRRoutable tells if the network is routable
func LazyRemove ¶
LazyRemove is identical to os.Remove, but doesn't raise an error, and log.Warn every error except "file not found" which is ignored
Types ¶
type Cache ¶
type Cache interface { SetBy(string, func() (interface{}, error)) error Set(string, interface{}) error ForceSetBy(string, func() (interface{}, error)) error ForceSet(string, interface{}) error Reset(string) Cache Get(string) (interface{}, bool) GetOrDefault(string, interface{}) interface{} }
Cache is an interface for caching elements
type MapCache ¶
type MapCache struct {
// contains filtered or unexported fields
}
MapCache implements Cache interface using map
func (*MapCache) ForceSetBy ¶
ForceSetBy ...
func (*MapCache) GetOrDefault ¶
GetOrDefault ...
Source Files ¶
Click to show internal directories.
Click to hide internal directories.