Permalink
Switch branches/tags
Nothing to show
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
20 lines (16 sloc) 402 Bytes
package getaredis
import (
"fmt"
"math/rand"
)
func generateDockerAddress(ip, username, password string) string {
return fmt.Sprintf("tcp://%v:%v@%v:2377", username, password, ip)
}
func generateRandomString(length int) string {
var ret string
runes := []rune("abcdefghijklmnopqrstuvwxyz0123456789")
for i := 0; i < length; i++ {
ret += string(runes[rand.Intn(len(runes))])
}
return ret
}