Documentation ¶
Overview ¶
Package validate contains validation for RPC requests and Config entries.
Index ¶
- Constants
- func BotPingTolerance(bpt int64) error
- func CIPDPackageName(pkg string) error
- func CIPDPackageVersion(ver string) error
- func CIPDPackages[P cipdPkg](packages []P, requirePinnedVer bool, doc *directoryocclusion.Checker, ...) errors.MultiError
- func CIPDServer(server string) error
- func Caches[C cacheEntry](caches []C, cacheSource string) (*directoryocclusion.Checker, errors.MultiError)
- 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 SessionID(val 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 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 CIPDPackages ¶
func CIPDPackages[P cipdPkg](packages []P, requirePinnedVer bool, doc *directoryocclusion.Checker, pkgSource string) errors.MultiError
CIPDPackages checks a slice of CIPD packages are correct.
func Caches ¶
func Caches[C cacheEntry](caches []C, cacheSource string) (*directoryocclusion.Checker, errors.MultiError)
Caches validates a slice of cacheEntry.
Also returns a directoryoccusion.Checker with all of the cache pathes.
Can be used to validate * []*apipb.CacheEntry * []*configpb.TaskTemplate_CacheEntry
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.