Source File
validate.go
Belonging Package
go.opencensus.io/tag
package tag
import
const (
maxKeyLength = 255
validKeyValueMin = 32
validKeyValueMax = 126
)
var (
errInvalidKeyName = errors.New("invalid key name: only ASCII characters accepted; max length must be 255 characters")
errInvalidValue = errors.New("invalid value: only ASCII characters accepted; max length must be 255 characters")
)
func ( string) bool {
if len() == 0 {
return false
}
if len() > maxKeyLength {
return false
}
return isASCII()
}
func ( string) bool {
for , := range {
if ( < validKeyValueMin) || ( > validKeyValueMax) {
return false
}
}
return true
}
func ( string) bool {
if len() > maxKeyLength {
return false
}
return isASCII()
![]() |
The pages are generated with Golds v0.3.2-preview. (GOOS=darwin GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |