コード例 #1
0
ファイル: secure_token.go プロジェクト: Masterminds/engine
// Generate a security token.
//
// This uses SecurityTokenLength to determine the appropriate length. If
// that value is <= 0, this will panic.
func SecurityToken() string {
	tok, err := goutils.RandomAlphaNumeric(SecurityTokenLength)
	if err != nil {
		// We panic because the only way to error out here is to pass in an
		// illegal security token length.
		panic(err)
	}
	return tok
}
コード例 #2
0
ファイル: chart_upload.go プロジェクト: jackgr/helm
func genName(pname string) string {
	s, _ := goutils.RandomAlphaNumeric(8)
	return fmt.Sprintf("%s-%s", pname, s)
}