Documentation ¶
Overview ¶
Package validate contains validation for RPC requests and Config entries.
Index ¶
- Constants
- func BotPingTolerance(bpt int64) error
- func CIPDPackages[P cipdPkg](packages []P, requirePinnedVer bool, cachePaths stringset.Set) errors.MultiError
- func Caches[C cacheEntry](caches []C) (pathSet stringset.Set, merr errors.MultiError)
- func CipdPackageName(pkg string) error
- func CipdPackageVersion(ver string) error
- func DimensionKey(key string) error
- func DimensionValue(val string) error
- func EnvVar(ev string) error
- func Length(val string, limit int) error
- func Path(p string, maxLen int) error
- func Priority(p int32) error
- func PubSubTopicName(topic string) (string, string, error)
- func SecureURL(u string) error
- func ServiceAccount(sa string) error
- func Tag(tag string) error
Constants ¶
const ( MaxPackagePathLength = 256 MaxEnvValueLength = 1024 MaxEnvVarCount = 64 )
Variables ¶
This section is empty.
Functions ¶
func BotPingTolerance ¶
BotPingTolerance checks a bot_ping_tolerance is correct.
func CIPDPackages ¶
func CIPDPackages[P cipdPkg](packages []P, requirePinnedVer bool, cachePaths stringset.Set) errors.MultiError
CIPDPackages checks a slice of CIPD packages are correct.
func Caches ¶
func Caches[C cacheEntry](caches []C) (pathSet stringset.Set, merr errors.MultiError)
Caches validates a slice of cacheEntry.
Also returns a set of cache paths.
Can be used to validate * []*apipb.CacheEntry * []*configpb.TaskTemplate_CacheEntry
func CipdPackageName ¶
CipdPackageName checks CIPD package name is correct.
The package name is allowed to be a template e.g. have "${platform}" and other substitutions inside.
func CipdPackageVersion ¶
CipdPackageVersion checks CIPD package version is correct.
func DimensionKey ¶
DimensionKey checks if `key` can be a dimension key.
func DimensionValue ¶
DimensionValue checks if `val` can be a dimension value.
func PubSubTopicName ¶
PubSubTopicName validates the format of topic, extract the cloud project and topic id, and return them.
func ServiceAccount ¶
ServiceAccount checks a service account is correct.
Types ¶
This section is empty.