Documentation ¶
Index ¶
- Constants
- Variables
- func Each(rules ...validation.Rule) *eachRule
- func EachKey(rules ...validation.Rule) *eachKeyRule
- func NewDirective() *directive
- func Validate(validatable Validatable) error
- func ValidateExactlyOneNotNil(errorMessage string, ptr interface{}, ptrs ...interface{}) error
- type Validatable
Constants ¶
const (
// GlobalAccessLevel is an access level that is not tied to a specific tenant entity but rather it's used globally
GlobalAccessLevel = "global"
)
Variables ¶
var AreTenantAccessLevelsValid = &certMappingTenantAccessLevelValidator{}
AreTenantAccessLevelsValid is a custom validation rule that validates certificate subject mapping's tenant access levels input
var DNSName = &dnsNameRule{}
DNSName missing godoc
var IsURL = &urlValidator{}
IsURL missing godoc
var IsValidCertSubject = &certMappingSubjectValidator{}
IsValidCertSubject is a custom validation rule that validates certificate subject mapping's subject input
var IsValidConsumerType = &certMappingConsumerTypeValidator{}
IsValidConsumerType is a custom validation rule that validates certificate subject mapping's consumer type input
var SupportedAccessLevels = map[string]bool{ string(tenantEntity.Customer): true, string(tenantEntity.Account): true, string(tenantEntity.Subaccount): true, string(tenantEntity.Organization): true, string(tenantEntity.Folder): true, string(tenantEntity.ResourceGroup): true, string(tenantEntity.CostObject): true, GlobalAccessLevel: true, }
SupportedAccessLevels is a map of all supported tenant access levels
var SupportedConsumerTypes = map[consumer.Type]bool{ consumer.Runtime: true, consumer.IntegrationSystem: true, consumer.Application: true, consumer.SuperAdmin: true, consumer.BusinessIntegration: true, consumer.ManagedApplicationProviderOperator: true, consumer.ApplicationProvider: true, consumer.ManagedApplicationConsumer: true, consumer.LandscapeResourceOperator: true, consumer.TenantDiscoveryOperator: true, consumer.InstanceCreator: true, consumer.FormationViewer: true, consumer.TechnicalClient: true, consumer.ExternalCertificate: true, consumer.User: true, }
SupportedConsumerTypes is a map of all supported consumer types
Functions ¶
func Each ¶
func Each(rules ...validation.Rule) *eachRule
Each returns a validation rule that loops through an iterable (map, slice or array) and validates each value inside with the provided rules. An empty iterable is considered valid. Use the Required rule to make sure the iterable is not empty.
func EachKey ¶
func EachKey(rules ...validation.Rule) *eachKeyRule
EachKey returns a validation rule that loops through a map and validates each key inside with the provided rules. An empty iterable is considered valid. Use the Required rule to make sure the iterable is not empty.
func ValidateExactlyOneNotNil ¶
ValidateExactlyOneNotNil validates if exactly one of passed pointers is not a nil.