Documentation ¶
Index ¶
- func ValidateExactlyOneOfStringFlagNotEmpty(flagKeyValues map[string]string) error
- func ValidateFqdn(flagValue string, flagKey string) error
- func ValidateImageName(value string) error
- func ValidateImageURI(value string) (project string, imageName string, err error)
- func ValidateProjectID(value string) error
- func ValidateRfc1035Label(value string) error
- func ValidateSnapshotName(value string) error
- func ValidateStringFlagNotEmpty(flagValue string, flagKey string) error
- func ValidateStruct(s interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ValidateExactlyOneOfStringFlagNotEmpty ¶
ValidateExactlyOneOfStringFlagNotEmpty returns error with error message stating one of fields must be provided if value is empty string. Returns nil otherwise.
func ValidateFqdn ¶
ValidateFqdn validates fully qualified domain name
func ValidateImageName ¶
ValidateImageName validates whether a string is a valid image name, as defined by <https://cloud.google.com/compute/docs/reference/rest/v1/images>.
func ValidateImageURI ¶
ValidateImageURI validates whether a string is a valid image URI, as defined by <https://cloud.google.com/compute/docs/reference/rest/v1/images> and returns image name and project ID if valid.
func ValidateProjectID ¶
ValidateProjectID validates whether a string is a valid projectID, as defined by <https://cloud.google.com/resource-manager/reference/rest/v1/projects>.
func ValidateRfc1035Label ¶
ValidateRfc1035Label validates a single label per RFC 1035
func ValidateSnapshotName ¶
ValidateSnapshotName validates whether a string is a valid disk snapshot name, as defined by <https://cloud.google.com/compute/docs/reference/rest/v1/snapshots>.
func ValidateStringFlagNotEmpty ¶
ValidateStringFlagNotEmpty returns error with error message stating field must be provided if value is empty string. Returns nil otherwise.
func ValidateStruct ¶
func ValidateStruct(s interface{}) error
ValidateStruct performs struct field validation based on field tags.
Use the syntax from <https://github.com/go-playground/validator>. In addition, the following is supported:
New validators: gce_disk_image_name: Validates using `ValidateImageName` Field names: To customize the field name in the error message, include a tag named 'name'.
Types ¶
This section is empty.