Documentation ¶
Index ¶
- Constants
- func AddressRange(network *net.IPNet) (net.IP, net.IP)
- func Any(arrays []string, excludes ...string) string
- func Append(ips []string, app string) []string
- func Assert(check bool, msg string, params ...interface{})
- func Async() *async
- func Base64File(file string) string
- func CamelName(name string) string
- func Catch(fns ...func(error))
- func CompileSplit2(str, sep string) (a, b string)
- func CompileSplit3(str, sep string) (a, b, c string)
- func ComposeIP(a, b net.IP) int
- func Copy(src, dest string) (err error)
- func Copyto(src, destPath string) (string, error)
- func DashName(name string) string
- func Default(args []string, index int, def string) string
- func Exists(path string) bool
- func FileBytes(path string) []byte
- func FirstLine(content string) string
- func HashApr1(password string) (string, error)
- func HashApr1WithSalt(password, salt string) (string, error)
- func Index(args []string, index int) string
- func Int32(str string, base int) *int32
- func Int64(str string, base int) *int64
- func Join(ms map[string]string, separator, kvSeparator string) string
- func Line(format string, params ...interface{})
- func Logs(format string, args ...interface{})
- func Match(str string, patterns ...string) bool
- func Mkdir(dest string) error
- func Name(name, link string) string
- func NextIP(ip net.IP) net.IP
- func NotExists(path string) bool
- func Panic(err error, msg string, params ...interface{})
- func ParseIPS(nodes []string) []string
- func PrevIP(ip net.IP) net.IP
- func Random(n int) string
- func RangeIP(start, end string) []string
- func Repeat(str string, size int) []string
- func Reverse(strs []string) []string
- func Safe(fn func()) (err error)
- func Search(slice []string, s string) int
- func SelectMatch(strs []string, patterns ...string) (matched []string)
- func SelectNotMatch(strs []string, patterns ...string) (matched []string)
- func Split2(str, sep string) (a, b string)
- func Split3(str, sep string) (a, b, c string)
- func Stack() string
- func Stdout(name string) func(reader io.Reader) error
- func Switch(assert bool, a, b string) string
- func Trdn(bs []byte) []byte
- func Try(fun func(), handler ...func(error))
- func TryFinally(fun func(), handler func(error), finallyFn func())
- func UnderscoreName(name string) string
- func VersionCompose(v1, v2 string) int
- func Wrap(err error, format string, param ...interface{}) error
- type WrapError
Constants ¶
View Source
const ( // Prefix is the identifier for the Apache-specific MD5 algorithm. Prefix = "$apr1$" // Size is the size of an MD5 checksum in bytes. Size = 16 // Blocksize is the blocksize of APR1 in bytes. Blocksize = 64 // Rounds is the number of rounds in the big loop. Rounds = 1000 )
Variables ¶
This section is empty.
Functions ¶
func AddressRange ¶
AddressRange returns the first and last addresses in the given CIDR range.
func Base64File ¶
func CompileSplit2 ¶
func CompileSplit3 ¶
func HashApr1WithSalt ¶
Hash hashes the given password, along with the salt. I did not design this algorithm, only re-implement and optimize slightly. This assumes strings are valid UTF-8 encoded strings. The salt must be 8 bytes long. This algorithm is adopted from the Java implementation found here: http://commons.apache.org/proper/commons-codec/apidocs/src-html/org/apache/commons/codec/digest/Md5Crypt.html
func SelectMatch ¶
func SelectNotMatch ¶
func TryFinally ¶
func TryFinally(fun func(), handler func(error), finallyFn func())
Try handler(err) and finally
func UnderscoreName ¶
Types ¶
Click to show internal directories.
Click to hide internal directories.