Documentation
¶
Index ¶
- Constants
- Variables
- func ComposeDecodeHookFunc(opts ...DecodeHookOption) mapstructure.DecodeHookFunc
- func FileUploadDecodeHook(readFromPath bool) mapstructure.DecodeHookFunc
- func GetDefaultValue[T SchemaTypes](s SchemaField) (*T, error)
- func IsFieldAmongDefaultList(f SchemaField) bool
- func StringToSliceHookFunc(sep string) mapstructure.DecodeHookFunc
- func Validate(c Configuration, v Configurable, opts ...Option) error
- func ValidateBoolRules(r *v1_conf.BoolRules, v bool, name string) error
- func ValidateField[T SchemaTypes](s *SchemaField, value T) (bool, error)
- func ValidateIntRules(r *v1_conf.Int64Rules, vInt int, name string) error
- func ValidateRepeatedStringRules(r *v1_conf.RepeatedStringRules, v []string, name string) error
- func ValidateStringMapRules(r *v1_conf.StringMapRules, v map[string]any, name string) error
- func ValidateStringRules(r *v1_conf.StringRules, v string, name string) error
- func WithBool(f boolRuleMaker) fieldOption
- func WithCatalogId(value string) configOption
- func WithConnectorDisplayName(value string) configOption
- func WithConstraints(constraints ...SchemaFieldRelationship) configOption
- func WithDefaultValue(value any) fieldOption
- func WithDefaultValueFunc(f func() any) fieldOption
- func WithDescription(description string) fieldOption
- func WithDisplayName(displayName string) fieldOption
- func WithExportTarget(target ExportTarget) fieldOption
- func WithFieldGroups(fieldGroups []SchemaFieldGroup) configOption
- func WithHelpUrl(value string) configOption
- func WithHidden(hidden bool) fieldOption
- func WithIconUrl(value string) configOption
- func WithInt(f intRuleMaker) fieldOption
- func WithIsDirectory(value bool) configOption
- func WithIsSecret(value bool) fieldOption
- func WithPersistent(value bool) fieldOption
- func WithPlaceholder(value string) fieldOption
- func WithRequired(required bool) fieldOption
- func WithRequiredInGUI(value bool) fieldOption
- func WithRequiresExternalConnector(value bool) configOption
- func WithShortHand(sh string) fieldOption
- func WithString(f stringRuleMaker) fieldOption
- func WithStringMap(f stringMapRuleMaker) fieldOption
- func WithStringSlice(f stringSliceRuleMaker) fieldOption
- func WithStructFieldName(name string) fieldOption
- func WithSupportsExternalResources(value bool) configOption
- type BoolRuler
- type Configurable
- type Configuration
- type DecodeHookOption
- type ErrConfigurationMissingFields
- type ExportTarget
- type FieldRule
- type IntRuler
- func (b *IntRuler) Eq(value int64) *IntRuler
- func (b *IntRuler) Gt(value int64) *IntRuler
- func (b *IntRuler) Gte(value int64) *IntRuler
- func (b *IntRuler) In(values []int64) *IntRuler
- func (b *IntRuler) Lt(value int64) *IntRuler
- func (b *IntRuler) Lte(value int64) *IntRuler
- func (b *IntRuler) NotIn(values []int64) *IntRuler
- func (b *IntRuler) ValidateEmpty(value bool) *IntRuler
- type Option
- type Relationship
- type SchemaField
- func BoolField(name string, optional ...fieldOption) SchemaField
- func EnsureDefaultFieldsExists(originalFields []SchemaField) []SchemaField
- func FileUploadField(name string, bonusStrings []string, optional ...fieldOption) SchemaField
- func IntField(name string, optional ...fieldOption) SchemaField
- func LambdaServerFields() []SchemaField
- func Oauth2Field(name string, optional ...fieldOption) SchemaField
- func SelectField(name string, options []string, optional ...fieldOption) SchemaField
- func StringField(name string, optional ...fieldOption) SchemaField
- func StringMapField(name string, optional ...fieldOption) SchemaField
- func StringSliceField(name string, optional ...fieldOption) SchemaField
- type SchemaFieldGroup
- type SchemaFieldRelationship
- func EnsureDefaultRelationships(original []SchemaFieldRelationship) []SchemaFieldRelationship
- func FieldsAtLeastOneUsed(fields ...SchemaField) SchemaFieldRelationship
- func FieldsDependentOn(fields []SchemaField, required []SchemaField) SchemaFieldRelationship
- func FieldsMutuallyExclusive(fields ...SchemaField) SchemaFieldRelationship
- func FieldsRequiredTogether(fields ...SchemaField) SchemaFieldRelationship
- type SchemaTypes
- type StringMapRuler
- type StringRuler
- func (b *StringRuler) Contains(value string) *StringRuler
- func (b *StringRuler) Eq(value string) *StringRuler
- func (b *StringRuler) In(values []string) *StringRuler
- func (b *StringRuler) IsAddress() *StringRuler
- func (b *StringRuler) IsEmail() *StringRuler
- func (b *StringRuler) IsHostname() *StringRuler
- func (b *StringRuler) IsIP() *StringRuler
- func (b *StringRuler) IsIpv4() *StringRuler
- func (b *StringRuler) IsIpv6() *StringRuler
- func (b *StringRuler) IsURI() *StringRuler
- func (b *StringRuler) IsUUID() *StringRuler
- func (b *StringRuler) Len(value uint64) *StringRuler
- func (b *StringRuler) MaxLen(value uint64) *StringRuler
- func (b *StringRuler) MinLen(value uint64) *StringRuler
- func (b *StringRuler) NotContains(value string) *StringRuler
- func (b *StringRuler) NotIn(values []string) *StringRuler
- func (b *StringRuler) Pattern(value string) *StringRuler
- func (b *StringRuler) Prefix(value string) *StringRuler
- func (b *StringRuler) Suffix(value string) *StringRuler
- type StringSliceRuler
- func (b *StringSliceRuler) ItemRules(f func(stringer *StringRuler)) *StringSliceRuler
- func (b *StringSliceRuler) MaxItems(value uint64) *StringSliceRuler
- func (b *StringSliceRuler) MinItems(value uint64) *StringSliceRuler
- func (b *StringSliceRuler) Unique(unique bool) *StringSliceRuler
- func (b *StringSliceRuler) ValidateEmpty(value bool) *StringSliceRuler
- type Variant
- type WebFieldType
- type WellKnownStrings
Constants ¶
const ( OtelCollectorEndpointFieldName = "otel-collector-endpoint" OtelCollectorEndpointTLSCertPathFieldName = "otel-collector-endpoint-tls-cert-path" OtelCollectorEndpointTLSCertFieldName = "otel-collector-endpoint-tls-cert" OtelCollectorEndpointTLSInsecureFieldName = "otel-collector-endpoint-tls-insecure" OtelTracingDisabledFieldName = "otel-tracing-disabled" OtelLoggingDisabledFieldName = "otel-logging-disabled" )
Variables ¶
var ( ListTicketSchemasField = BoolField("list-ticket-schemas", WithHidden(true), WithDescription("List ticket schemas"), WithPersistent(true), WithExportTarget(ExportTargetNone)) TicketingField = BoolField("ticketing", WithDisplayName("Enable external ticket provisioning"), WithDescription("This must be set to enable ticketing support"), WithPersistent(true), WithExportTarget(ExportTargetNone)) LambdaServerClientIDField = StringField("lambda-client-id", WithRequired(true), WithDescription("The oauth client id to use with the configuration endpoint"), WithExportTarget(ExportTargetNone)) LambdaServerClientSecretField = StringField("lambda-client-secret", WithRequired(true), WithDescription("The oauth client secret to use with the configuration endpoint"), WithExportTarget(ExportTargetNone)) // JWT Authentication Fields. LambdaServerAuthJWTSigner = StringField("lambda-auth-jwt-signer", WithRequired(false), WithDescription("The JWK format public key used to verify JWT signatures (mutually exclusive with lambda-auth-jwt-jwks-url)"), WithExportTarget(ExportTargetNone)) LambdaServerAuthJWTJWKSUrl = StringField("lambda-auth-jwt-jwks-url", WithRequired(false), WithDescription("The URL to the JWKS endpoint for JWT verification (mutually exclusive with lambda-auth-jwt-signer)"), WithExportTarget(ExportTargetNone)) LambdaServerAuthJWTExpectedIssuerField = StringField("lambda-auth-jwt-expected-issuer", WithRequired(true), WithDescription("The expected issuer claim in the JWT"), WithExportTarget(ExportTargetNone)) LambdaServerAuthJWTExpectedSubjectField = StringField("lambda-auth-jwt-expected-subject", WithRequired(true), WithDescription("The expected subject claim in the JWT (optional)"), WithExportTarget(ExportTargetNone)) LambdaServerAuthJWTExpectedAudienceField = StringField("lambda-auth-jwt-expected-audience", WithRequired(true), WithDescription("The expected audience claim in the JWT (optional)"), WithExportTarget(ExportTargetNone)) ServerSessionStoreMaximumSizeField = IntField("session-store-maximum-size", WithDescription("The maximum size of the local in-memory session store cache in bytes."), WithDefaultValue(1024*1024*15), WithExportTarget(ExportTargetOps), WithHidden(true), WithPersistent(true)) )
var DefaultFields = []SchemaField{ createTicketField, bulkCreateTicketField, bulkTicketTemplatePathField, getTicketField, ListTicketSchemasField, provisioningField, TicketingField, c1zTmpDirField, clientIDField, clientSecretField, createAccountEmailField, createAccountLoginField, createAccountProfileField, createAccountResourceTypeField, deleteResourceField, deleteResourceTypeField, eventFeedField, eventFeedIdField, eventFeedStartAtField, eventFeedCursorField, fileField, grantEntitlementField, grantPrincipalField, grantPrincipalTypeField, logFormatField, revokeGrantField, rotateCredentialsField, rotateCredentialsTypeField, ticketIDField, ticketTemplatePathField, logLevelField, logLevelDebugExpiresAtField, skipFullSync, targetedSyncResourceIDs, syncResourceTypeIDs, skipEntitlementsAndGrants, skipGrants, externalResourceC1ZField, externalResourceEntitlementIdFilter, diffSyncsField, diffSyncsBaseSyncField, diffSyncsAppliedSyncField, compactSyncIDsField, compactFilePathsField, compactOutputDirectoryField, compactSyncsField, invokeActionField, invokeActionArgsField, invokeActionResourceTypeField, listActionSchemasField, listActionSchemasResourceTypeField, listResourceActionsField, invokeResourceActionField, invokeResourceActionTypeField, invokeResourceActionArgsField, ServerSessionStoreMaximumSizeField, otelCollectorEndpoint, otelCollectorEndpointTLSCertPath, otelCollectorEndpointTlSCert, otelCollectorEndpointTlSInsecure, otelTracingDisabled, otelLoggingDisabled, authMethod, }
DefaultFields list the default fields expected in every single connector.
var DefaultRelationships = []SchemaFieldRelationship{ FieldsRequiredTogether(grantEntitlementField, grantPrincipalField), FieldsRequiredTogether(clientIDField, clientSecretField), FieldsRequiredTogether(createTicketField, ticketTemplatePathField), FieldsRequiredTogether(bulkCreateTicketField, bulkTicketTemplatePathField), FieldsRequiredTogether(getTicketField, ticketIDField), FieldsRequiredTogether(diffSyncsField, diffSyncsBaseSyncField, diffSyncsAppliedSyncField), FieldsRequiredTogether(compactSyncsField, compactSyncIDsField, compactFilePathsField, compactOutputDirectoryField), FieldsMutuallyExclusive( grantEntitlementField, revokeGrantField, createAccountLoginField, deleteResourceField, rotateCredentialsField, eventFeedField, createTicketField, getTicketField, ListTicketSchemasField, bulkCreateTicketField, ), FieldsMutuallyExclusive( grantEntitlementField, revokeGrantField, createAccountEmailField, deleteResourceTypeField, rotateCredentialsTypeField, eventFeedField, diffSyncsField, compactSyncsField, ListTicketSchemasField, ), FieldsDependentOn( []SchemaField{externalResourceEntitlementIdFilter}, []SchemaField{externalResourceC1ZField}, ), FieldsDependentOn( []SchemaField{skipGrants}, []SchemaField{targetedSyncResourceIDs}, ), }
var ErrWrongValueType = errors.New("unable to cast any to concrete type")
var LambdaServerRelationships = make([]SchemaFieldRelationship, 0)
var RelationshipToConstraintKind = map[Relationship]v1_conf.ConstraintKind{ RequiredTogether: v1_conf.ConstraintKind_CONSTRAINT_KIND_REQUIRED_TOGETHER, MutuallyExclusive: v1_conf.ConstraintKind_CONSTRAINT_KIND_MUTUALLY_EXCLUSIVE, AtLeastOne: v1_conf.ConstraintKind_CONSTRAINT_KIND_AT_LEAST_ONE, Dependents: v1_conf.ConstraintKind_CONSTRAINT_KIND_DEPENDENT_ON, }
Functions ¶
func ComposeDecodeHookFunc ¶ added in v0.4.12
func ComposeDecodeHookFunc(opts ...DecodeHookOption) mapstructure.DecodeHookFunc
ComposeDecodeHookFunc returns a mapstructure.DecodeHookFunc that composes the default hook functions with any additional hook functions configured.
func FileUploadDecodeHook ¶ added in v0.4.12
func FileUploadDecodeHook(readFromPath bool) mapstructure.DecodeHookFunc
FileUploadDecodeHook returns a mapstructure.DecodeHookFunc that automatically converts string values to []byte for file upload fields, supporting: 1. File paths (reads file content) 2. Data URLs of JSON with base64 encoding (data:application/json;base64,<content>) 3. Raw base64 content 4. Raw unencoded content.
func GetDefaultValue ¶ added in v0.2.68
func GetDefaultValue[T SchemaTypes](s SchemaField) (*T, error)
SchemaField can't be generic over SchemaTypes without breaking backwards compatibility :-/.
func IsFieldAmongDefaultList ¶
func IsFieldAmongDefaultList(f SchemaField) bool
func StringToSliceHookFunc ¶ added in v0.4.12
func StringToSliceHookFunc(sep string) mapstructure.DecodeHookFunc
StringToSliceHookFunc returns a DecodeHookFunc that converts string to []string by splitting on the given sep. Note: this differs from mapstructure.StringToSliceHookFunc only in that it skips cases when the target type is []uint8 (ie []byte).
func Validate ¶ added in v0.2.3
func Validate(c Configuration, v Configurable, opts ...Option) error
Validate perform validation of field requirement and constraints relationships after the configuration is read. We don't check the following:
- if sets of fields are mutually exclusive and required together at the same time
func ValidateBoolRules ¶ added in v0.2.68
func ValidateField ¶ added in v0.2.68
func ValidateField[T SchemaTypes](s *SchemaField, value T) (bool, error)
Go doesn't allow generic methods on a non-generic struct.
func ValidateIntRules ¶ added in v0.2.68
func ValidateIntRules(r *v1_conf.Int64Rules, vInt int, name string) error
func ValidateRepeatedStringRules ¶ added in v0.2.68
func ValidateRepeatedStringRules(r *v1_conf.RepeatedStringRules, v []string, name string) error
func ValidateStringMapRules ¶ added in v0.2.83
func ValidateStringRules ¶ added in v0.2.68
func ValidateStringRules(r *v1_conf.StringRules, v string, name string) error
func WithCatalogId ¶ added in v0.3.10
func WithCatalogId(value string) configOption
func WithConnectorDisplayName ¶ added in v0.3.10
func WithConnectorDisplayName(value string) configOption
func WithConstraints ¶ added in v0.3.10
func WithConstraints(constraints ...SchemaFieldRelationship) configOption
func WithDefaultValue ¶
func WithDefaultValue(value any) fieldOption
func WithDefaultValueFunc ¶ added in v0.3.22
func WithDefaultValueFunc(f func() any) fieldOption
func WithDescription ¶
func WithDescription(description string) fieldOption
func WithDisplayName ¶ added in v0.2.68
func WithDisplayName(displayName string) fieldOption
func WithExportTarget ¶ added in v0.2.68
func WithExportTarget(target ExportTarget) fieldOption
func WithFieldGroups ¶ added in v0.4.13
func WithFieldGroups(fieldGroups []SchemaFieldGroup) configOption
func WithHelpUrl ¶ added in v0.3.10
func WithHelpUrl(value string) configOption
func WithHidden ¶
func WithHidden(hidden bool) fieldOption
func WithIconUrl ¶ added in v0.3.10
func WithIconUrl(value string) configOption
func WithIsDirectory ¶ added in v0.3.10
func WithIsDirectory(value bool) configOption
func WithIsSecret ¶ added in v0.2.68
func WithIsSecret(value bool) fieldOption
func WithPersistent ¶ added in v0.2.32
func WithPersistent(value bool) fieldOption
func WithPlaceholder ¶ added in v0.2.68
func WithPlaceholder(value string) fieldOption
func WithRequired ¶
func WithRequired(required bool) fieldOption
func WithRequiredInGUI ¶ added in v0.2.68
func WithRequiredInGUI(value bool) fieldOption
func WithRequiresExternalConnector ¶ added in v0.3.10
func WithRequiresExternalConnector(value bool) configOption
func WithShortHand ¶
func WithShortHand(sh string) fieldOption
func WithString ¶ added in v0.2.68
func WithString(f stringRuleMaker) fieldOption
func WithStringMap ¶ added in v0.2.83
func WithStringMap(f stringMapRuleMaker) fieldOption
func WithStringSlice ¶ added in v0.2.68
func WithStringSlice(f stringSliceRuleMaker) fieldOption
func WithStructFieldName ¶ added in v0.2.71
func WithStructFieldName(name string) fieldOption
func WithSupportsExternalResources ¶ added in v0.3.10
func WithSupportsExternalResources(value bool) configOption
Types ¶
type BoolRuler ¶ added in v0.2.68
type BoolRuler struct {
// contains filtered or unexported fields
}
func NewBoolBuilder ¶ added in v0.2.68
type Configurable ¶ added in v0.2.71
type Configuration ¶ added in v0.2.3
type Configuration struct {
Fields []SchemaField
Constraints []SchemaFieldRelationship
DisplayName string
HelpUrl string
IconUrl string
CatalogId string
IsDirectory bool
SupportsExternalResources bool
RequiresExternalConnector bool
FieldGroups []SchemaFieldGroup
}
func NewConfiguration ¶ added in v0.2.3
func NewConfiguration(fields []SchemaField, opts ...configOption) Configuration
func (*Configuration) FieldGroupFields ¶ added in v0.5.6
func (c *Configuration) FieldGroupFields(group string) map[string]SchemaField
func (*Configuration) Marshal ¶ added in v0.2.68
func (c *Configuration) Marshal() ([]byte, error)
func (*Configuration) MarshalJSON ¶ added in v0.2.68
func (c *Configuration) MarshalJSON() ([]byte, error)
type DecodeHookOption ¶ added in v0.4.12
type DecodeHookOption func(*decodeHookConfig)
func WithAdditionalDecodeHooks ¶ added in v0.4.12
func WithAdditionalDecodeHooks(funcs ...mapstructure.DecodeHookFunc) DecodeHookOption
type ErrConfigurationMissingFields ¶ added in v0.2.3
type ErrConfigurationMissingFields struct {
// contains filtered or unexported fields
}
func (*ErrConfigurationMissingFields) Error ¶ added in v0.2.3
func (e *ErrConfigurationMissingFields) Error() string
func (*ErrConfigurationMissingFields) Push ¶ added in v0.2.3
func (e *ErrConfigurationMissingFields) Push(err error)
type ExportTarget ¶ added in v0.2.68
type ExportTarget string
ExportTarget specifies who sets the flag.
CLI: dev ops invoking the connector, as for service mode, eg flag that specifies a file path on disk GUI: C1 tenant admin on the Web. Inclusive of CLI. eg service user name Ops: C1 support dashbaord. Inclusive of CLI. eg log level None: Only currently usable for the default fields. Those flags are consumed by the Syncer, not the Connector. ExportTarget is used by both dynamic conf generation and the conf schema exporting logic
const ( ExportTargetNone ExportTarget = "none" ExportTargetGUI ExportTarget = "gui" ExportTargetOps ExportTarget = "ops" ExportTargetCLIOnly ExportTarget = "cli" )
type FieldRule ¶ added in v0.2.68
type FieldRule struct {
// contains filtered or unexported fields
}
type IntRuler ¶ added in v0.2.68
type IntRuler struct {
// contains filtered or unexported fields
}
func NewIntBuilder ¶ added in v0.2.68
func NewIntBuilder(rules *v1_conf.Int64Rules) *IntRuler
func (*IntRuler) ValidateEmpty ¶ added in v0.2.68
type Option ¶ added in v0.5.6
type Option func(*validateOptions)
func WithAuthMethod ¶ added in v0.5.6
type Relationship ¶
type Relationship int
const ( Invalid Relationship = iota RequiredTogether MutuallyExclusive AtLeastOne Dependents )
type SchemaField ¶
type SchemaField struct {
FieldName string
Required bool
DefaultValue any
Description string
ExportTarget ExportTarget
HelpURL string
Variant Variant
Rules FieldRule
Secret bool
StructFieldName string
// Default fields - syncer side
SyncerConfig syncerConfig
// Config acutally ingested on the connector side - auth, regions, etc
ConnectorConfig connectorConfig
WasReExported bool
// Groups
FieldGroups []SchemaFieldGroup
}
func BoolField ¶
func BoolField(name string, optional ...fieldOption) SchemaField
func EnsureDefaultFieldsExists ¶
func EnsureDefaultFieldsExists(originalFields []SchemaField) []SchemaField
func FileUploadField ¶ added in v0.4.10
func FileUploadField(name string, bonusStrings []string, optional ...fieldOption) SchemaField
func IntField ¶
func IntField(name string, optional ...fieldOption) SchemaField
func LambdaServerFields ¶ added in v0.2.71
func LambdaServerFields() []SchemaField
func Oauth2Field ¶ added in v0.5.5
func Oauth2Field(name string, optional ...fieldOption) SchemaField
func SelectField ¶ added in v0.2.68
func SelectField(name string, options []string, optional ...fieldOption) SchemaField
func StringField ¶
func StringField(name string, optional ...fieldOption) SchemaField
func StringMapField ¶ added in v0.2.83
func StringMapField(name string, optional ...fieldOption) SchemaField
func StringSliceField ¶ added in v0.2.13
func StringSliceField(name string, optional ...fieldOption) SchemaField
func (SchemaField) ExportAs ¶ added in v0.3.3
func (s SchemaField) ExportAs(et ExportTarget) SchemaField
func (SchemaField) GetCLIShortHand ¶ added in v0.2.68
func (s SchemaField) GetCLIShortHand() string
func (SchemaField) GetDescription ¶
func (s SchemaField) GetDescription() string
func (SchemaField) GetName ¶
func (s SchemaField) GetName() string
func (SchemaField) IsHidden ¶ added in v0.2.68
func (s SchemaField) IsHidden() bool
func (SchemaField) IsPersistent ¶ added in v0.2.68
func (s SchemaField) IsPersistent() bool
type SchemaFieldGroup ¶ added in v0.4.13
type SchemaFieldGroup struct {
Name string
DisplayName string
HelpText string
Fields []SchemaField
Default bool
}
func (*SchemaFieldGroup) FieldMap ¶ added in v0.5.6
func (i *SchemaFieldGroup) FieldMap() map[string]SchemaField
type SchemaFieldRelationship ¶
type SchemaFieldRelationship struct {
Kind Relationship
Fields []SchemaField
ExpectedFields []SchemaField // Not really expected, just another field bag.
}
func EnsureDefaultRelationships ¶
func EnsureDefaultRelationships(original []SchemaFieldRelationship) []SchemaFieldRelationship
func FieldsAtLeastOneUsed ¶ added in v0.2.4
func FieldsAtLeastOneUsed(fields ...SchemaField) SchemaFieldRelationship
FieldsAtLeastOneUsed - the provided fields are valid if and only if at least one field is present.
func FieldsDependentOn ¶ added in v0.2.10
func FieldsDependentOn(fields []SchemaField, required []SchemaField) SchemaFieldRelationship
FieldsDependentOn - the provided fields are valid if and only if every field in `required` are also present.
func FieldsMutuallyExclusive ¶
func FieldsMutuallyExclusive(fields ...SchemaField) SchemaFieldRelationship
FieldsMutuallyExclusive - the provided fields are valid if and only if at most one field is present.
func FieldsRequiredTogether ¶
func FieldsRequiredTogether(fields ...SchemaField) SchemaFieldRelationship
FieldsRequiredTogether - the provided fields are valid if and only if every provided field is present.
type SchemaTypes ¶ added in v0.2.68
type StringMapRuler ¶ added in v0.2.83
type StringMapRuler struct {
// contains filtered or unexported fields
}
func NewStringMapBuilder ¶ added in v0.2.83
func NewStringMapBuilder(rules *v1_conf.StringMapRules) *StringMapRuler
func (*StringMapRuler) WithRequired ¶ added in v0.2.83
func (r *StringMapRuler) WithRequired(required bool) *StringMapRuler
func (*StringMapRuler) WithValidateEmpty ¶ added in v0.2.83
func (r *StringMapRuler) WithValidateEmpty(validateEmpty bool) *StringMapRuler
type StringRuler ¶ added in v0.2.68
type StringRuler struct {
// contains filtered or unexported fields
}
func NewStringBuilder ¶ added in v0.2.68
func NewStringBuilder(rules *v1_conf.StringRules) *StringRuler
func (*StringRuler) Contains ¶ added in v0.2.68
func (b *StringRuler) Contains(value string) *StringRuler
func (*StringRuler) Eq ¶ added in v0.2.68
func (b *StringRuler) Eq(value string) *StringRuler
func (*StringRuler) In ¶ added in v0.2.68
func (b *StringRuler) In(values []string) *StringRuler
func (*StringRuler) IsAddress ¶ added in v0.2.68
func (b *StringRuler) IsAddress() *StringRuler
func (*StringRuler) IsEmail ¶ added in v0.2.68
func (b *StringRuler) IsEmail() *StringRuler
func (*StringRuler) IsHostname ¶ added in v0.2.68
func (b *StringRuler) IsHostname() *StringRuler
func (*StringRuler) IsIP ¶ added in v0.2.68
func (b *StringRuler) IsIP() *StringRuler
func (*StringRuler) IsIpv4 ¶ added in v0.2.68
func (b *StringRuler) IsIpv4() *StringRuler
func (*StringRuler) IsIpv6 ¶ added in v0.2.68
func (b *StringRuler) IsIpv6() *StringRuler
func (*StringRuler) IsURI ¶ added in v0.2.68
func (b *StringRuler) IsURI() *StringRuler
func (*StringRuler) IsUUID ¶ added in v0.2.68
func (b *StringRuler) IsUUID() *StringRuler
func (*StringRuler) Len ¶ added in v0.2.68
func (b *StringRuler) Len(value uint64) *StringRuler
func (*StringRuler) MaxLen ¶ added in v0.2.68
func (b *StringRuler) MaxLen(value uint64) *StringRuler
func (*StringRuler) MinLen ¶ added in v0.2.68
func (b *StringRuler) MinLen(value uint64) *StringRuler
func (*StringRuler) NotContains ¶ added in v0.2.68
func (b *StringRuler) NotContains(value string) *StringRuler
func (*StringRuler) NotIn ¶ added in v0.2.68
func (b *StringRuler) NotIn(values []string) *StringRuler
func (*StringRuler) Pattern ¶ added in v0.2.68
func (b *StringRuler) Pattern(value string) *StringRuler
func (*StringRuler) Prefix ¶ added in v0.2.68
func (b *StringRuler) Prefix(value string) *StringRuler
func (*StringRuler) Suffix ¶ added in v0.2.68
func (b *StringRuler) Suffix(value string) *StringRuler
type StringSliceRuler ¶ added in v0.2.68
type StringSliceRuler struct {
// contains filtered or unexported fields
}
func NewRepeatedStringBuilder ¶ added in v0.2.68
func NewRepeatedStringBuilder(rules *v1_conf.RepeatedStringRules) *StringSliceRuler
func (*StringSliceRuler) ItemRules ¶ added in v0.2.68
func (b *StringSliceRuler) ItemRules(f func(stringer *StringRuler)) *StringSliceRuler
func (*StringSliceRuler) MaxItems ¶ added in v0.2.68
func (b *StringSliceRuler) MaxItems(value uint64) *StringSliceRuler
func (*StringSliceRuler) MinItems ¶ added in v0.2.68
func (b *StringSliceRuler) MinItems(value uint64) *StringSliceRuler
func (*StringSliceRuler) Unique ¶ added in v0.2.68
func (b *StringSliceRuler) Unique(unique bool) *StringSliceRuler
func (*StringSliceRuler) ValidateEmpty ¶ added in v0.2.68
func (b *StringSliceRuler) ValidateEmpty(value bool) *StringSliceRuler
type WebFieldType ¶ added in v0.2.68
type WebFieldType string
const ( Text WebFieldType = "TEXT" Randomize WebFieldType = "RANDOMIZE" OAuth2 WebFieldType = "OAUTH2" ConnectorDerivedOptions WebFieldType = "CONNECTOR_DERIVED_OPTIONS" FileUpload WebFieldType = "FILE_UPLOAD" )
type WellKnownStrings ¶ added in v0.2.68
type WellKnownStrings string
const ( WellKnownEmailString WellKnownStrings = "EMAIL" WellKnownHostnameString WellKnownStrings = "HOSTNAME" WellKnownIPString WellKnownStrings = "IP" WellKnownIpv4String WellKnownStrings = "IPv4" WellKnownIpv6String WellKnownStrings = "IPv6" WellKnownURIString WellKnownStrings = "URI" WellKnownUUIDString WellKnownStrings = "UUID" )