Documentation ¶
Index ¶
- Constants
- Variables
- type AmpLayout
- func (*AmpLayout) Descriptor() ([]byte, []int)deprecated
- func (x *AmpLayout) GetDefinesDefaultHeight() bool
- func (x *AmpLayout) GetDefinesDefaultWidth() bool
- func (x *AmpLayout) GetSupportedLayouts() []AmpLayout_Layout
- func (*AmpLayout) ProtoMessage()
- func (x *AmpLayout) ProtoReflect() protoreflect.Message
- func (x *AmpLayout) Reset()
- func (x *AmpLayout) String() string
- type AmpLayout_Layout
- func (AmpLayout_Layout) Descriptor() protoreflect.EnumDescriptor
- func (x AmpLayout_Layout) Enum() *AmpLayout_Layout
- func (AmpLayout_Layout) EnumDescriptor() ([]byte, []int)deprecated
- func (x AmpLayout_Layout) Number() protoreflect.EnumNumber
- func (x AmpLayout_Layout) String() string
- func (AmpLayout_Layout) Type() protoreflect.EnumType
- func (x *AmpLayout_Layout) UnmarshalJSON(b []byte) errordeprecated
- type AncestorMarker
- type AncestorMarker_Marker
- func (AncestorMarker_Marker) Descriptor() protoreflect.EnumDescriptor
- func (x AncestorMarker_Marker) Enum() *AncestorMarker_Marker
- func (AncestorMarker_Marker) EnumDescriptor() ([]byte, []int)deprecated
- func (x AncestorMarker_Marker) Number() protoreflect.EnumNumber
- func (x AncestorMarker_Marker) String() string
- func (AncestorMarker_Marker) Type() protoreflect.EnumType
- func (x *AncestorMarker_Marker) UnmarshalJSON(b []byte) errordeprecated
- type AtRuleSpec
- func (*AtRuleSpec) Descriptor() ([]byte, []int)deprecated
- func (x *AtRuleSpec) GetMediaQuerySpec() *MediaQuerySpec
- func (x *AtRuleSpec) GetName() string
- func (*AtRuleSpec) ProtoMessage()
- func (x *AtRuleSpec) ProtoReflect() protoreflect.Message
- func (x *AtRuleSpec) Reset()
- func (x *AtRuleSpec) String() string
- type AttrList
- type AttrSpec
- func (*AttrSpec) Descriptor() ([]byte, []int)deprecated
- func (x *AttrSpec) GetAddValueToSet() AttrSpec_ValueSet
- func (x *AttrSpec) GetAlternativeNames() []string
- func (x *AttrSpec) GetCssDeclaration() []*CssDeclaration
- func (x *AttrSpec) GetDeprecation() string
- func (x *AttrSpec) GetDeprecationUrl() string
- func (x *AttrSpec) GetDisabledBy() []string
- func (x *AttrSpec) GetDisallowedValueRegex() string
- func (x *AttrSpec) GetDispatchKey() AttrSpec_DispatchKeyType
- func (x *AttrSpec) GetEnabledBy() []string
- func (x *AttrSpec) GetImplicit() bool
- func (x *AttrSpec) GetMandatory() bool
- func (x *AttrSpec) GetMandatoryAnyof() string
- func (x *AttrSpec) GetMandatoryOneof() string
- func (x *AttrSpec) GetName() string
- func (x *AttrSpec) GetRequiresAncestor() *AncestorMarker
- func (x *AttrSpec) GetRequiresExtension() []string
- func (x *AttrSpec) GetTrigger() *AttrTriggerSpec
- func (x *AttrSpec) GetValue() []string
- func (x *AttrSpec) GetValueCasei() []string
- func (x *AttrSpec) GetValueDocCss() bool
- func (x *AttrSpec) GetValueDocSvgCss() bool
- func (x *AttrSpec) GetValueOneofSet() AttrSpec_ValueSet
- func (x *AttrSpec) GetValueProperties() *PropertySpecList
- func (x *AttrSpec) GetValueRegex() string
- func (x *AttrSpec) GetValueRegexCasei() string
- func (x *AttrSpec) GetValueUrl() *UrlSpec
- func (*AttrSpec) ProtoMessage()
- func (x *AttrSpec) ProtoReflect() protoreflect.Message
- func (x *AttrSpec) Reset()
- func (x *AttrSpec) String() string
- type AttrSpec_DispatchKeyType
- func (AttrSpec_DispatchKeyType) Descriptor() protoreflect.EnumDescriptor
- func (x AttrSpec_DispatchKeyType) Enum() *AttrSpec_DispatchKeyType
- func (AttrSpec_DispatchKeyType) EnumDescriptor() ([]byte, []int)deprecated
- func (x AttrSpec_DispatchKeyType) Number() protoreflect.EnumNumber
- func (x AttrSpec_DispatchKeyType) String() string
- func (AttrSpec_DispatchKeyType) Type() protoreflect.EnumType
- func (x *AttrSpec_DispatchKeyType) UnmarshalJSON(b []byte) errordeprecated
- type AttrSpec_ValueSet
- func (AttrSpec_ValueSet) Descriptor() protoreflect.EnumDescriptor
- func (x AttrSpec_ValueSet) Enum() *AttrSpec_ValueSet
- func (AttrSpec_ValueSet) EnumDescriptor() ([]byte, []int)deprecated
- func (x AttrSpec_ValueSet) Number() protoreflect.EnumNumber
- func (x AttrSpec_ValueSet) String() string
- func (AttrSpec_ValueSet) Type() protoreflect.EnumType
- func (x *AttrSpec_ValueSet) UnmarshalJSON(b []byte) errordeprecated
- type AttrTriggerSpec
- func (*AttrTriggerSpec) Descriptor() ([]byte, []int)deprecated
- func (x *AttrTriggerSpec) GetAlsoRequiresAttr() []string
- func (x *AttrTriggerSpec) GetIfValueRegex() string
- func (*AttrTriggerSpec) ProtoMessage()
- func (x *AttrTriggerSpec) ProtoReflect() protoreflect.Message
- func (x *AttrTriggerSpec) Reset()
- func (x *AttrTriggerSpec) String() string
- type CdataSpec
- func (*CdataSpec) Descriptor() ([]byte, []int)deprecated
- func (x *CdataSpec) GetCdataRegex() string
- func (x *CdataSpec) GetCssSpec() *CssSpec
- func (x *CdataSpec) GetDisallowedCdataRegex() []*DisallowedCDataRegex
- func (x *CdataSpec) GetDocCssBytes() bool
- func (x *CdataSpec) GetMandatoryCdata() string
- func (x *CdataSpec) GetMaxBytes() int32
- func (x *CdataSpec) GetMaxBytesSpecUrl() string
- func (x *CdataSpec) GetWhitespaceOnly() bool
- func (*CdataSpec) ProtoMessage()
- func (x *CdataSpec) ProtoReflect() protoreflect.Message
- func (x *CdataSpec) Reset()
- func (x *CdataSpec) String() string
- type ChildTagSpec
- func (*ChildTagSpec) Descriptor() ([]byte, []int)deprecated
- func (x *ChildTagSpec) GetChildTagNameOneof() []string
- func (x *ChildTagSpec) GetFirstChildTagNameOneof() []string
- func (x *ChildTagSpec) GetMandatoryMinNumChildTags() int32
- func (x *ChildTagSpec) GetMandatoryNumChildTags() int32
- func (*ChildTagSpec) ProtoMessage()
- func (x *ChildTagSpec) ProtoReflect() protoreflect.Message
- func (x *ChildTagSpec) Reset()
- func (x *ChildTagSpec) String() string
- type CssDeclaration
- func (*CssDeclaration) Descriptor() ([]byte, []int)deprecated
- func (x *CssDeclaration) GetName() string
- func (x *CssDeclaration) GetValueCasei() []string
- func (x *CssDeclaration) GetValueRegexCasei() string
- func (*CssDeclaration) ProtoMessage()
- func (x *CssDeclaration) ProtoReflect() protoreflect.Message
- func (x *CssDeclaration) Reset()
- func (x *CssDeclaration) String() string
- type CssSpec
- func (*CssSpec) Descriptor() ([]byte, []int)deprecated
- func (x *CssSpec) GetAllowImportant() bool
- func (x *CssSpec) GetAtRuleSpec() []*AtRuleSpec
- func (x *CssSpec) GetDeclaration() []string
- func (x *CssSpec) GetSelectorSpec() *SelectorSpec
- func (x *CssSpec) GetValidateAmp4Ads() bool
- func (x *CssSpec) GetValidateKeyframes() bool
- func (*CssSpec) ProtoMessage()
- func (x *CssSpec) ProtoReflect() protoreflect.Message
- func (x *CssSpec) Reset()
- func (x *CssSpec) String() string
- type DeclarationList
- func (*DeclarationList) Descriptor() ([]byte, []int)deprecated
- func (x *DeclarationList) GetDeclaration() []*CssDeclaration
- func (x *DeclarationList) GetName() string
- func (*DeclarationList) ProtoMessage()
- func (x *DeclarationList) ProtoReflect() protoreflect.Message
- func (x *DeclarationList) Reset()
- func (x *DeclarationList) String() string
- type DescendantTagList
- func (*DescendantTagList) Descriptor() ([]byte, []int)deprecated
- func (x *DescendantTagList) GetName() string
- func (x *DescendantTagList) GetTag() []string
- func (*DescendantTagList) ProtoMessage()
- func (x *DescendantTagList) ProtoReflect() protoreflect.Message
- func (x *DescendantTagList) Reset()
- func (x *DescendantTagList) String() string
- type DisallowedCDataRegex
- func (*DisallowedCDataRegex) Descriptor() ([]byte, []int)deprecated
- func (x *DisallowedCDataRegex) GetErrorMessage() string
- func (x *DisallowedCDataRegex) GetRegex() string
- func (*DisallowedCDataRegex) ProtoMessage()
- func (x *DisallowedCDataRegex) ProtoReflect() protoreflect.Message
- func (x *DisallowedCDataRegex) Reset()
- func (x *DisallowedCDataRegex) String() string
- type DocCssSpec
- func (*DocCssSpec) Descriptor() ([]byte, []int)deprecated
- func (x *DocCssSpec) GetAllowAllDeclarationInStyle() bool
- func (x *DocCssSpec) GetAllowImportant() bool
- func (x *DocCssSpec) GetDeclaration() []*CssDeclaration
- func (x *DocCssSpec) GetDeclarationList() []string
- func (x *DocCssSpec) GetDeclarationListSvg() []string
- func (x *DocCssSpec) GetDeclarationSvg() []*CssDeclaration
- func (x *DocCssSpec) GetDisabledBy() []string
- func (x *DocCssSpec) GetEnabledBy() []string
- func (x *DocCssSpec) GetExpandVendorPrefixes() bool
- func (x *DocCssSpec) GetFontUrlSpec() *UrlSpec
- func (x *DocCssSpec) GetHtmlFormat() []HtmlFormat_Code
- func (x *DocCssSpec) GetImageUrlSpec() *UrlSpec
- func (x *DocCssSpec) GetMaxBytes() int32
- func (x *DocCssSpec) GetMaxBytesIsWarning() bool
- func (x *DocCssSpec) GetMaxBytesPerInlineStyle() int32
- func (x *DocCssSpec) GetMaxBytesSpecUrl() string
- func (x *DocCssSpec) GetSpecUrl() string
- func (x *DocCssSpec) GetUrlBytesIncluded() bool
- func (*DocCssSpec) ProtoMessage()
- func (x *DocCssSpec) ProtoReflect() protoreflect.Message
- func (x *DocCssSpec) Reset()
- func (x *DocCssSpec) String() string
- type DocSpec
- func (*DocSpec) Descriptor() ([]byte, []int)deprecated
- func (x *DocSpec) GetDisabledBy() []string
- func (x *DocSpec) GetEnabledBy() []string
- func (x *DocSpec) GetHtmlFormat() []HtmlFormat_Code
- func (x *DocSpec) GetMaxBytes() int32
- func (x *DocSpec) GetMaxBytesSpecUrl() string
- func (*DocSpec) ProtoMessage()
- func (x *DocSpec) ProtoReflect() protoreflect.Message
- func (x *DocSpec) Reset()
- func (x *DocSpec) String() string
- type ErrorCategory
- type ErrorCategory_Code
- func (ErrorCategory_Code) Descriptor() protoreflect.EnumDescriptor
- func (x ErrorCategory_Code) Enum() *ErrorCategory_Code
- func (ErrorCategory_Code) EnumDescriptor() ([]byte, []int)deprecated
- func (x ErrorCategory_Code) Number() protoreflect.EnumNumber
- func (x ErrorCategory_Code) String() string
- func (ErrorCategory_Code) Type() protoreflect.EnumType
- func (x *ErrorCategory_Code) UnmarshalJSON(b []byte) errordeprecated
- type ErrorFormat
- func (*ErrorFormat) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorFormat) GetCode() ValidationError_Code
- func (x *ErrorFormat) GetFormat() string
- func (*ErrorFormat) ProtoMessage()
- func (x *ErrorFormat) ProtoReflect() protoreflect.Message
- func (x *ErrorFormat) Reset()
- func (x *ErrorFormat) String() string
- type ErrorSpecificity
- func (*ErrorSpecificity) Descriptor() ([]byte, []int)deprecated
- func (x *ErrorSpecificity) GetCode() ValidationError_Code
- func (x *ErrorSpecificity) GetSpecificity() int32
- func (*ErrorSpecificity) ProtoMessage()
- func (x *ErrorSpecificity) ProtoReflect() protoreflect.Message
- func (x *ErrorSpecificity) Reset()
- func (x *ErrorSpecificity) String() string
- type ExtensionSpec
- func (*ExtensionSpec) Descriptor() ([]byte, []int)deprecated
- func (x *ExtensionSpec) GetBentoSupportedVersion() []string
- func (x *ExtensionSpec) GetDeprecatedAllowDuplicates() bool
- func (x *ExtensionSpec) GetDeprecatedVersion() []string
- func (x *ExtensionSpec) GetExtensionType() ExtensionSpec_ExtensionType
- func (x *ExtensionSpec) GetName() string
- func (x *ExtensionSpec) GetRequiresUsage() ExtensionSpec_ExtensionUsageRequirement
- func (x *ExtensionSpec) GetVersion() []string
- func (x *ExtensionSpec) GetVersionName() string
- func (*ExtensionSpec) ProtoMessage()
- func (x *ExtensionSpec) ProtoReflect() protoreflect.Message
- func (x *ExtensionSpec) Reset()
- func (x *ExtensionSpec) String() string
- type ExtensionSpec_ExtensionType
- func (ExtensionSpec_ExtensionType) Descriptor() protoreflect.EnumDescriptor
- func (x ExtensionSpec_ExtensionType) Enum() *ExtensionSpec_ExtensionType
- func (ExtensionSpec_ExtensionType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ExtensionSpec_ExtensionType) Number() protoreflect.EnumNumber
- func (x ExtensionSpec_ExtensionType) String() string
- func (ExtensionSpec_ExtensionType) Type() protoreflect.EnumType
- func (x *ExtensionSpec_ExtensionType) UnmarshalJSON(b []byte) errordeprecated
- type ExtensionSpec_ExtensionUsageRequirement
- func (ExtensionSpec_ExtensionUsageRequirement) Descriptor() protoreflect.EnumDescriptor
- func (x ExtensionSpec_ExtensionUsageRequirement) Enum() *ExtensionSpec_ExtensionUsageRequirement
- func (ExtensionSpec_ExtensionUsageRequirement) EnumDescriptor() ([]byte, []int)deprecated
- func (x ExtensionSpec_ExtensionUsageRequirement) Number() protoreflect.EnumNumber
- func (x ExtensionSpec_ExtensionUsageRequirement) String() string
- func (ExtensionSpec_ExtensionUsageRequirement) Type() protoreflect.EnumType
- func (x *ExtensionSpec_ExtensionUsageRequirement) UnmarshalJSON(b []byte) errordeprecated
- type HtmlFormat
- type HtmlFormat_Code
- func (HtmlFormat_Code) Descriptor() protoreflect.EnumDescriptor
- func (x HtmlFormat_Code) Enum() *HtmlFormat_Code
- func (HtmlFormat_Code) EnumDescriptor() ([]byte, []int)deprecated
- func (x HtmlFormat_Code) Number() protoreflect.EnumNumber
- func (x HtmlFormat_Code) String() string
- func (HtmlFormat_Code) Type() protoreflect.EnumType
- func (x *HtmlFormat_Code) UnmarshalJSON(b []byte) errordeprecated
- type MediaQuerySpec
- func (*MediaQuerySpec) Descriptor() ([]byte, []int)deprecated
- func (x *MediaQuerySpec) GetFeature() []string
- func (x *MediaQuerySpec) GetIssuesAsError() bool
- func (x *MediaQuerySpec) GetType() []string
- func (*MediaQuerySpec) ProtoMessage()
- func (x *MediaQuerySpec) ProtoReflect() protoreflect.Message
- func (x *MediaQuerySpec) Reset()
- func (x *MediaQuerySpec) String() string
- type PropertySpec
- func (*PropertySpec) Descriptor() ([]byte, []int)deprecated
- func (x *PropertySpec) GetMandatory() bool
- func (x *PropertySpec) GetName() string
- func (x *PropertySpec) GetValue() string
- func (x *PropertySpec) GetValueDouble() float64
- func (*PropertySpec) ProtoMessage()
- func (x *PropertySpec) ProtoReflect() protoreflect.Message
- func (x *PropertySpec) Reset()
- func (x *PropertySpec) String() string
- type PropertySpecList
- func (*PropertySpecList) Descriptor() ([]byte, []int)deprecated
- func (x *PropertySpecList) GetProperties() []*PropertySpec
- func (*PropertySpecList) ProtoMessage()
- func (x *PropertySpecList) ProtoReflect() protoreflect.Message
- func (x *PropertySpecList) Reset()
- func (x *PropertySpecList) String() string
- type ReferencePoint
- func (*ReferencePoint) Descriptor() ([]byte, []int)deprecated
- func (x *ReferencePoint) GetMandatory() bool
- func (x *ReferencePoint) GetTagSpecName() string
- func (x *ReferencePoint) GetUnique() bool
- func (*ReferencePoint) ProtoMessage()
- func (x *ReferencePoint) ProtoReflect() protoreflect.Message
- func (x *ReferencePoint) Reset()
- func (x *ReferencePoint) String() string
- type SelectorSpec
- func (*SelectorSpec) Descriptor() ([]byte, []int)deprecated
- func (x *SelectorSpec) GetAttributeName() []string
- func (x *SelectorSpec) GetPseudoClass() []string
- func (x *SelectorSpec) GetPseudoElement() []string
- func (*SelectorSpec) ProtoMessage()
- func (x *SelectorSpec) ProtoReflect() protoreflect.Message
- func (x *SelectorSpec) Reset()
- func (x *SelectorSpec) String() string
- type TagSpec
- func (*TagSpec) Descriptor() ([]byte, []int)deprecated
- func (x *TagSpec) GetAlsoRequiresTagWarning() []string
- func (x *TagSpec) GetAmpLayout() *AmpLayout
- func (x *TagSpec) GetAttrLists() []string
- func (x *TagSpec) GetAttrs() []*AttrSpec
- func (x *TagSpec) GetCdata() *CdataSpec
- func (x *TagSpec) GetChildTags() *ChildTagSpec
- func (x *TagSpec) GetDeprecation() string
- func (x *TagSpec) GetDeprecationUrl() string
- func (x *TagSpec) GetDescendantTagList() string
- func (x *TagSpec) GetDescriptiveName() string
- func (x *TagSpec) GetDisabledBy() []string
- func (x *TagSpec) GetDisallowedAncestor() []string
- func (x *TagSpec) GetEnabledBy() []string
- func (x *TagSpec) GetExcludesCondition() []string
- func (x *TagSpec) GetExplicitAttrsOnly() bool
- func (x *TagSpec) GetExtensionSpec() *ExtensionSpec
- func (x *TagSpec) GetHtmlFormat() []HtmlFormat_Code
- func (x *TagSpec) GetMandatory() bool
- func (x *TagSpec) GetMandatoryAlternatives() string
- func (x *TagSpec) GetMandatoryAncestor() string
- func (x *TagSpec) GetMandatoryAncestorSuggestedAlternative() string
- func (x *TagSpec) GetMandatoryLastChild() bool
- func (x *TagSpec) GetMandatoryParent() string
- func (x *TagSpec) GetMarkDescendants() *AncestorMarker
- func (x *TagSpec) GetNamedId() TagSpec_NamedId
- func (x *TagSpec) GetReferencePoints() []*ReferencePoint
- func (x *TagSpec) GetRequiresCondition() []string
- func (x *TagSpec) GetRequiresExtension() []string
- func (x *TagSpec) GetSatisfiesCondition() []string
- func (x *TagSpec) GetSiblingsDisallowed() bool
- func (x *TagSpec) GetSpecName() string
- func (x *TagSpec) GetSpecUrl() string
- func (x *TagSpec) GetTagName() string
- func (x *TagSpec) GetUnique() bool
- func (x *TagSpec) GetUniqueWarning() bool
- func (*TagSpec) ProtoMessage()
- func (x *TagSpec) ProtoReflect() protoreflect.Message
- func (x *TagSpec) Reset()
- func (x *TagSpec) String() string
- type TagSpec_NamedId
- func (TagSpec_NamedId) Descriptor() protoreflect.EnumDescriptor
- func (x TagSpec_NamedId) Enum() *TagSpec_NamedId
- func (TagSpec_NamedId) EnumDescriptor() ([]byte, []int)deprecated
- func (x TagSpec_NamedId) Number() protoreflect.EnumNumber
- func (x TagSpec_NamedId) String() string
- func (TagSpec_NamedId) Type() protoreflect.EnumType
- func (x *TagSpec_NamedId) UnmarshalJSON(b []byte) errordeprecated
- type UrlSpec
- func (*UrlSpec) Descriptor() ([]byte, []int)deprecated
- func (x *UrlSpec) GetAllowEmpty() bool
- func (x *UrlSpec) GetAllowRelative() bool
- func (x *UrlSpec) GetProtocol() []string
- func (*UrlSpec) ProtoMessage()
- func (x *UrlSpec) ProtoReflect() protoreflect.Message
- func (x *UrlSpec) Reset()
- func (x *UrlSpec) String() string
- type ValidationError
- func (*ValidationError) Descriptor() ([]byte, []int)deprecated
- func (x *ValidationError) GetCategory() ErrorCategory_Code
- func (x *ValidationError) GetCode() ValidationError_Code
- func (x *ValidationError) GetCol() int32
- func (x *ValidationError) GetDataAmpReportTestValue() string
- func (x *ValidationError) GetLine() int32
- func (x *ValidationError) GetParams() []string
- func (x *ValidationError) GetSeverity() ValidationError_Severity
- func (x *ValidationError) GetSpecUrl() string
- func (*ValidationError) ProtoMessage()
- func (x *ValidationError) ProtoReflect() protoreflect.Message
- func (x *ValidationError) Reset()
- func (x *ValidationError) String() string
- type ValidationError_Code
- func (ValidationError_Code) Descriptor() protoreflect.EnumDescriptor
- func (x ValidationError_Code) Enum() *ValidationError_Code
- func (ValidationError_Code) EnumDescriptor() ([]byte, []int)deprecated
- func (x ValidationError_Code) Number() protoreflect.EnumNumber
- func (x ValidationError_Code) String() string
- func (ValidationError_Code) Type() protoreflect.EnumType
- func (x *ValidationError_Code) UnmarshalJSON(b []byte) errordeprecated
- type ValidationError_Severity
- func (ValidationError_Severity) Descriptor() protoreflect.EnumDescriptor
- func (x ValidationError_Severity) Enum() *ValidationError_Severity
- func (ValidationError_Severity) EnumDescriptor() ([]byte, []int)deprecated
- func (x ValidationError_Severity) Number() protoreflect.EnumNumber
- func (x ValidationError_Severity) String() string
- func (ValidationError_Severity) Type() protoreflect.EnumType
- func (x *ValidationError_Severity) UnmarshalJSON(b []byte) errordeprecated
- type ValidationResult
- func (*ValidationResult) Descriptor() ([]byte, []int)deprecated
- func (x *ValidationResult) GetErrors() []*ValidationError
- func (x *ValidationResult) GetSpecFileRevision() int32deprecated
- func (x *ValidationResult) GetStatus() ValidationResult_Status
- func (x *ValidationResult) GetTransformerVersion() int32
- func (x *ValidationResult) GetTypeIdentifier() []string
- func (x *ValidationResult) GetValidatorRevision() int32deprecated
- func (x *ValidationResult) GetValueSetProvisions() []*ValueSetProvision
- func (x *ValidationResult) GetValueSetRequirements() []*ValueSetRequirement
- func (*ValidationResult) ProtoMessage()
- func (x *ValidationResult) ProtoReflect() protoreflect.Message
- func (x *ValidationResult) Reset()
- func (x *ValidationResult) String() string
- type ValidationResult_Status
- func (ValidationResult_Status) Descriptor() protoreflect.EnumDescriptor
- func (x ValidationResult_Status) Enum() *ValidationResult_Status
- func (ValidationResult_Status) EnumDescriptor() ([]byte, []int)deprecated
- func (x ValidationResult_Status) Number() protoreflect.EnumNumber
- func (x ValidationResult_Status) String() string
- func (ValidationResult_Status) Type() protoreflect.EnumType
- func (x *ValidationResult_Status) UnmarshalJSON(b []byte) errordeprecated
- type ValidatorRules
- func (*ValidatorRules) Descriptor() ([]byte, []int)deprecated
- func (x *ValidatorRules) GetAttrLists() []*AttrList
- func (x *ValidatorRules) GetCss() []*DocCssSpec
- func (x *ValidatorRules) GetDeclarationList() []*DeclarationList
- func (x *ValidatorRules) GetDescendantTagList() []*DescendantTagList
- func (x *ValidatorRules) GetDoc() []*DocSpec
- func (x *ValidatorRules) GetErrorFormats() []*ErrorFormat
- func (x *ValidatorRules) GetErrorSpecificity() []*ErrorSpecificity
- func (x *ValidatorRules) GetMinValidatorRevisionRequired() int32deprecated
- func (x *ValidatorRules) GetScriptSpecUrl() string
- func (x *ValidatorRules) GetSpecFileRevision() int32deprecated
- func (x *ValidatorRules) GetStylesSpecUrl() string
- func (x *ValidatorRules) GetTags() []*TagSpec
- func (x *ValidatorRules) GetTemplateSpecUrl() string
- func (*ValidatorRules) ProtoMessage()
- func (x *ValidatorRules) ProtoReflect() protoreflect.Message
- func (x *ValidatorRules) Reset()
- func (x *ValidatorRules) String() string
- type ValueSetProvision
- func (*ValueSetProvision) Descriptor() ([]byte, []int)deprecated
- func (x *ValueSetProvision) GetSet() AttrSpec_ValueSet
- func (x *ValueSetProvision) GetValue() string
- func (*ValueSetProvision) ProtoMessage()
- func (x *ValueSetProvision) ProtoReflect() protoreflect.Message
- func (x *ValueSetProvision) Reset()
- func (x *ValueSetProvision) String() string
- type ValueSetRequirement
- func (*ValueSetRequirement) Descriptor() ([]byte, []int)deprecated
- func (x *ValueSetRequirement) GetErrorIfUnsatisfied() *ValidationError
- func (x *ValueSetRequirement) GetProvision() *ValueSetProvision
- func (*ValueSetRequirement) ProtoMessage()
- func (x *ValueSetRequirement) ProtoReflect() protoreflect.Message
- func (x *ValueSetRequirement) Reset()
- func (x *ValueSetRequirement) String() string
Constants ¶
const ( Default_UrlSpec_AllowRelative = bool(true) Default_UrlSpec_AllowEmpty = bool(false) )
Default values for UrlSpec fields.
const ( Default_AttrSpec_DispatchKey = AttrSpec_NONE_DISPATCH Default_AttrSpec_Implicit = bool(false) )
Default values for AttrSpec fields.
const ( Default_ChildTagSpec_MandatoryNumChildTags = int32(-1) Default_ChildTagSpec_MandatoryMinNumChildTags = int32(-1) )
Default values for ChildTagSpec fields.
const ( Default_ExtensionSpec_ExtensionType = ExtensionSpec_CUSTOM_ELEMENT Default_ExtensionSpec_DeprecatedAllowDuplicates = bool(false) Default_ExtensionSpec_RequiresUsage = ExtensionSpec_ERROR )
Default values for ExtensionSpec fields.
const ( Default_TagSpec_NamedId = TagSpec_NOT_SET Default_TagSpec_ExplicitAttrsOnly = bool(false) Default_TagSpec_SiblingsDisallowed = bool(false) Default_TagSpec_MandatoryLastChild = bool(false) )
Default values for TagSpec fields.
const ( Default_DocCssSpec_MaxBytesIsWarning = bool(false) Default_DocCssSpec_MaxBytes = int32(-2) Default_DocCssSpec_MaxBytesPerInlineStyle = int32(-1) Default_DocCssSpec_UrlBytesIncluded = bool(true) Default_DocCssSpec_AllowAllDeclarationInStyle = bool(false) Default_DocCssSpec_AllowImportant = bool(false) )
Default values for DocCssSpec fields.
const ( Default_ValidationError_Severity = ValidationError_ERROR Default_ValidationError_Line = int32(1) )
Default values for ValidationError fields.
const ( Default_ValidationResult_ValidatorRevision = int32(-1) Default_ValidationResult_SpecFileRevision = int32(-1) Default_ValidationResult_TransformerVersion = int32(0) )
Default values for ValidationResult fields.
const (
Default_CdataSpec_MaxBytes = int32(-2)
)
Default values for CdataSpec fields.
const (
Default_CssSpec_AllowImportant = bool(false)
)
Default values for CssSpec fields.
const (
Default_DocSpec_MaxBytes = int32(-2)
)
Default values for DocSpec fields.
const (
Default_MediaQuerySpec_IssuesAsError = bool(false)
)
Default values for MediaQuerySpec fields.
const (
Default_ValidatorRules_SpecFileRevision = int32(-1)
)
Default values for ValidatorRules fields.
Variables ¶
var ( AttrSpec_ValueSet_name = map[int32]string{ 0: "UNKNOWN_VALUESET", 1: "TEMPLATE_IDS", 2: "AMP_SCRIPT_IDS", } AttrSpec_ValueSet_value = map[string]int32{ "UNKNOWN_VALUESET": 0, "TEMPLATE_IDS": 1, "AMP_SCRIPT_IDS": 2, } )
Enum value maps for AttrSpec_ValueSet.
var ( AttrSpec_DispatchKeyType_name = map[int32]string{ 0: "NONE_DISPATCH", 1: "NAME_DISPATCH", 2: "NAME_VALUE_DISPATCH", 3: "NAME_VALUE_PARENT_DISPATCH", } AttrSpec_DispatchKeyType_value = map[string]int32{ "NONE_DISPATCH": 0, "NAME_DISPATCH": 1, "NAME_VALUE_DISPATCH": 2, "NAME_VALUE_PARENT_DISPATCH": 3, } )
Enum value maps for AttrSpec_DispatchKeyType.
var ( AmpLayout_Layout_name = map[int32]string{ 5: "CONTAINER", 6: "FILL", 2: "FIXED", 3: "FIXED_HEIGHT", 7: "FLEX_ITEM", 8: "FLUID", 9: "INTRINSIC", 1: "NODISPLAY", 4: "RESPONSIVE", 0: "UNKNOWN", } AmpLayout_Layout_value = map[string]int32{ "CONTAINER": 5, "FILL": 6, "FIXED": 2, "FIXED_HEIGHT": 3, "FLEX_ITEM": 7, "FLUID": 8, "INTRINSIC": 9, "NODISPLAY": 1, "RESPONSIVE": 4, "UNKNOWN": 0, } )
Enum value maps for AmpLayout_Layout.
var ( AncestorMarker_Marker_name = map[int32]string{ 0: "UNKNOWN", 1: "AUTOSCROLL", } AncestorMarker_Marker_value = map[string]int32{ "UNKNOWN": 0, "AUTOSCROLL": 1, } )
Enum value maps for AncestorMarker_Marker.
var ( ExtensionSpec_ExtensionType_name = map[int32]string{ 0: "UNKNOWN", 1: "CUSTOM_ELEMENT", 2: "CUSTOM_TEMPLATE", 3: "HOST_SERVICE", } ExtensionSpec_ExtensionType_value = map[string]int32{ "UNKNOWN": 0, "CUSTOM_ELEMENT": 1, "CUSTOM_TEMPLATE": 2, "HOST_SERVICE": 3, } )
Enum value maps for ExtensionSpec_ExtensionType.
var ( ExtensionSpec_ExtensionUsageRequirement_name = map[int32]string{ 1: "ERROR", 2: "EXEMPTED", 3: "NONE", } ExtensionSpec_ExtensionUsageRequirement_value = map[string]int32{ "ERROR": 1, "EXEMPTED": 2, "NONE": 3, } )
Enum value maps for ExtensionSpec_ExtensionUsageRequirement.
var ( HtmlFormat_Code_name = map[int32]string{ 0: "UNKNOWN_CODE", 1: "AMP", 2: "AMP4ADS", 3: "AMP4EMAIL", 4: "EXPERIMENTAL", } HtmlFormat_Code_value = map[string]int32{ "UNKNOWN_CODE": 0, "AMP": 1, "AMP4ADS": 2, "AMP4EMAIL": 3, "EXPERIMENTAL": 4, } )
Enum value maps for HtmlFormat_Code.
var ( TagSpec_NamedId_name = map[int32]string{ 0: "NOT_SET", 1: "LINK_FONT_STYLESHEET", 2: "STYLE_AMP_CUSTOM", } TagSpec_NamedId_value = map[string]int32{ "NOT_SET": 0, "LINK_FONT_STYLESHEET": 1, "STYLE_AMP_CUSTOM": 2, } )
Enum value maps for TagSpec_NamedId.
var ( ErrorCategory_Code_name = map[int32]string{ 0: "UNKNOWN", } ErrorCategory_Code_value = map[string]int32{ "UNKNOWN": 0, } )
Enum value maps for ErrorCategory_Code.
var ( ValidationError_Severity_name = map[int32]string{ 0: "UNKNOWN_SEVERITY", 1: "ERROR", 4: "WARNING", } ValidationError_Severity_value = map[string]int32{ "UNKNOWN_SEVERITY": 0, "ERROR": 1, "WARNING": 4, } )
Enum value maps for ValidationError_Severity.
var ( ValidationError_Code_name = map[int32]string{}/* 119 elements not displayed */ ValidationError_Code_value = map[string]int32{}/* 119 elements not displayed */ )
Enum value maps for ValidationError_Code.
var ( ValidationResult_Status_name = map[int32]string{ 0: "UNKNOWN", 1: "PASS", 2: "FAIL", } ValidationResult_Status_value = map[string]int32{ "UNKNOWN": 0, "PASS": 1, "FAIL": 2, } )
Enum value maps for ValidationResult_Status.
var File_validator_proto protoreflect.FileDescriptor
Functions ¶
This section is empty.
Types ¶
type AmpLayout ¶
type AmpLayout struct { // Specifies which layouts are supported by this element. SupportedLayouts []AmpLayout_Layout `` /* 139-byte string literal not displayed */ // Specifies whether this element has default dimensions. This corresponds // to being allowlisted in naturalDimensions_ in // https://github.com/ampproject/amphtml/blob/main/src/static-layout.js. DefinesDefaultWidth *bool `protobuf:"varint,2,opt,name=defines_default_width,json=definesDefaultWidth" json:"defines_default_width,omitempty"` DefinesDefaultHeight *bool `protobuf:"varint,3,opt,name=defines_default_height,json=definesDefaultHeight" json:"defines_default_height,omitempty"` // contains filtered or unexported fields }
Specifies which AMP Layouts are supported by a given element. For the purpose of the validator, this specifies which values for layout, height, and width attributes are allowed. Also see https://github.com/ampproject/amphtml/blob/main/docs/spec/amp-html-layout.md TODO(johannes): Make the error messages around layouts better. This may require revamping the documentation for elements and/or the above spec, so that a user gets more clearly informed about which layouts are applicable to a given tag, what happens when layout attribute or other attributes are not set, etc. NEXT AVAILABLE TAG: 4
func (*AmpLayout) Descriptor
deprecated
func (*AmpLayout) GetDefinesDefaultHeight ¶
func (*AmpLayout) GetDefinesDefaultWidth ¶
func (*AmpLayout) GetSupportedLayouts ¶
func (x *AmpLayout) GetSupportedLayouts() []AmpLayout_Layout
func (*AmpLayout) ProtoMessage ¶
func (*AmpLayout) ProtoMessage()
func (*AmpLayout) ProtoReflect ¶
func (x *AmpLayout) ProtoReflect() protoreflect.Message
type AmpLayout_Layout ¶
type AmpLayout_Layout int32
NEXT AVAILABLE TAG: 10
const ( AmpLayout_CONTAINER AmpLayout_Layout = 5 AmpLayout_FILL AmpLayout_Layout = 6 AmpLayout_FIXED AmpLayout_Layout = 2 AmpLayout_FIXED_HEIGHT AmpLayout_Layout = 3 AmpLayout_FLEX_ITEM AmpLayout_Layout = 7 AmpLayout_FLUID AmpLayout_Layout = 8 AmpLayout_INTRINSIC AmpLayout_Layout = 9 AmpLayout_NODISPLAY AmpLayout_Layout = 1 AmpLayout_RESPONSIVE AmpLayout_Layout = 4 AmpLayout_UNKNOWN AmpLayout_Layout = 0 )
func (AmpLayout_Layout) Descriptor ¶
func (AmpLayout_Layout) Descriptor() protoreflect.EnumDescriptor
func (AmpLayout_Layout) Enum ¶
func (x AmpLayout_Layout) Enum() *AmpLayout_Layout
func (AmpLayout_Layout) EnumDescriptor
deprecated
func (AmpLayout_Layout) EnumDescriptor() ([]byte, []int)
Deprecated: Use AmpLayout_Layout.Descriptor instead.
func (AmpLayout_Layout) Number ¶
func (x AmpLayout_Layout) Number() protoreflect.EnumNumber
func (AmpLayout_Layout) String ¶
func (x AmpLayout_Layout) String() string
func (AmpLayout_Layout) Type ¶
func (AmpLayout_Layout) Type() protoreflect.EnumType
func (*AmpLayout_Layout) UnmarshalJSON
deprecated
func (x *AmpLayout_Layout) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type AncestorMarker ¶
type AncestorMarker struct { Marker []AncestorMarker_Marker `protobuf:"varint,1,rep,name=marker,enum=amp.validator.AncestorMarker_Marker" json:"marker,omitempty"` // contains filtered or unexported fields }
An AncestorMarker is a state maintained on the stack of matching tags. When a TagSpec with an AncestorMarker matches, this Marker is placed on the stack until the matched html tag is popped from the stack. Other rules may be triggered by the presence of a specific AncestorMarker on the stack. NEXT AVAILABLE TAG: 2
func (*AncestorMarker) Descriptor
deprecated
func (*AncestorMarker) Descriptor() ([]byte, []int)
Deprecated: Use AncestorMarker.ProtoReflect.Descriptor instead.
func (*AncestorMarker) GetMarker ¶
func (x *AncestorMarker) GetMarker() []AncestorMarker_Marker
func (*AncestorMarker) ProtoMessage ¶
func (*AncestorMarker) ProtoMessage()
func (*AncestorMarker) ProtoReflect ¶
func (x *AncestorMarker) ProtoReflect() protoreflect.Message
func (*AncestorMarker) Reset ¶
func (x *AncestorMarker) Reset()
func (*AncestorMarker) String ¶
func (x *AncestorMarker) String() string
type AncestorMarker_Marker ¶
type AncestorMarker_Marker int32
NEXT AVAILABLE TAG: 2
const ( AncestorMarker_UNKNOWN AncestorMarker_Marker = 0 // Set by <amp-sidebar> tags to allow autoscroll attributes on descendants. // See https://github.com/ampproject/amphtml/pull/20524 for more context. AncestorMarker_AUTOSCROLL AncestorMarker_Marker = 1 )
func (AncestorMarker_Marker) Descriptor ¶
func (AncestorMarker_Marker) Descriptor() protoreflect.EnumDescriptor
func (AncestorMarker_Marker) Enum ¶
func (x AncestorMarker_Marker) Enum() *AncestorMarker_Marker
func (AncestorMarker_Marker) EnumDescriptor
deprecated
func (AncestorMarker_Marker) EnumDescriptor() ([]byte, []int)
Deprecated: Use AncestorMarker_Marker.Descriptor instead.
func (AncestorMarker_Marker) Number ¶
func (x AncestorMarker_Marker) Number() protoreflect.EnumNumber
func (AncestorMarker_Marker) String ¶
func (x AncestorMarker_Marker) String() string
func (AncestorMarker_Marker) Type ¶
func (AncestorMarker_Marker) Type() protoreflect.EnumType
func (*AncestorMarker_Marker) UnmarshalJSON
deprecated
func (x *AncestorMarker_Marker) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type AtRuleSpec ¶
type AtRuleSpec struct { // Name of the AT rule to parse. Do not include the '@' symbol (e.g. '@media' // should be encoded as 'media'. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // A MediaQuerySpec may only be set for an AtRuleSpec with the name // "media". If not set, media queries will be left unparsed, so no errors or // warnings about them will be reported. MediaQuerySpec *MediaQuerySpec `protobuf:"bytes,3,opt,name=media_query_spec,json=mediaQuerySpec" json:"media_query_spec,omitempty"` // contains filtered or unexported fields }
This spec is used by our CSS parser to determine what AT rules are allowed in the CSS spec. The term 'rule' here refers to the AT Rule in CSS, not a validation rule. NEXT AVAILABLE TAG: 4
func (*AtRuleSpec) Descriptor
deprecated
func (*AtRuleSpec) Descriptor() ([]byte, []int)
Deprecated: Use AtRuleSpec.ProtoReflect.Descriptor instead.
func (*AtRuleSpec) GetMediaQuerySpec ¶
func (x *AtRuleSpec) GetMediaQuerySpec() *MediaQuerySpec
func (*AtRuleSpec) GetName ¶
func (x *AtRuleSpec) GetName() string
func (*AtRuleSpec) ProtoMessage ¶
func (*AtRuleSpec) ProtoMessage()
func (*AtRuleSpec) ProtoReflect ¶
func (x *AtRuleSpec) ProtoReflect() protoreflect.Message
func (*AtRuleSpec) Reset ¶
func (x *AtRuleSpec) Reset()
func (*AtRuleSpec) String ¶
func (x *AtRuleSpec) String() string
type AttrList ¶
type AttrList struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Attrs []*AttrSpec `protobuf:"bytes,2,rep,name=attrs" json:"attrs,omitempty"` // contains filtered or unexported fields }
Some tags share several attributes, so they're identified by unique key (see the attr_lists map in ValidatorRules). NEXT AVAILABLE TAG: 3
func (*AttrList) Descriptor
deprecated
func (*AttrList) ProtoMessage ¶
func (*AttrList) ProtoMessage()
func (*AttrList) ProtoReflect ¶
func (x *AttrList) ProtoReflect() protoreflect.Message
type AttrSpec ¶
type AttrSpec struct { // If provided, the Type Identifier(s) that either enable or disable // this AttrSpec. If a Type Identifier is in enabled_by then this // AttrSpec will be used in validating parsed documents with that Type // Identifier. If a Type Identifier is in disabled_by then this // AttrSpec will not be used in validating parsed documents with that // Type Identifier. An AttrSpec can not have both enabled_by and disabled_by // set. EnabledBy []string `protobuf:"bytes,23,rep,name=enabled_by,json=enabledBy" json:"enabled_by,omitempty"` DisabledBy []string `protobuf:"bytes,24,rep,name=disabled_by,json=disabledBy" json:"disabled_by,omitempty"` // Use lower-case attribute names only. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` AlternativeNames []string `protobuf:"bytes,2,rep,name=alternative_names,json=alternativeNames" json:"alternative_names,omitempty"` Mandatory *bool `protobuf:"varint,3,opt,name=mandatory" json:"mandatory,omitempty"` // Within the context of the tag, *exactly one* of the attributes tagged // with this identifier must be present. Per convention, this identifier // should list the tags participating in the mandatory oneof: // e.g. mandatory_oneof: "['foo', 'bar']" MandatoryOneof *string `protobuf:"bytes,12,opt,name=mandatory_oneof,json=mandatoryOneof" json:"mandatory_oneof,omitempty"` // Within the context of the tag, *at least one* of the attributes tagged // with this identifier must be present. Per convention, this identifier // should list the tags participating in the mandatory oneof: // e.g. mandatory_oneof: "['foo', 'bar']" MandatoryAnyof *string `protobuf:"bytes,21,opt,name=mandatory_anyof,json=mandatoryAnyof" json:"mandatory_anyof,omitempty"` // The attribute value must be equal to the value in this field. Value []string `protobuf:"bytes,4,rep,name=value" json:"value,omitempty"` // case sensitive ValueCasei []string `protobuf:"bytes,18,rep,name=value_casei,json=valueCasei" json:"value_casei,omitempty"` // case insensitive ValueRegex *string `protobuf:"bytes,15,opt,name=value_regex,json=valueRegex" json:"value_regex,omitempty"` // case sensitive ValueRegexCasei *string `protobuf:"bytes,5,opt,name=value_regex_casei,json=valueRegexCasei" json:"value_regex_casei,omitempty"` // case insensitive ValueUrl *UrlSpec `protobuf:"bytes,14,opt,name=value_url,json=valueUrl" json:"value_url,omitempty"` // validates against a list of properties (see PropertySpec). ValueProperties *PropertySpecList `protobuf:"bytes,11,opt,name=value_properties,json=valueProperties" json:"value_properties,omitempty"` // If set, the attribute value will be evaluated using the matching document // level CSS rules. This flag is used for `style` attributes. If // `value_doc_css` is set, only non-SVG css is applied. If `value_doc_css_svg` // is set, SVG-specific CSS rules are also allowed for this attribute value. ValueDocCss *bool `protobuf:"varint,27,opt,name=value_doc_css,json=valueDocCss" json:"value_doc_css,omitempty"` ValueDocSvgCss *bool `protobuf:"varint,28,opt,name=value_doc_svg_css,json=valueDocSvgCss" json:"value_doc_svg_css,omitempty"` // } end oneof AddValueToSet *AttrSpec_ValueSet `` /* 136-byte string literal not displayed */ ValueOneofSet *AttrSpec_ValueSet `` /* 134-byte string literal not displayed */ Trigger *AttrTriggerSpec `protobuf:"bytes,16,opt,name=trigger" json:"trigger,omitempty"` // If set, then the attribute value may not match this regex, which is // always applied case-insensitively and as a partial match. DisallowedValueRegex *string `protobuf:"bytes,6,opt,name=disallowed_value_regex,json=disallowedValueRegex" json:"disallowed_value_regex,omitempty"` // If set, generates a DEPRECATED_ATTR error with severity WARNING. // The value of the deprecation field indicates what to use instead, // e.g. the name of an attribute or tag. Deprecation *string `protobuf:"bytes,7,opt,name=deprecation" json:"deprecation,omitempty"` // If provided, a URL which links to the AMP HTML spec for this deprecation. DeprecationUrl *string `protobuf:"bytes,8,opt,name=deprecation_url,json=deprecationUrl" json:"deprecation_url,omitempty"` // Valid CSS declarations. CssDeclaration []*CssDeclaration `protobuf:"bytes,20,rep,name=css_declaration,json=cssDeclaration" json:"css_declaration,omitempty"` // If set true, the TagSpec containing this AttrSpec will be evaluated first // for any encountered tag which matches the tag name and this attribute spec. // May only be set for an AttrSpec where mandatory=true and type matches those // specified in the comments of DispatchKeyType above. DispatchKey *AttrSpec_DispatchKeyType `` /* 139-byte string literal not displayed */ // If set to true, the TagSpec containing this AttrSpec implicitly has this // attribute and the attribute is considered valid. Implicit *bool `protobuf:"varint,17,opt,name=implicit,def=0" json:"implicit,omitempty"` // If set, this attr is considered part of an amp extended component, and // requires that the named extended component script tag is present on the // page. RequiresExtension []string `protobuf:"bytes,19,rep,name=requires_extension,json=requiresExtension" json:"requires_extension,omitempty"` // If set, this attr is invalid unless the current tag has an ancestor // tag which set one or more of the required markers. RequiresAncestor *AncestorMarker `protobuf:"bytes,22,opt,name=requires_ancestor,json=requiresAncestor" json:"requires_ancestor,omitempty"` // contains filtered or unexported fields }
Attributes that are not covered by at least one of these specs are disallowed. Within a given context (e.g., for a given TagSpec), names are unique. NEXT AVAILABLE TAG: 29
func (*AttrSpec) Descriptor
deprecated
func (*AttrSpec) GetAddValueToSet ¶
func (x *AttrSpec) GetAddValueToSet() AttrSpec_ValueSet
func (*AttrSpec) GetAlternativeNames ¶
func (*AttrSpec) GetCssDeclaration ¶
func (x *AttrSpec) GetCssDeclaration() []*CssDeclaration
func (*AttrSpec) GetDeprecation ¶
func (*AttrSpec) GetDeprecationUrl ¶
func (*AttrSpec) GetDisabledBy ¶
func (*AttrSpec) GetDisallowedValueRegex ¶
func (*AttrSpec) GetDispatchKey ¶
func (x *AttrSpec) GetDispatchKey() AttrSpec_DispatchKeyType
func (*AttrSpec) GetEnabledBy ¶
func (*AttrSpec) GetImplicit ¶
func (*AttrSpec) GetMandatory ¶
func (*AttrSpec) GetMandatoryAnyof ¶
func (*AttrSpec) GetMandatoryOneof ¶
func (*AttrSpec) GetRequiresAncestor ¶
func (x *AttrSpec) GetRequiresAncestor() *AncestorMarker
func (*AttrSpec) GetRequiresExtension ¶
func (*AttrSpec) GetTrigger ¶
func (x *AttrSpec) GetTrigger() *AttrTriggerSpec
func (*AttrSpec) GetValueCasei ¶
func (*AttrSpec) GetValueDocCss ¶
func (*AttrSpec) GetValueDocSvgCss ¶
func (*AttrSpec) GetValueOneofSet ¶
func (x *AttrSpec) GetValueOneofSet() AttrSpec_ValueSet
func (*AttrSpec) GetValueProperties ¶
func (x *AttrSpec) GetValueProperties() *PropertySpecList
func (*AttrSpec) GetValueRegex ¶
func (*AttrSpec) GetValueRegexCasei ¶
func (*AttrSpec) GetValueUrl ¶
func (*AttrSpec) ProtoMessage ¶
func (*AttrSpec) ProtoMessage()
func (*AttrSpec) ProtoReflect ¶
func (x *AttrSpec) ProtoReflect() protoreflect.Message
type AttrSpec_DispatchKeyType ¶
type AttrSpec_DispatchKeyType int32
const ( // Indicates that the attribute does not form a dispatch key. AttrSpec_NONE_DISPATCH AttrSpec_DispatchKeyType = 0 // Indicates that the name of the attribute alone forms a dispatch key. AttrSpec_NAME_DISPATCH AttrSpec_DispatchKeyType = 1 // Indicates that the name + value of the attribute forms a dispatch key. AttrSpec_NAME_VALUE_DISPATCH AttrSpec_DispatchKeyType = 2 // Indicates that the name + value + mandatory parent forms a dispatch key. AttrSpec_NAME_VALUE_PARENT_DISPATCH AttrSpec_DispatchKeyType = 3 )
func (AttrSpec_DispatchKeyType) Descriptor ¶
func (AttrSpec_DispatchKeyType) Descriptor() protoreflect.EnumDescriptor
func (AttrSpec_DispatchKeyType) Enum ¶
func (x AttrSpec_DispatchKeyType) Enum() *AttrSpec_DispatchKeyType
func (AttrSpec_DispatchKeyType) EnumDescriptor
deprecated
func (AttrSpec_DispatchKeyType) EnumDescriptor() ([]byte, []int)
Deprecated: Use AttrSpec_DispatchKeyType.Descriptor instead.
func (AttrSpec_DispatchKeyType) Number ¶
func (x AttrSpec_DispatchKeyType) Number() protoreflect.EnumNumber
func (AttrSpec_DispatchKeyType) String ¶
func (x AttrSpec_DispatchKeyType) String() string
func (AttrSpec_DispatchKeyType) Type ¶
func (AttrSpec_DispatchKeyType) Type() protoreflect.EnumType
func (*AttrSpec_DispatchKeyType) UnmarshalJSON
deprecated
func (x *AttrSpec_DispatchKeyType) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type AttrSpec_ValueSet ¶
type AttrSpec_ValueSet int32
These two fields specify that values from one AttrSpec refer to values from another AttrSpec elsewhere on the page; validator will verify the references are not "dangling". These references may appear before or after their referents.
For example, in the "id" AttrSpec in the "template" TagSpec, we have:
add_value_to_set: TEMPLATE_IDS
and in any "template" AttrSpec, we have:
value_oneof_set: TEMPLATE_IDS
NEXT AVAILABLE TAG: 3
const ( AttrSpec_UNKNOWN_VALUESET AttrSpec_ValueSet = 0 // Never used AttrSpec_TEMPLATE_IDS AttrSpec_ValueSet = 1 // <template id> values AttrSpec_AMP_SCRIPT_IDS AttrSpec_ValueSet = 2 // <script id> values, referenced by <amp-script> )
func (AttrSpec_ValueSet) Descriptor ¶
func (AttrSpec_ValueSet) Descriptor() protoreflect.EnumDescriptor
func (AttrSpec_ValueSet) Enum ¶
func (x AttrSpec_ValueSet) Enum() *AttrSpec_ValueSet
func (AttrSpec_ValueSet) EnumDescriptor
deprecated
func (AttrSpec_ValueSet) EnumDescriptor() ([]byte, []int)
Deprecated: Use AttrSpec_ValueSet.Descriptor instead.
func (AttrSpec_ValueSet) Number ¶
func (x AttrSpec_ValueSet) Number() protoreflect.EnumNumber
func (AttrSpec_ValueSet) String ¶
func (x AttrSpec_ValueSet) String() string
func (AttrSpec_ValueSet) Type ¶
func (AttrSpec_ValueSet) Type() protoreflect.EnumType
func (*AttrSpec_ValueSet) UnmarshalJSON
deprecated
func (x *AttrSpec_ValueSet) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type AttrTriggerSpec ¶
type AttrTriggerSpec struct { // If set, attribute's value must match to also require attribute(s). // If not set, attribute automatically also require attribute(s). IfValueRegex *string `protobuf:"bytes,1,opt,name=if_value_regex,json=ifValueRegex" json:"if_value_regex,omitempty"` // case sensitive // If set, other attributes - identified by their name string - must // be present as well. AlsoRequiresAttr []string `protobuf:"bytes,2,rep,name=also_requires_attr,json=alsoRequiresAttr" json:"also_requires_attr,omitempty"` // contains filtered or unexported fields }
Used for validating attributes that require another attribute for some given set of conditions. E.g. attr name: "on" if_value_regex: "tap:.*" also_require_attr: "role" NEXT AVAILABLE TAG: 3
func (*AttrTriggerSpec) Descriptor
deprecated
func (*AttrTriggerSpec) Descriptor() ([]byte, []int)
Deprecated: Use AttrTriggerSpec.ProtoReflect.Descriptor instead.
func (*AttrTriggerSpec) GetAlsoRequiresAttr ¶
func (x *AttrTriggerSpec) GetAlsoRequiresAttr() []string
func (*AttrTriggerSpec) GetIfValueRegex ¶
func (x *AttrTriggerSpec) GetIfValueRegex() string
func (*AttrTriggerSpec) ProtoMessage ¶
func (*AttrTriggerSpec) ProtoMessage()
func (*AttrTriggerSpec) ProtoReflect ¶
func (x *AttrTriggerSpec) ProtoReflect() protoreflect.Message
func (*AttrTriggerSpec) Reset ¶
func (x *AttrTriggerSpec) Reset()
func (*AttrTriggerSpec) String ¶
func (x *AttrTriggerSpec) String() string
type CdataSpec ¶
type CdataSpec struct { // If set, the cdata contents cannot be greater than this length, in bytes. A // value of -2 (default) indicates that there is no limit (unlimited). A value // of -1 will always cause validation failure on match. -1 is used to // implement the `amp-custom-length-check` attribute: // (https://github.com/ampproject/amphtml/issues/22315#issuecomment-496681165) MaxBytes *int32 `protobuf:"varint,1,opt,name=max_bytes,json=maxBytes,def=-2" json:"max_bytes,omitempty"` // If provided, a URL which linking to a section / sentence in the // AMP HTML spec. MaxBytesSpecUrl *string `protobuf:"bytes,2,opt,name=max_bytes_spec_url,json=maxBytesSpecUrl" json:"max_bytes_spec_url,omitempty"` // If non-empty, the text between the start / end tag must match this value. MandatoryCdata *string `protobuf:"bytes,3,opt,name=mandatory_cdata,json=mandatoryCdata" json:"mandatory_cdata,omitempty"` // If non-empty, the text between the start / end tag must match this regex. CdataRegex *string `protobuf:"bytes,6,opt,name=cdata_regex,json=cdataRegex" json:"cdata_regex,omitempty"` // If at least one CssSpec is provided, this cdata field will be parsed // as CSS3, and any parsing errors will become validation errors. CssSpec *CssSpec `protobuf:"bytes,7,opt,name=css_spec,json=cssSpec" json:"css_spec,omitempty"` // If set to true, then only whitespace may be in the cdata contents. // This is useful for script tags that reference extensions etc. WhitespaceOnly *bool `protobuf:"varint,8,opt,name=whitespace_only,json=whitespaceOnly" json:"whitespace_only,omitempty"` // } end oneof // If any of these regexes match, then this cdata spec does not validate. DisallowedCdataRegex []*DisallowedCDataRegex `protobuf:"bytes,4,rep,name=disallowed_cdata_regex,json=disallowedCdataRegex" json:"disallowed_cdata_regex,omitempty"` // If true, the contents of this tag's CDATA text will be counted against the // document level DocCssSpec CSS lengths. DocCssBytes *bool `protobuf:"varint,11,opt,name=doc_css_bytes,json=docCssBytes" json:"doc_css_bytes,omitempty"` // contains filtered or unexported fields }
NEXT AVAILABLE TAG: 12
func (*CdataSpec) Descriptor
deprecated
func (*CdataSpec) GetCdataRegex ¶
func (*CdataSpec) GetCssSpec ¶
func (*CdataSpec) GetDisallowedCdataRegex ¶
func (x *CdataSpec) GetDisallowedCdataRegex() []*DisallowedCDataRegex
func (*CdataSpec) GetDocCssBytes ¶
func (*CdataSpec) GetMandatoryCdata ¶
func (*CdataSpec) GetMaxBytes ¶
func (*CdataSpec) GetMaxBytesSpecUrl ¶
func (*CdataSpec) GetWhitespaceOnly ¶
func (*CdataSpec) ProtoMessage ¶
func (*CdataSpec) ProtoMessage()
func (*CdataSpec) ProtoReflect ¶
func (x *CdataSpec) ProtoReflect() protoreflect.Message
type ChildTagSpec ¶
type ChildTagSpec struct { // Unless set to -1 (the default), the parent tag must have exactly // |mandatory_num_child_tags| immediate child tags. MandatoryNumChildTags *int32 `` /* 129-byte string literal not displayed */ // If at least one tag name is specified, then the first child of the // parent tag must have one of the provided names. FirstChildTagNameOneof []string `` /* 126-byte string literal not displayed */ // If at least one tag name is specified, then the child tags of // the parent tag must have one of the provided tag names. ChildTagNameOneof []string `protobuf:"bytes,3,rep,name=child_tag_name_oneof,json=childTagNameOneof" json:"child_tag_name_oneof,omitempty"` // Unless set to -1 (the default), the parent tag must have a minimum of // |mandatory_min_num_child_tags| immediate child tags. MandatoryMinNumChildTags *int32 `` /* 140-byte string literal not displayed */ // contains filtered or unexported fields }
TagSpec::child_tags uses this configuration to specify which child tags are expected for a specific tag.
Matching child tags is done by tag name, while the parent is matched by TagSpec. The reason for this is that matching by tag spec name would produce less useful error messages, because we want to be able to produce a good message even if the tag spec name could not be determined because the enclosed child tag is invalid (no TagSpec matches). By doing a tag name match, we can produce a reasonable error regardless if a child tag was misplaced. NEXT AVAILABLE TAG: 5
func (*ChildTagSpec) Descriptor
deprecated
func (*ChildTagSpec) Descriptor() ([]byte, []int)
Deprecated: Use ChildTagSpec.ProtoReflect.Descriptor instead.
func (*ChildTagSpec) GetChildTagNameOneof ¶
func (x *ChildTagSpec) GetChildTagNameOneof() []string
func (*ChildTagSpec) GetFirstChildTagNameOneof ¶
func (x *ChildTagSpec) GetFirstChildTagNameOneof() []string
func (*ChildTagSpec) GetMandatoryMinNumChildTags ¶
func (x *ChildTagSpec) GetMandatoryMinNumChildTags() int32
func (*ChildTagSpec) GetMandatoryNumChildTags ¶
func (x *ChildTagSpec) GetMandatoryNumChildTags() int32
func (*ChildTagSpec) ProtoMessage ¶
func (*ChildTagSpec) ProtoMessage()
func (*ChildTagSpec) ProtoReflect ¶
func (x *ChildTagSpec) ProtoReflect() protoreflect.Message
func (*ChildTagSpec) Reset ¶
func (x *ChildTagSpec) Reset()
func (*ChildTagSpec) String ¶
func (x *ChildTagSpec) String() string
type CssDeclaration ¶
type CssDeclaration struct { // The name of the declaration (e.g. display). Use lower-case attribute names // only. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // This would be a oneof, but this file only uses features in protobuf 2.5.0. // begin oneof { // The valid values of the declaration (e.g. block). ValueCasei []string `protobuf:"bytes,2,rep,name=value_casei,json=valueCasei" json:"value_casei,omitempty"` ValueRegexCasei *string `protobuf:"bytes,3,opt,name=value_regex_casei,json=valueRegexCasei" json:"value_regex_casei,omitempty"` // } end oneof // contains filtered or unexported fields }
NEXT AVAILABLE TAG: 4
func (*CssDeclaration) Descriptor
deprecated
func (*CssDeclaration) Descriptor() ([]byte, []int)
Deprecated: Use CssDeclaration.ProtoReflect.Descriptor instead.
func (*CssDeclaration) GetName ¶
func (x *CssDeclaration) GetName() string
func (*CssDeclaration) GetValueCasei ¶
func (x *CssDeclaration) GetValueCasei() []string
func (*CssDeclaration) GetValueRegexCasei ¶
func (x *CssDeclaration) GetValueRegexCasei() string
func (*CssDeclaration) ProtoMessage ¶
func (*CssDeclaration) ProtoMessage()
func (*CssDeclaration) ProtoReflect ¶
func (x *CssDeclaration) ProtoReflect() protoreflect.Message
func (*CssDeclaration) Reset ¶
func (x *CssDeclaration) Reset()
func (*CssDeclaration) String ¶
func (x *CssDeclaration) String() string
type CssSpec ¶
type CssSpec struct { // Spec for how to parse CSS AT rules, one per AT rule. Must not contain // duplicate names, and must contain at least one entry for the default. AtRuleSpec []*AtRuleSpec `protobuf:"bytes,1,rep,name=at_rule_spec,json=atRuleSpec" json:"at_rule_spec,omitempty"` // Enables checks specific to the draft A4A specification. // TODO(powdercloud): Make this more generic. ValidateAmp4Ads *bool `protobuf:"varint,5,opt,name=validate_amp4ads,json=validateAmp4ads" json:"validate_amp4ads,omitempty"` // Enables checks specific to the style[keyframes] specification. // TODO(chenshay): Make this more generic. ValidateKeyframes *bool `protobuf:"varint,6,opt,name=validate_keyframes,json=validateKeyframes" json:"validate_keyframes,omitempty"` // Any declaration listed here are allowed. Declaration []string `protobuf:"bytes,7,rep,name=declaration" json:"declaration,omitempty"` // If false, declarations tagged with `!important` are considered errors. // Most AMP stylesheets disallow `!important` to reserve this override // for AMP's own styles. AllowImportant *bool `protobuf:"varint,8,opt,name=allow_important,json=allowImportant,def=0" json:"allow_important,omitempty"` SelectorSpec *SelectorSpec `protobuf:"bytes,9,opt,name=selector_spec,json=selectorSpec" json:"selector_spec,omitempty"` // contains filtered or unexported fields }
NEXT AVAILABLE TAG: 10
func (*CssSpec) Descriptor
deprecated
func (*CssSpec) GetAllowImportant ¶
func (*CssSpec) GetAtRuleSpec ¶
func (x *CssSpec) GetAtRuleSpec() []*AtRuleSpec
func (*CssSpec) GetDeclaration ¶
func (*CssSpec) GetSelectorSpec ¶
func (x *CssSpec) GetSelectorSpec() *SelectorSpec
func (*CssSpec) GetValidateAmp4Ads ¶
func (*CssSpec) GetValidateKeyframes ¶
func (*CssSpec) ProtoMessage ¶
func (*CssSpec) ProtoMessage()
func (*CssSpec) ProtoReflect ¶
func (x *CssSpec) ProtoReflect() protoreflect.Message
type DeclarationList ¶
type DeclarationList struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Declaration []*CssDeclaration `protobuf:"bytes,2,rep,name=declaration" json:"declaration,omitempty"` // contains filtered or unexported fields }
Some style blocks share long lists of declarations, so they're identified by unique key. NEXT AVAILABLE TAG: 3
func (*DeclarationList) Descriptor
deprecated
func (*DeclarationList) Descriptor() ([]byte, []int)
Deprecated: Use DeclarationList.ProtoReflect.Descriptor instead.
func (*DeclarationList) GetDeclaration ¶
func (x *DeclarationList) GetDeclaration() []*CssDeclaration
func (*DeclarationList) GetName ¶
func (x *DeclarationList) GetName() string
func (*DeclarationList) ProtoMessage ¶
func (*DeclarationList) ProtoMessage()
func (*DeclarationList) ProtoReflect ¶
func (x *DeclarationList) ProtoReflect() protoreflect.Message
func (*DeclarationList) Reset ¶
func (x *DeclarationList) Reset()
func (*DeclarationList) String ¶
func (x *DeclarationList) String() string
type DescendantTagList ¶
type DescendantTagList struct { Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Tag []string `protobuf:"bytes,2,rep,name=tag" json:"tag,omitempty"` // contains filtered or unexported fields }
A list of allowed tags for descendants of any level (children, grandchildren, great-grandchildren, etc). NEXT AVAILABLE TAG: 3
func (*DescendantTagList) Descriptor
deprecated
func (*DescendantTagList) Descriptor() ([]byte, []int)
Deprecated: Use DescendantTagList.ProtoReflect.Descriptor instead.
func (*DescendantTagList) GetName ¶
func (x *DescendantTagList) GetName() string
func (*DescendantTagList) GetTag ¶
func (x *DescendantTagList) GetTag() []string
func (*DescendantTagList) ProtoMessage ¶
func (*DescendantTagList) ProtoMessage()
func (*DescendantTagList) ProtoReflect ¶
func (x *DescendantTagList) ProtoReflect() protoreflect.Message
func (*DescendantTagList) Reset ¶
func (x *DescendantTagList) Reset()
func (*DescendantTagList) String ¶
func (x *DescendantTagList) String() string
type DisallowedCDataRegex ¶
type DisallowedCDataRegex struct { // Syntax is partial match, use ^ and $ if you want global match. Regex *string `protobuf:"bytes,1,opt,name=regex" json:"regex,omitempty"` ErrorMessage *string `protobuf:"bytes,2,opt,name=error_message,json=errorMessage" json:"error_message,omitempty"` // contains filtered or unexported fields }
Regex which, if matches the cdata of a tag, causes the tag validation to fail. NEXT AVAILABLE TAG: 3
func (*DisallowedCDataRegex) Descriptor
deprecated
func (*DisallowedCDataRegex) Descriptor() ([]byte, []int)
Deprecated: Use DisallowedCDataRegex.ProtoReflect.Descriptor instead.
func (*DisallowedCDataRegex) GetErrorMessage ¶
func (x *DisallowedCDataRegex) GetErrorMessage() string
func (*DisallowedCDataRegex) GetRegex ¶
func (x *DisallowedCDataRegex) GetRegex() string
func (*DisallowedCDataRegex) ProtoMessage ¶
func (*DisallowedCDataRegex) ProtoMessage()
func (*DisallowedCDataRegex) ProtoReflect ¶
func (x *DisallowedCDataRegex) ProtoReflect() protoreflect.Message
func (*DisallowedCDataRegex) Reset ¶
func (x *DisallowedCDataRegex) Reset()
func (*DisallowedCDataRegex) String ¶
func (x *DisallowedCDataRegex) String() string
type DocCssSpec ¶
type DocCssSpec struct { // The html_format field tells the validator for which html formats // (ie: (<html ⚡> vs <html a4⚡>) this DocCssSpec is defined for. HtmlFormat []HtmlFormat_Code `protobuf:"varint,1,rep,name=html_format,json=htmlFormat,enum=amp.validator.HtmlFormat_Code" json:"html_format,omitempty"` // If a Type Identifier is in enabled_by then this DocCssSpec will be used // in validating parsed documents with that Type Identifier. If a Type // Identifier is in disabled_by then this DocCssSpec will not be used in // validating parsed documents;: with that Type Identifier. An DocCssSpec can // not have both enabled_by and disabled_by set. EnabledBy []string `protobuf:"bytes,2,rep,name=enabled_by,json=enabledBy" json:"enabled_by,omitempty"` DisabledBy []string `protobuf:"bytes,3,rep,name=disabled_by,json=disabledBy" json:"disabled_by,omitempty"` // If provided, a URL linking to a section / sentence in the AMP HTML spec. SpecUrl *string `protobuf:"bytes,4,opt,name=spec_url,json=specUrl" json:"spec_url,omitempty"` // Due to a bug, we allowed unlimited doc-level and per-inline-style bytes // for CSS in non-AMP formats. To avoid breaking pages, some formats will // only emit a warning for exceeding `max_bytes` and // `max_bytes_per_inline_style`. MaxBytesIsWarning *bool `protobuf:"varint,18,opt,name=max_bytes_is_warning,json=maxBytesIsWarning,def=0" json:"max_bytes_is_warning,omitempty"` // If set, the combined style amp-custom cdata contents and all inline style // contents cannot be greater than this length, in bytes. A value of -2 // (default) indicates that there is no limit (unlimited). A value of -1 will // always cause validation failure. MaxBytes *int32 `protobuf:"varint,5,opt,name=max_bytes,json=maxBytes,def=-2" json:"max_bytes,omitempty"` // If set, the inline style content (per use) cannot be greater than this // length, in bytes. MaxBytesPerInlineStyle *int32 `` /* 134-byte string literal not displayed */ // If false, bytes inside URLs are not included in the byte calculation for // `max_bytes`. This is used for handling signed exchange transformations // which can potentially take the number of bytes over the 75,000 byte limit // due to rewriting URLs to point at an AMP Cache. UrlBytesIncluded *bool `protobuf:"varint,7,opt,name=url_bytes_included,json=urlBytesIncluded,def=1" json:"url_bytes_included,omitempty"` // If provided, a URL linking to a section / sentence in the AMP HTML spec. MaxBytesSpecUrl *string `protobuf:"bytes,8,opt,name=max_bytes_spec_url,json=maxBytesSpecUrl" json:"max_bytes_spec_url,omitempty"` // If true, all declarations are allowed in style tags and inline style // attributes, regardless of the contents of the `declaration` list. AllowAllDeclarationInStyle *bool `` /* 146-byte string literal not displayed */ // If true, all variants of declarations that are vendor prefixes are allowed. // for example, if `gradient` is an allowed declaration and this is true, then // `-webkit-gradient` is also an allowed declaration. ExpandVendorPrefixes *bool `protobuf:"varint,19,opt,name=expand_vendor_prefixes,json=expandVendorPrefixes" json:"expand_vendor_prefixes,omitempty"` // Any declaration listed here is allowed in custom style tags and style // attributes in any tag. Declaration []*CssDeclaration `protobuf:"bytes,11,rep,name=declaration" json:"declaration,omitempty"` // In addition to those listed in 'declaration', any declaration listed here // is allowed in style attributes for SVG elements. DeclarationSvg []*CssDeclaration `protobuf:"bytes,12,rep,name=declaration_svg,json=declarationSvg" json:"declaration_svg,omitempty"` // Top level lists of shared declarations, identified by unique key. DeclarationList []string `protobuf:"bytes,13,rep,name=declaration_list,json=declarationList" json:"declaration_list,omitempty"` // Top level lists of shared declarations, identified by unique key. DeclarationListSvg []string `protobuf:"bytes,14,rep,name=declaration_list_svg,json=declarationListSvg" json:"declaration_list_svg,omitempty"` // URLs found within CSS are checked against this spec. ImageUrlSpec *UrlSpec `protobuf:"bytes,15,opt,name=image_url_spec,json=imageUrlSpec" json:"image_url_spec,omitempty"` FontUrlSpec *UrlSpec `protobuf:"bytes,16,opt,name=font_url_spec,json=fontUrlSpec" json:"font_url_spec,omitempty"` // If false, declarations tagged with `!important` are considered errors. // Most AMP stylesheets disallow `!important` to reserve this override // for AMP's own styles. AllowImportant *bool `protobuf:"varint,17,opt,name=allow_important,json=allowImportant,def=0" json:"allow_important,omitempty"` // contains filtered or unexported fields }
Exactly one DocCssSpec will match each AMP document. This spec defines the default css rules for style attributes and publisher style tags across the entire document. Rules for specific tags may be overridden by those tags. NEXT AVAILABLE TAG: 20
func (*DocCssSpec) Descriptor
deprecated
func (*DocCssSpec) Descriptor() ([]byte, []int)
Deprecated: Use DocCssSpec.ProtoReflect.Descriptor instead.
func (*DocCssSpec) GetAllowAllDeclarationInStyle ¶
func (x *DocCssSpec) GetAllowAllDeclarationInStyle() bool
func (*DocCssSpec) GetAllowImportant ¶
func (x *DocCssSpec) GetAllowImportant() bool
func (*DocCssSpec) GetDeclaration ¶
func (x *DocCssSpec) GetDeclaration() []*CssDeclaration
func (*DocCssSpec) GetDeclarationList ¶
func (x *DocCssSpec) GetDeclarationList() []string
func (*DocCssSpec) GetDeclarationListSvg ¶
func (x *DocCssSpec) GetDeclarationListSvg() []string
func (*DocCssSpec) GetDeclarationSvg ¶
func (x *DocCssSpec) GetDeclarationSvg() []*CssDeclaration
func (*DocCssSpec) GetDisabledBy ¶
func (x *DocCssSpec) GetDisabledBy() []string
func (*DocCssSpec) GetEnabledBy ¶
func (x *DocCssSpec) GetEnabledBy() []string
func (*DocCssSpec) GetExpandVendorPrefixes ¶
func (x *DocCssSpec) GetExpandVendorPrefixes() bool
func (*DocCssSpec) GetFontUrlSpec ¶
func (x *DocCssSpec) GetFontUrlSpec() *UrlSpec
func (*DocCssSpec) GetHtmlFormat ¶
func (x *DocCssSpec) GetHtmlFormat() []HtmlFormat_Code
func (*DocCssSpec) GetImageUrlSpec ¶
func (x *DocCssSpec) GetImageUrlSpec() *UrlSpec
func (*DocCssSpec) GetMaxBytes ¶
func (x *DocCssSpec) GetMaxBytes() int32
func (*DocCssSpec) GetMaxBytesIsWarning ¶
func (x *DocCssSpec) GetMaxBytesIsWarning() bool
func (*DocCssSpec) GetMaxBytesPerInlineStyle ¶
func (x *DocCssSpec) GetMaxBytesPerInlineStyle() int32
func (*DocCssSpec) GetMaxBytesSpecUrl ¶
func (x *DocCssSpec) GetMaxBytesSpecUrl() string
func (*DocCssSpec) GetSpecUrl ¶
func (x *DocCssSpec) GetSpecUrl() string
func (*DocCssSpec) GetUrlBytesIncluded ¶
func (x *DocCssSpec) GetUrlBytesIncluded() bool
func (*DocCssSpec) ProtoMessage ¶
func (*DocCssSpec) ProtoMessage()
func (*DocCssSpec) ProtoReflect ¶
func (x *DocCssSpec) ProtoReflect() protoreflect.Message
func (*DocCssSpec) Reset ¶
func (x *DocCssSpec) Reset()
func (*DocCssSpec) String ¶
func (x *DocCssSpec) String() string
type DocSpec ¶
type DocSpec struct { // The html_format field tells the validator for which html formats // (ie: (<html ⚡> vs <html a4⚡>) this DocSpec is defined for. HtmlFormat []HtmlFormat_Code `protobuf:"varint,1,rep,name=html_format,json=htmlFormat,enum=amp.validator.HtmlFormat_Code" json:"html_format,omitempty"` // If a Type Identifier is in enabled_by then this DocSpec will be used // in validating parsed documents with that Type Identifier. If a Type // Identifier is in disabled_by then this DocSpec will not be used in // validating parsed documents with that Type Identifier. An DocSpec can // not have both enabled_by and disabled_by set. EnabledBy []string `protobuf:"bytes,2,rep,name=enabled_by,json=enabledBy" json:"enabled_by,omitempty"` DisabledBy []string `protobuf:"bytes,3,rep,name=disabled_by,json=disabledBy" json:"disabled_by,omitempty"` // If set, the entire document's content cannot be greater than this length, // in bytes. A value of -2 (default) indicates that there is no limit // (unlimited). MaxBytes *int32 `protobuf:"varint,4,opt,name=max_bytes,json=maxBytes,def=-2" json:"max_bytes,omitempty"` // If provided, a URL linking to a section / sentence in the AMP HTML spec. MaxBytesSpecUrl *string `protobuf:"bytes,5,opt,name=max_bytes_spec_url,json=maxBytesSpecUrl" json:"max_bytes_spec_url,omitempty"` // contains filtered or unexported fields }
Exactly one DocSpec will match each AMP document. This spec defines some default rules for the entire document scoped by it's HtmlFormat and any Type Identifiers. NEXT AVAILABLE TAG: 6
func (*DocSpec) Descriptor
deprecated
func (*DocSpec) GetDisabledBy ¶
func (*DocSpec) GetEnabledBy ¶
func (*DocSpec) GetHtmlFormat ¶
func (x *DocSpec) GetHtmlFormat() []HtmlFormat_Code
func (*DocSpec) GetMaxBytes ¶
func (*DocSpec) GetMaxBytesSpecUrl ¶
func (*DocSpec) ProtoMessage ¶
func (*DocSpec) ProtoMessage()
func (*DocSpec) ProtoReflect ¶
func (x *DocSpec) ProtoReflect() protoreflect.Message
type ErrorCategory ¶
type ErrorCategory struct {
// contains filtered or unexported fields
}
This feature was removed in October 2019, however there are still some callers that expect an ErrorCategory to be set. Do not rely on this in new code. TODO(#25188): Remove ErrorCategory completely.
func (*ErrorCategory) Descriptor
deprecated
func (*ErrorCategory) Descriptor() ([]byte, []int)
Deprecated: Use ErrorCategory.ProtoReflect.Descriptor instead.
func (*ErrorCategory) ProtoMessage ¶
func (*ErrorCategory) ProtoMessage()
func (*ErrorCategory) ProtoReflect ¶
func (x *ErrorCategory) ProtoReflect() protoreflect.Message
func (*ErrorCategory) Reset ¶
func (x *ErrorCategory) Reset()
func (*ErrorCategory) String ¶
func (x *ErrorCategory) String() string
type ErrorCategory_Code ¶
type ErrorCategory_Code int32
const (
ErrorCategory_UNKNOWN ErrorCategory_Code = 0
)
func (ErrorCategory_Code) Descriptor ¶
func (ErrorCategory_Code) Descriptor() protoreflect.EnumDescriptor
func (ErrorCategory_Code) Enum ¶
func (x ErrorCategory_Code) Enum() *ErrorCategory_Code
func (ErrorCategory_Code) EnumDescriptor
deprecated
func (ErrorCategory_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use ErrorCategory_Code.Descriptor instead.
func (ErrorCategory_Code) Number ¶
func (x ErrorCategory_Code) Number() protoreflect.EnumNumber
func (ErrorCategory_Code) String ¶
func (x ErrorCategory_Code) String() string
func (ErrorCategory_Code) Type ¶
func (ErrorCategory_Code) Type() protoreflect.EnumType
func (*ErrorCategory_Code) UnmarshalJSON
deprecated
func (x *ErrorCategory_Code) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ErrorFormat ¶
type ErrorFormat struct { Code *ValidationError_Code `protobuf:"varint,1,opt,name=code,enum=amp.validator.ValidationError_Code" json:"code,omitempty"` Format *string `protobuf:"bytes,2,opt,name=format" json:"format,omitempty"` // contains filtered or unexported fields }
NEXT AVAILABLE TAG: 3
func (*ErrorFormat) Descriptor
deprecated
func (*ErrorFormat) Descriptor() ([]byte, []int)
Deprecated: Use ErrorFormat.ProtoReflect.Descriptor instead.
func (*ErrorFormat) GetCode ¶
func (x *ErrorFormat) GetCode() ValidationError_Code
func (*ErrorFormat) GetFormat ¶
func (x *ErrorFormat) GetFormat() string
func (*ErrorFormat) ProtoMessage ¶
func (*ErrorFormat) ProtoMessage()
func (*ErrorFormat) ProtoReflect ¶
func (x *ErrorFormat) ProtoReflect() protoreflect.Message
func (*ErrorFormat) Reset ¶
func (x *ErrorFormat) Reset()
func (*ErrorFormat) String ¶
func (x *ErrorFormat) String() string
type ErrorSpecificity ¶
type ErrorSpecificity struct { Code *ValidationError_Code `protobuf:"varint,1,opt,name=code,enum=amp.validator.ValidationError_Code" json:"code,omitempty"` Specificity *int32 `protobuf:"varint,2,opt,name=specificity" json:"specificity,omitempty"` // contains filtered or unexported fields }
Used in the verbose validator to select between multiple generated error types for a failing error. A higher number means that the error is more specific, ie: more helpful, preferred. NEXT AVAILABLE TAG: 3
func (*ErrorSpecificity) Descriptor
deprecated
func (*ErrorSpecificity) Descriptor() ([]byte, []int)
Deprecated: Use ErrorSpecificity.ProtoReflect.Descriptor instead.
func (*ErrorSpecificity) GetCode ¶
func (x *ErrorSpecificity) GetCode() ValidationError_Code
func (*ErrorSpecificity) GetSpecificity ¶
func (x *ErrorSpecificity) GetSpecificity() int32
func (*ErrorSpecificity) ProtoMessage ¶
func (*ErrorSpecificity) ProtoMessage()
func (*ErrorSpecificity) ProtoReflect ¶
func (x *ErrorSpecificity) ProtoReflect() protoreflect.Message
func (*ErrorSpecificity) Reset ¶
func (x *ErrorSpecificity) Reset()
func (*ErrorSpecificity) String ¶
func (x *ErrorSpecificity) String() string
type ExtensionSpec ¶
type ExtensionSpec struct { // e.g. "amp-video". This is used both as the attribute value for the // 'custom-element' attribute value as well as part of the 'src' attribute // value. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` // e.g. "0.1", "1.0", "latest". Version []string `protobuf:"bytes,2,rep,name=version" json:"version,omitempty"` // If multiple TagSpecs for the same extension exist, separated by version, // specify a version_name string to disambiguate their spec_names. For // example, "v1.0" or "v0.1-0.2". This string will become part of the name // used for referring to this extension in validator error messages. VersionName *string `protobuf:"bytes,9,opt,name=version_name,json=versionName" json:"version_name,omitempty"` // deprecated_version must be a strict subset of version. If the version // matches a deprecated_version, validation will emit a warning. DeprecatedVersion []string `protobuf:"bytes,3,rep,name=deprecated_version,json=deprecatedVersion" json:"deprecated_version,omitempty"` // Bento supported versions (e.g. "1.0"). BentoSupportedVersion []string `protobuf:"bytes,10,rep,name=bento_supported_version,json=bentoSupportedVersion" json:"bento_supported_version,omitempty"` ExtensionType *ExtensionSpec_ExtensionType `` /* 147-byte string literal not displayed */ // For older tags, we did not originally require that the tag only be included // once, so those tags are exempted from the multiple inclusion ban. DeprecatedAllowDuplicates *bool `` /* 138-byte string literal not displayed */ RequiresUsage *ExtensionSpec_ExtensionUsageRequirement `` /* 159-byte string literal not displayed */ // contains filtered or unexported fields }
Specs specific to AMP Extensions. This is a field within TagSpec that replaces the standard tagspec list of attributes, requirements, etc. NEXT AVAILABLE TAG: 11
func (*ExtensionSpec) Descriptor
deprecated
func (*ExtensionSpec) Descriptor() ([]byte, []int)
Deprecated: Use ExtensionSpec.ProtoReflect.Descriptor instead.
func (*ExtensionSpec) GetBentoSupportedVersion ¶
func (x *ExtensionSpec) GetBentoSupportedVersion() []string
func (*ExtensionSpec) GetDeprecatedAllowDuplicates ¶
func (x *ExtensionSpec) GetDeprecatedAllowDuplicates() bool
func (*ExtensionSpec) GetDeprecatedVersion ¶
func (x *ExtensionSpec) GetDeprecatedVersion() []string
func (*ExtensionSpec) GetExtensionType ¶
func (x *ExtensionSpec) GetExtensionType() ExtensionSpec_ExtensionType
func (*ExtensionSpec) GetName ¶
func (x *ExtensionSpec) GetName() string
func (*ExtensionSpec) GetRequiresUsage ¶
func (x *ExtensionSpec) GetRequiresUsage() ExtensionSpec_ExtensionUsageRequirement
func (*ExtensionSpec) GetVersion ¶
func (x *ExtensionSpec) GetVersion() []string
func (*ExtensionSpec) GetVersionName ¶
func (x *ExtensionSpec) GetVersionName() string
func (*ExtensionSpec) ProtoMessage ¶
func (*ExtensionSpec) ProtoMessage()
func (*ExtensionSpec) ProtoReflect ¶
func (x *ExtensionSpec) ProtoReflect() protoreflect.Message
func (*ExtensionSpec) Reset ¶
func (x *ExtensionSpec) Reset()
func (*ExtensionSpec) String ¶
func (x *ExtensionSpec) String() string
type ExtensionSpec_ExtensionType ¶
type ExtensionSpec_ExtensionType int32
Most extensions are custom-elements. For custom-template extensions, this value needs to be set true. E.g: amp-mustache. NEXT AVAILABLE TAG: 4
const ( ExtensionSpec_UNKNOWN ExtensionSpec_ExtensionType = 0 ExtensionSpec_CUSTOM_ELEMENT ExtensionSpec_ExtensionType = 1 ExtensionSpec_CUSTOM_TEMPLATE ExtensionSpec_ExtensionType = 2 ExtensionSpec_HOST_SERVICE ExtensionSpec_ExtensionType = 3 )
func (ExtensionSpec_ExtensionType) Descriptor ¶
func (ExtensionSpec_ExtensionType) Descriptor() protoreflect.EnumDescriptor
func (ExtensionSpec_ExtensionType) Enum ¶
func (x ExtensionSpec_ExtensionType) Enum() *ExtensionSpec_ExtensionType
func (ExtensionSpec_ExtensionType) EnumDescriptor
deprecated
func (ExtensionSpec_ExtensionType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ExtensionSpec_ExtensionType.Descriptor instead.
func (ExtensionSpec_ExtensionType) Number ¶
func (x ExtensionSpec_ExtensionType) Number() protoreflect.EnumNumber
func (ExtensionSpec_ExtensionType) String ¶
func (x ExtensionSpec_ExtensionType) String() string
func (ExtensionSpec_ExtensionType) Type ¶
func (ExtensionSpec_ExtensionType) Type() protoreflect.EnumType
func (*ExtensionSpec_ExtensionType) UnmarshalJSON
deprecated
func (x *ExtensionSpec_ExtensionType) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ExtensionSpec_ExtensionUsageRequirement ¶
type ExtensionSpec_ExtensionUsageRequirement int32
TagSpec.requires_extension will be set to the new extension's name on one or more TagSpecs that require that extension. This typically creates 2 validation requirements:
- If a tag is on the page whose TagSpec has the requires_extension field set, but that extension is not present, this is an error. (Usage requires extension).
- If an extension is on the page, but no tags indicating usage of that extension via the required_extension field are on the page, this is an error. (Extension requires usage).
The second requirement (extension requires usage) has a few exceptions:
- For older extensions, implemented before these tagspec rules, we do not want to introduce a breaking change, so we exempt these extensions from the usage requirement. New extensions must use ERROR.
- Some extensions, such as `amp-dynamic-css-classes`, do not have any associated tag in the document indicating usage. These extensions do not trigger warnings or errors.
NEXT AVAILABLE TAG: 4
const ( ExtensionSpec_ERROR ExtensionSpec_ExtensionUsageRequirement = 1 // Exception for exempted extensions. #1 above. ExtensionSpec_EXEMPTED ExtensionSpec_ExtensionUsageRequirement = 2 // Exception for extensions with no usage-indicating tag. #2 above. ExtensionSpec_NONE ExtensionSpec_ExtensionUsageRequirement = 3 )
func (ExtensionSpec_ExtensionUsageRequirement) Descriptor ¶
func (ExtensionSpec_ExtensionUsageRequirement) Descriptor() protoreflect.EnumDescriptor
func (ExtensionSpec_ExtensionUsageRequirement) EnumDescriptor
deprecated
func (ExtensionSpec_ExtensionUsageRequirement) EnumDescriptor() ([]byte, []int)
Deprecated: Use ExtensionSpec_ExtensionUsageRequirement.Descriptor instead.
func (ExtensionSpec_ExtensionUsageRequirement) Number ¶
func (x ExtensionSpec_ExtensionUsageRequirement) Number() protoreflect.EnumNumber
func (ExtensionSpec_ExtensionUsageRequirement) String ¶
func (x ExtensionSpec_ExtensionUsageRequirement) String() string
func (ExtensionSpec_ExtensionUsageRequirement) Type ¶
func (ExtensionSpec_ExtensionUsageRequirement) Type() protoreflect.EnumType
func (*ExtensionSpec_ExtensionUsageRequirement) UnmarshalJSON
deprecated
func (x *ExtensionSpec_ExtensionUsageRequirement) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type HtmlFormat ¶
type HtmlFormat struct {
// contains filtered or unexported fields
}
The HtmlFormat is the declared format in the top-level html tag, which prescribes a particular set of validation rules. This should be kept in sync with Request.HtmlFormat in github.com/ampproject/amppackager/transformer/request/request.proto.
func (*HtmlFormat) Descriptor
deprecated
func (*HtmlFormat) Descriptor() ([]byte, []int)
Deprecated: Use HtmlFormat.ProtoReflect.Descriptor instead.
func (*HtmlFormat) ProtoMessage ¶
func (*HtmlFormat) ProtoMessage()
func (*HtmlFormat) ProtoReflect ¶
func (x *HtmlFormat) ProtoReflect() protoreflect.Message
func (*HtmlFormat) Reset ¶
func (x *HtmlFormat) Reset()
func (*HtmlFormat) String ¶
func (x *HtmlFormat) String() string
type HtmlFormat_Code ¶
type HtmlFormat_Code int32
NEXT AVAILABLE TAG: 6
const ( HtmlFormat_UNKNOWN_CODE HtmlFormat_Code = 0 // Never used HtmlFormat_AMP HtmlFormat_Code = 1 HtmlFormat_AMP4ADS HtmlFormat_Code = 2 HtmlFormat_AMP4EMAIL HtmlFormat_Code = 3 HtmlFormat_EXPERIMENTAL HtmlFormat_Code = 4 // Currently unused )
func (HtmlFormat_Code) Descriptor ¶
func (HtmlFormat_Code) Descriptor() protoreflect.EnumDescriptor
func (HtmlFormat_Code) Enum ¶
func (x HtmlFormat_Code) Enum() *HtmlFormat_Code
func (HtmlFormat_Code) EnumDescriptor
deprecated
func (HtmlFormat_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use HtmlFormat_Code.Descriptor instead.
func (HtmlFormat_Code) Number ¶
func (x HtmlFormat_Code) Number() protoreflect.EnumNumber
func (HtmlFormat_Code) String ¶
func (x HtmlFormat_Code) String() string
func (HtmlFormat_Code) Type ¶
func (HtmlFormat_Code) Type() protoreflect.EnumType
func (*HtmlFormat_Code) UnmarshalJSON
deprecated
func (x *HtmlFormat_Code) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type MediaQuerySpec ¶
type MediaQuerySpec struct { // If issues_as_error is true, then parsing errors and invalid // types / features will be treated as validator errors, otherwise warnings. IssuesAsError *bool `protobuf:"varint,1,opt,name=issues_as_error,json=issuesAsError,def=0" json:"issues_as_error,omitempty"` // These are the media query types and features allowed within the stylesheet. // http://developer.mozilla.org/en-US/docs/Web/CSS/Media_Queries/Using_media_queries#Syntax Type []string `protobuf:"bytes,2,rep,name=type" json:"type,omitempty"` Feature []string `protobuf:"bytes,3,rep,name=feature" json:"feature,omitempty"` // contains filtered or unexported fields }
This spec is used when parsing a media query inside a CSS @media rule. NEXT AVAILABLE TAG: 5
func (*MediaQuerySpec) Descriptor
deprecated
func (*MediaQuerySpec) Descriptor() ([]byte, []int)
Deprecated: Use MediaQuerySpec.ProtoReflect.Descriptor instead.
func (*MediaQuerySpec) GetFeature ¶
func (x *MediaQuerySpec) GetFeature() []string
func (*MediaQuerySpec) GetIssuesAsError ¶
func (x *MediaQuerySpec) GetIssuesAsError() bool
func (*MediaQuerySpec) GetType ¶
func (x *MediaQuerySpec) GetType() []string
func (*MediaQuerySpec) ProtoMessage ¶
func (*MediaQuerySpec) ProtoMessage()
func (*MediaQuerySpec) ProtoReflect ¶
func (x *MediaQuerySpec) ProtoReflect() protoreflect.Message
func (*MediaQuerySpec) Reset ¶
func (x *MediaQuerySpec) Reset()
func (*MediaQuerySpec) String ¶
func (x *MediaQuerySpec) String() string
type PropertySpec ¶
type PropertySpec struct { // Must be lowercase, and will be matched case-insensitively. Name *string `protobuf:"bytes,1,opt,name=name" json:"name,omitempty"` Mandatory *bool `protobuf:"varint,2,opt,name=mandatory" json:"mandatory,omitempty"` // Must be lowercase, and will be matched case-insensitively. Value *string `protobuf:"bytes,3,opt,name=value" json:"value,omitempty"` ValueDouble *float64 `protobuf:"fixed64,4,opt,name=value_double,json=valueDouble" json:"value_double,omitempty"` // } end oneof // contains filtered or unexported fields }
Used for validating properties in attribute values. Our validator (via parse-viewport.h) implements the parsing algorithm as described here: https://drafts.csswg.org/css-device-adapt/#parsing-algorithm NEXT AVAILABLE TAG: 5
func (*PropertySpec) Descriptor
deprecated
func (*PropertySpec) Descriptor() ([]byte, []int)
Deprecated: Use PropertySpec.ProtoReflect.Descriptor instead.
func (*PropertySpec) GetMandatory ¶
func (x *PropertySpec) GetMandatory() bool
func (*PropertySpec) GetName ¶
func (x *PropertySpec) GetName() string
func (*PropertySpec) GetValue ¶
func (x *PropertySpec) GetValue() string
func (*PropertySpec) GetValueDouble ¶
func (x *PropertySpec) GetValueDouble() float64
func (*PropertySpec) ProtoMessage ¶
func (*PropertySpec) ProtoMessage()
func (*PropertySpec) ProtoReflect ¶
func (x *PropertySpec) ProtoReflect() protoreflect.Message
func (*PropertySpec) Reset ¶
func (x *PropertySpec) Reset()
func (*PropertySpec) String ¶
func (x *PropertySpec) String() string
type PropertySpecList ¶
type PropertySpecList struct { Properties []*PropertySpec `protobuf:"bytes,1,rep,name=properties" json:"properties,omitempty"` // contains filtered or unexported fields }
NEXT AVAILABLE TAG: 2
func (*PropertySpecList) Descriptor
deprecated
func (*PropertySpecList) Descriptor() ([]byte, []int)
Deprecated: Use PropertySpecList.ProtoReflect.Descriptor instead.
func (*PropertySpecList) GetProperties ¶
func (x *PropertySpecList) GetProperties() []*PropertySpec
func (*PropertySpecList) ProtoMessage ¶
func (*PropertySpecList) ProtoMessage()
func (*PropertySpecList) ProtoReflect ¶
func (x *PropertySpecList) ProtoReflect() protoreflect.Message
func (*PropertySpecList) Reset ¶
func (x *PropertySpecList) Reset()
func (*PropertySpecList) String ¶
func (x *PropertySpecList) String() string
type ReferencePoint ¶
type ReferencePoint struct { // A tag spec identified by its TagSpec::spec_name which specifies how // a specific functionality for the parent tag is assigned. TagSpecName *string `protobuf:"bytes,1,opt,name=tag_spec_name,json=tagSpecName" json:"tag_spec_name,omitempty"` // At least one of the child tags of the parent defining this // reference point must match it. Mandatory *bool `protobuf:"varint,2,opt,name=mandatory" json:"mandatory,omitempty"` // At most one of the child tags of the parent defining this // reference point must match it. Unique *bool `protobuf:"varint,3,opt,name=unique" json:"unique,omitempty"` // contains filtered or unexported fields }
TagSpecs and reference points.
Any TagSpec may define a list of reference points via the TagSpec::reference_points field. These reference points specify how DOM elements that are children of this parent tag fulfill particular functionality. For instance, a widget (implemented as an AMP tag) may require a login reference point. Any valid AMP tag would be allowed, whether it's a clickable DIV or an AMP-IMG or a BUTTON, so long as it *also* conforms to the reference point specification. This specification is a TagSpec which does not define a name (the name is set to the special value '$REFERENCE_POINT'), but rather identifies the reference point with AttrSpec requirements. For instance, the login reference point may require that there be a login attribute, or some end-point attribute with a URL, or similar. Therefore, for any child tags of a tag that defines reference points, they are first matched against these reference points, and only then are they validated as regular tags against the TagSpecs that are not reference points while their reference point attributes are skipped. The complexity of this mechanism is unfortunate but reduces the markup required and makes CSS styling more convenient. Please see the amp-live-list specification for an example. NEXT AVAILABLE TAG: 4
func (*ReferencePoint) Descriptor
deprecated
func (*ReferencePoint) Descriptor() ([]byte, []int)
Deprecated: Use ReferencePoint.ProtoReflect.Descriptor instead.
func (*ReferencePoint) GetMandatory ¶
func (x *ReferencePoint) GetMandatory() bool
func (*ReferencePoint) GetTagSpecName ¶
func (x *ReferencePoint) GetTagSpecName() string
func (*ReferencePoint) GetUnique ¶
func (x *ReferencePoint) GetUnique() bool
func (*ReferencePoint) ProtoMessage ¶
func (*ReferencePoint) ProtoMessage()
func (*ReferencePoint) ProtoReflect ¶
func (x *ReferencePoint) ProtoReflect() protoreflect.Message
func (*ReferencePoint) Reset ¶
func (x *ReferencePoint) Reset()
func (*ReferencePoint) String ¶
func (x *ReferencePoint) String() string
type SelectorSpec ¶
type SelectorSpec struct { // Allowed attribute selector names. For example `foo` in the selector // `.a[foo=bar]`. AttributeName []string `protobuf:"bytes,1,rep,name=attribute_name,json=attributeName" json:"attribute_name,omitempty"` // Allowed pseudo class names. For example `checked` in `.a:checked`. PseudoClass []string `protobuf:"bytes,2,rep,name=pseudo_class,json=pseudoClass" json:"pseudo_class,omitempty"` // Allowed pseudo element names. For example `before` in `.a::before`. PseudoElement []string `protobuf:"bytes,3,rep,name=pseudo_element,json=pseudoElement" json:"pseudo_element,omitempty"` // contains filtered or unexported fields }
This spec is used when parsing a CSS selector group as the prelude of a CSS qualified rule. For example "div.foo span.bar". If no SelectorSpec is provided, the selector groups are unconstrained. NEXT AVAILABLE TAG: 4
func (*SelectorSpec) Descriptor
deprecated
func (*SelectorSpec) Descriptor() ([]byte, []int)
Deprecated: Use SelectorSpec.ProtoReflect.Descriptor instead.
func (*SelectorSpec) GetAttributeName ¶
func (x *SelectorSpec) GetAttributeName() []string
func (*SelectorSpec) GetPseudoClass ¶
func (x *SelectorSpec) GetPseudoClass() []string
func (*SelectorSpec) GetPseudoElement ¶
func (x *SelectorSpec) GetPseudoElement() []string
func (*SelectorSpec) ProtoMessage ¶
func (*SelectorSpec) ProtoMessage()
func (*SelectorSpec) ProtoReflect ¶
func (x *SelectorSpec) ProtoReflect() protoreflect.Message
func (*SelectorSpec) Reset ¶
func (x *SelectorSpec) Reset()
func (*SelectorSpec) String ¶
func (x *SelectorSpec) String() string
type TagSpec ¶
type TagSpec struct { // The html_format field tells the validator for which html formats // (ie: (<html ⚡> vs <html a4⚡>) this HTML TagSpec is allowed to validate. // The repeated field is not allowed to be empty, it must have at least one // HtmlFormat. HtmlFormat []HtmlFormat_Code `protobuf:"varint,21,rep,name=html_format,json=htmlFormat,enum=amp.validator.HtmlFormat_Code" json:"html_format,omitempty"` // If provided, the Type Identifier(s) that either enable or disable // this TagSpec. If a Type Identifier is in `enabled_by` then this // TagSpec will be used in validating parsed documents which include that Type // Identifier. If a Type Identifier is in `disabled_by` then this // TagSpec will not be used in validating parsed documents which include that // Type Identifier. A TagSpec can not have both `enabled_by` and `disabled_by` // set. EnabledBy []string `protobuf:"bytes,35,rep,name=enabled_by,json=enabledBy" json:"enabled_by,omitempty"` DisabledBy []string `protobuf:"bytes,36,rep,name=disabled_by,json=disabledBy" json:"disabled_by,omitempty"` // Use UPPER-CASE tag names only. If adding the same tag twice, then they must // also have a spec_name string which is unique throughout all detail. // Note: "$REFERENCE_POINT" is a special tag_name value. // Reference points are partial tag specs which don't have a defined // tag_name. TagName *string `protobuf:"bytes,1,opt,name=tag_name,json=tagName" json:"tag_name,omitempty"` // If provided, the spec_name must be unique within the validator // rules. This string forms a a unique id for this TagSpec. If not set, the // tag_name field is used as the unique id. This string is not used in error // messages, see descriptive_name for that. SpecName *string `protobuf:"bytes,2,opt,name=spec_name,json=specName" json:"spec_name,omitempty"` // If `tag_name` is not a sufficient descriptor for error messages having to // do with this tag spec, provide a `descriptive_name` value, which if present // will be used in place of `tag_name`. Typically `descriptive_name` should // include the tag_name in it, and should avoid using < and > in case // downstream libraries of the validator fail to properly HTML escape rendered // error strings. DescriptiveName *string `protobuf:"bytes,39,opt,name=descriptive_name,json=descriptiveName" json:"descriptive_name,omitempty"` NamedId *TagSpec_NamedId `protobuf:"varint,33,opt,name=named_id,json=namedId,enum=amp.validator.TagSpec_NamedId,def=0" json:"named_id,omitempty"` // If provided, this is a SCRIPT tag defining an amp custom element // extension. The other fields, such as expected attributes, will be // validated by the extension spec rules. ExtensionSpec *ExtensionSpec `protobuf:"bytes,27,opt,name=extension_spec,json=extensionSpec" json:"extension_spec,omitempty"` // If set, this tag is considered part of an amp extended component, and // requires that the named extended component script tag is present on the // page. RequiresExtension []string `protobuf:"bytes,28,rep,name=requires_extension,json=requiresExtension" json:"requires_extension,omitempty"` // If true, a tag conforming to this tag spec must occur at least once // within the document. Mandatory *bool `protobuf:"varint,3,opt,name=mandatory" json:"mandatory,omitempty"` // A string identifying that this tag belongs to a set of alternative // choices from which at least one needs to be satisfied. MandatoryAlternatives *string `protobuf:"bytes,4,opt,name=mandatory_alternatives,json=mandatoryAlternatives" json:"mandatory_alternatives,omitempty"` // If true, a tag conforming to this tag spec may occur at most once within // the document. Unique *bool `protobuf:"varint,5,opt,name=unique" json:"unique,omitempty"` // If true, a tag conforming to this tag spec should occur at most once within // the document. That is, unlike for unique, we'll emit a warning. UniqueWarning *bool `protobuf:"varint,25,opt,name=unique_warning,json=uniqueWarning" json:"unique_warning,omitempty"` // If set to "$ROOT", this tag must be the root tag. // If set to any other string, the tag must be the direct child of the // specified mandatory parent tag. MandatoryParent *string `protobuf:"bytes,6,opt,name=mandatory_parent,json=mandatoryParent" json:"mandatory_parent,omitempty"` // If set, the tag must descend from (not necessarily direct parent of) the // specified mandatory parent string which is either a tag name or a tag // spec_name (e.g. tag.name = "!DOCTYPE" or tag.spec_name = "html doctype"). MandatoryAncestor *string `protobuf:"bytes,15,opt,name=mandatory_ancestor,json=mandatoryAncestor" json:"mandatory_ancestor,omitempty"` // Use only for tags where mandatory_ancestor is set. If tag validation fails // due to the mandatory_ancestor, and this field is set, then the error // detail will suggest the tag specified here as an alternative to consider. MandatoryAncestorSuggestedAlternative *string `` /* 170-byte string literal not displayed */ // This tag may not descend from any tag with any of these tag names or tag // spec_names (e.g. tag.name = "!DOCTYPE" or tag.spec_name = "html doctype"). DisallowedAncestor []string `protobuf:"bytes,13,rep,name=disallowed_ancestor,json=disallowedAncestor" json:"disallowed_ancestor,omitempty"` // If set, all of the tag's descendants must be tags from the named list. // A tag not in the named list will generate an error. DescendantTagList *string `protobuf:"bytes,29,opt,name=descendant_tag_list,json=descendantTagList" json:"descendant_tag_list,omitempty"` // If set, other tags - identified by their detail string - must be // present as well or a warning will be issued (will not invalidate doc). AlsoRequiresTagWarning []string `protobuf:"bytes,22,rep,name=also_requires_tag_warning,json=alsoRequiresTagWarning" json:"also_requires_tag_warning,omitempty"` // Expresses a generic condition which is satisfied if this tag is found. Used // in combination with the `requires` attribute on a different tag. SatisfiesCondition []string `protobuf:"bytes,23,rep,name=satisfies_condition" json:"satisfies_condition,omitempty"` // Expresses a generic condition which must be satisfied if this tag is found. // Used in combination with the `satisfies` attributes on a different tag. RequiresCondition []string `protobuf:"bytes,24,rep,name=requires_condition" json:"requires_condition,omitempty"` // The excludes field is a generic condition, which must not be satisfied if // this tag is found. Otherwise a TAG_EXCLUDED_BY_TAG error will be generated. // Used in combination with the `satisfies` attributes on a different tag. ExcludesCondition []string `protobuf:"bytes,32,rep,name=excludes_condition" json:"excludes_condition,omitempty"` // If set, generates a DEPRECATED_TAG error with severity WARNING. // The value of the deprecation field indicates what to use instead, // e.g. the name of a tag. Deprecation *string `protobuf:"bytes,17,opt,name=deprecation" json:"deprecation,omitempty"` // If provided, a URL which links to the AMP HTML spec for this deprecation. DeprecationUrl *string `protobuf:"bytes,18,opt,name=deprecation_url,json=deprecationUrl" json:"deprecation_url,omitempty"` // This TagSpec will only validate against attributes explicitly // listed within the TagSpec (attrs and attr_lists). No attributes // from $GLOBAL_ATTRS and $AMP_LAYOUT_ATTRS are valid unless explicitly // added as an attribute within the TagSpec. The field `amp_layout` is not // allowed to be set when `explicit_attrs_only` is true. ExplicitAttrsOnly *bool `protobuf:"varint,34,opt,name=explicit_attrs_only,json=explicitAttrsOnly,def=0" json:"explicit_attrs_only,omitempty"` // Attribute specifications related to this tag. Attrs []*AttrSpec `protobuf:"bytes,7,rep,name=attrs" json:"attrs,omitempty"` // Top level attr lists of shared tags, identified by unique key // (see attr_lists map in ValidatorRules). AttrLists []string `protobuf:"bytes,8,rep,name=attr_lists,json=attrLists" json:"attr_lists,omitempty"` // Note that these are evaluated after a particular TagSpec // has been evaluated. Unlike other checks in this TagSpec, we // no longer have the ability to fall back on a different TagSpec. Cdata *CdataSpec `protobuf:"bytes,12,opt,name=cdata" json:"cdata,omitempty"` // Specifies which tags can be the child tags, that is, immediately children // of this tag in the document. ChildTags *ChildTagSpec `protobuf:"bytes,19,opt,name=child_tags,json=childTags" json:"child_tags,omitempty"` // If set to true, this tag cannot have any siblings. SiblingsDisallowed *bool `protobuf:"varint,30,opt,name=siblings_disallowed,json=siblingsDisallowed,def=0" json:"siblings_disallowed,omitempty"` // If set to true, this tag must be the last child of its parent. MandatoryLastChild *bool `protobuf:"varint,31,opt,name=mandatory_last_child,json=mandatoryLastChild,def=0" json:"mandatory_last_child,omitempty"` // The reference_points defined by this TagSpec instance determine how // specific child tags are identified. Please see the comment for the // ReferencePoint message. ReferencePoints []*ReferencePoint `protobuf:"bytes,20,rep,name=reference_points,json=referencePoints" json:"reference_points,omitempty"` // If provided, a URL which linking to a section / sentence in the // AMP HTML spec. If a TagSpec contains a requires_extension field, // spec_url will be inherited from the named extension, unless overridden // by the setting it here. SpecUrl *string `protobuf:"bytes,10,opt,name=spec_url,json=specUrl" json:"spec_url,omitempty"` // If set, specifies which AMP Layouts are supported by this element. AmpLayout *AmpLayout `protobuf:"bytes,11,opt,name=amp_layout,json=ampLayout" json:"amp_layout,omitempty"` // If set, triggers related validation rules for descendants of this tag. MarkDescendants *AncestorMarker `protobuf:"bytes,38,opt,name=mark_descendants,json=markDescendants" json:"mark_descendants,omitempty"` // contains filtered or unexported fields }
Tags that are not covered by at least one of these specs are disallowed. Some tags are mandatory. Note that the tag name is not unique, that is, there can be multiple tag specs covering the same name, e.g., for multiple meta tags (with different attributes). NEXT AVAILABLE TAG: 40
func (*TagSpec) Descriptor
deprecated
func (*TagSpec) GetAlsoRequiresTagWarning ¶
func (*TagSpec) GetAmpLayout ¶
func (*TagSpec) GetAttrLists ¶
func (*TagSpec) GetChildTags ¶
func (x *TagSpec) GetChildTags() *ChildTagSpec
func (*TagSpec) GetDeprecation ¶
func (*TagSpec) GetDeprecationUrl ¶
func (*TagSpec) GetDescendantTagList ¶
func (*TagSpec) GetDescriptiveName ¶
func (*TagSpec) GetDisabledBy ¶
func (*TagSpec) GetDisallowedAncestor ¶
func (*TagSpec) GetEnabledBy ¶
func (*TagSpec) GetExcludesCondition ¶
func (*TagSpec) GetExplicitAttrsOnly ¶
func (*TagSpec) GetExtensionSpec ¶
func (x *TagSpec) GetExtensionSpec() *ExtensionSpec
func (*TagSpec) GetHtmlFormat ¶
func (x *TagSpec) GetHtmlFormat() []HtmlFormat_Code
func (*TagSpec) GetMandatory ¶
func (*TagSpec) GetMandatoryAlternatives ¶
func (*TagSpec) GetMandatoryAncestor ¶
func (*TagSpec) GetMandatoryAncestorSuggestedAlternative ¶
func (*TagSpec) GetMandatoryLastChild ¶
func (*TagSpec) GetMandatoryParent ¶
func (*TagSpec) GetMarkDescendants ¶
func (x *TagSpec) GetMarkDescendants() *AncestorMarker
func (*TagSpec) GetNamedId ¶
func (x *TagSpec) GetNamedId() TagSpec_NamedId
func (*TagSpec) GetReferencePoints ¶
func (x *TagSpec) GetReferencePoints() []*ReferencePoint
func (*TagSpec) GetRequiresCondition ¶
func (*TagSpec) GetRequiresExtension ¶
func (*TagSpec) GetSatisfiesCondition ¶
func (*TagSpec) GetSiblingsDisallowed ¶
func (*TagSpec) GetSpecName ¶
func (*TagSpec) GetSpecUrl ¶
func (*TagSpec) GetTagName ¶
func (*TagSpec) GetUniqueWarning ¶
func (*TagSpec) ProtoMessage ¶
func (*TagSpec) ProtoMessage()
func (*TagSpec) ProtoReflect ¶
func (x *TagSpec) ProtoReflect() protoreflect.Message
type TagSpec_NamedId ¶
type TagSpec_NamedId int32
NamedId's are used to uniquely identify specific TagSpecs in the validator rules in a stable manner. Most TagSpecs have no set NamedId. If a TagSpec has a NamedId it must be unique. In other words, no two TagSpec's may have the same NamedId except for the NOT_SET (0) value. NEXT AVAILABLE TAG: 3
const ( TagSpec_NOT_SET TagSpec_NamedId = 0 // By convention, the first "word" in the Id should be the tag_name. TagSpec_LINK_FONT_STYLESHEET TagSpec_NamedId = 1 TagSpec_STYLE_AMP_CUSTOM TagSpec_NamedId = 2 )
func (TagSpec_NamedId) Descriptor ¶
func (TagSpec_NamedId) Descriptor() protoreflect.EnumDescriptor
func (TagSpec_NamedId) Enum ¶
func (x TagSpec_NamedId) Enum() *TagSpec_NamedId
func (TagSpec_NamedId) EnumDescriptor
deprecated
func (TagSpec_NamedId) EnumDescriptor() ([]byte, []int)
Deprecated: Use TagSpec_NamedId.Descriptor instead.
func (TagSpec_NamedId) Number ¶
func (x TagSpec_NamedId) Number() protoreflect.EnumNumber
func (TagSpec_NamedId) String ¶
func (x TagSpec_NamedId) String() string
func (TagSpec_NamedId) Type ¶
func (TagSpec_NamedId) Type() protoreflect.EnumType
func (*TagSpec_NamedId) UnmarshalJSON
deprecated
func (x *TagSpec_NamedId) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type UrlSpec ¶
type UrlSpec struct { // protocol must be in lowercase (e.g. "javascript" not "JavaScript"). Protocol []string `protobuf:"bytes,1,rep,name=protocol" json:"protocol,omitempty"` AllowRelative *bool `protobuf:"varint,2,opt,name=allow_relative,json=allowRelative,def=1" json:"allow_relative,omitempty"` // Whether the empty string ” is allowed for this URL value. AllowEmpty *bool `protobuf:"varint,3,opt,name=allow_empty,json=allowEmpty,def=0" json:"allow_empty,omitempty"` // contains filtered or unexported fields }
Used for validating urls in attribute values (such as href/src/srcset). NEXT AVAILABLE TAG: 5
func (*UrlSpec) Descriptor
deprecated
func (*UrlSpec) GetAllowEmpty ¶
func (*UrlSpec) GetAllowRelative ¶
func (*UrlSpec) GetProtocol ¶
func (*UrlSpec) ProtoMessage ¶
func (*UrlSpec) ProtoMessage()
func (*UrlSpec) ProtoReflect ¶
func (x *UrlSpec) ProtoReflect() protoreflect.Message
type ValidationError ¶
type ValidationError struct { Severity *ValidationError_Severity `protobuf:"varint,6,opt,name=severity,enum=amp.validator.ValidationError_Severity,def=1" json:"severity,omitempty"` Code *ValidationError_Code `protobuf:"varint,1,opt,name=code,enum=amp.validator.ValidationError_Code" json:"code,omitempty"` Line *int32 `protobuf:"varint,2,opt,name=line,def=1" json:"line,omitempty"` Col *int32 `protobuf:"varint,3,opt,name=col" json:"col,omitempty"` SpecUrl *string `protobuf:"bytes,5,opt,name=spec_url,json=specUrl" json:"spec_url,omitempty"` Params []string `protobuf:"bytes,7,rep,name=params" json:"params,omitempty"` // This field is deprecated. Do not use. Category *ErrorCategory_Code `protobuf:"varint,8,opt,name=category,enum=amp.validator.ErrorCategory_Code" json:"category,omitempty"` // Used only in JavaScript, if an error is emitted for a specific HTML tag and // if that HTML tag has an attribute named data-amp-report-test, this string // will be set and contain the value found for that attribute. This is used // in tests to match specific errors to specific tags in the test cases. It // is not a rendered value. DataAmpReportTestValue *string `` /* 126-byte string literal not displayed */ // contains filtered or unexported fields }
We record validation errors in a structured form, so that they can be worked with in code - e.g., to provide translated messages. In the Javascript implementation (validator.js), you may find the amp.validator.renderErrorMessage function which will make a human-readable string from the structured form. It should be easy to port this to other languages as needed; for instance Google has implementations in C++, Java, and for templates used in some frontends. NEXT AVAILABLE TAG: 10
func (*ValidationError) Descriptor
deprecated
func (*ValidationError) Descriptor() ([]byte, []int)
Deprecated: Use ValidationError.ProtoReflect.Descriptor instead.
func (*ValidationError) GetCategory ¶
func (x *ValidationError) GetCategory() ErrorCategory_Code
func (*ValidationError) GetCode ¶
func (x *ValidationError) GetCode() ValidationError_Code
func (*ValidationError) GetCol ¶
func (x *ValidationError) GetCol() int32
func (*ValidationError) GetDataAmpReportTestValue ¶
func (x *ValidationError) GetDataAmpReportTestValue() string
func (*ValidationError) GetLine ¶
func (x *ValidationError) GetLine() int32
func (*ValidationError) GetParams ¶
func (x *ValidationError) GetParams() []string
func (*ValidationError) GetSeverity ¶
func (x *ValidationError) GetSeverity() ValidationError_Severity
func (*ValidationError) GetSpecUrl ¶
func (x *ValidationError) GetSpecUrl() string
func (*ValidationError) ProtoMessage ¶
func (*ValidationError) ProtoMessage()
func (*ValidationError) ProtoReflect ¶
func (x *ValidationError) ProtoReflect() protoreflect.Message
func (*ValidationError) Reset ¶
func (x *ValidationError) Reset()
func (*ValidationError) String ¶
func (x *ValidationError) String() string
type ValidationError_Code ¶
type ValidationError_Code int32
NEXT AVAILABLE TAG: 124
const ( ValidationError_UNKNOWN_CODE ValidationError_Code = 0 ValidationError_INVALID_DOCTYPE_HTML ValidationError_Code = 111 ValidationError_MANDATORY_TAG_MISSING ValidationError_Code = 1 ValidationError_TAG_REQUIRED_BY_MISSING ValidationError_Code = 24 ValidationError_WARNING_TAG_REQUIRED_BY_MISSING ValidationError_Code = 76 ValidationError_TAG_EXCLUDED_BY_TAG ValidationError_Code = 101 ValidationError_WARNING_EXTENSION_UNUSED ValidationError_Code = 79 ValidationError_EXTENSION_UNUSED ValidationError_Code = 84 ValidationError_WARNING_EXTENSION_DEPRECATED_VERSION ValidationError_Code = 80 ValidationError_INVALID_EXTENSION_VERSION ValidationError_Code = 122 ValidationError_INVALID_EXTENSION_PATH ValidationError_Code = 123 ValidationError_NON_LTS_SCRIPT_AFTER_LTS ValidationError_Code = 112 ValidationError_LTS_SCRIPT_AFTER_NON_LTS ValidationError_Code = 113 ValidationError_INCORRECT_SCRIPT_RELEASE_VERSION ValidationError_Code = 119 ValidationError_DISALLOWED_AMP_DOMAIN ValidationError_Code = 121 ValidationError_ATTR_REQUIRED_BUT_MISSING ValidationError_Code = 61 ValidationError_DISALLOWED_TAG ValidationError_Code = 2 ValidationError_GENERAL_DISALLOWED_TAG ValidationError_Code = 51 ValidationError_DISALLOWED_SCRIPT_TAG ValidationError_Code = 88 ValidationError_DISALLOWED_ATTR ValidationError_Code = 3 ValidationError_DISALLOWED_STYLE_ATTR ValidationError_Code = 81 ValidationError_INVALID_ATTR_VALUE ValidationError_Code = 4 ValidationError_DUPLICATE_ATTRIBUTE ValidationError_Code = 94 ValidationError_ATTR_VALUE_REQUIRED_BY_LAYOUT ValidationError_Code = 27 ValidationError_MISSING_LAYOUT_ATTRIBUTES ValidationError_Code = 105 ValidationError_IMPLIED_LAYOUT_INVALID ValidationError_Code = 22 ValidationError_SPECIFIED_LAYOUT_INVALID ValidationError_Code = 26 ValidationError_MANDATORY_ATTR_MISSING ValidationError_Code = 5 ValidationError_MANDATORY_ONEOF_ATTR_MISSING ValidationError_Code = 28 ValidationError_MANDATORY_ANYOF_ATTR_MISSING ValidationError_Code = 104 ValidationError_DUPLICATE_DIMENSION ValidationError_Code = 60 ValidationError_DUPLICATE_UNIQUE_TAG ValidationError_Code = 6 ValidationError_DUPLICATE_UNIQUE_TAG_WARNING ValidationError_Code = 77 ValidationError_WRONG_PARENT_TAG ValidationError_Code = 7 ValidationError_STYLESHEET_TOO_LONG ValidationError_Code = 50 ValidationError_STYLESHEET_AND_INLINE_STYLE_TOO_LONG ValidationError_Code = 102 ValidationError_INLINE_STYLE_TOO_LONG ValidationError_Code = 103 ValidationError_INLINE_SCRIPT_TOO_LONG ValidationError_Code = 118 ValidationError_MANDATORY_CDATA_MISSING_OR_INCORRECT ValidationError_Code = 9 ValidationError_CDATA_VIOLATES_DENYLIST ValidationError_Code = 30 ValidationError_NON_WHITESPACE_CDATA_ENCOUNTERED ValidationError_Code = 82 ValidationError_INVALID_JSON_CDATA ValidationError_Code = 106 ValidationError_DEPRECATED_ATTR ValidationError_Code = 11 ValidationError_DEPRECATED_TAG ValidationError_Code = 12 ValidationError_MANDATORY_PROPERTY_MISSING_FROM_ATTR_VALUE ValidationError_Code = 14 ValidationError_INVALID_PROPERTY_VALUE_IN_ATTR_VALUE ValidationError_Code = 15 ValidationError_MISSING_URL ValidationError_Code = 35 ValidationError_INVALID_URL ValidationError_Code = 36 ValidationError_INVALID_URL_PROTOCOL ValidationError_Code = 37 ValidationError_DISALLOWED_DOMAIN ValidationError_Code = 62 ValidationError_DISALLOWED_RELATIVE_URL ValidationError_Code = 49 ValidationError_DISALLOWED_PROPERTY_IN_ATTR_VALUE ValidationError_Code = 16 ValidationError_MUTUALLY_EXCLUSIVE_ATTRS ValidationError_Code = 17 ValidationError_UNESCAPED_TEMPLATE_IN_ATTR_VALUE ValidationError_Code = 18 ValidationError_TEMPLATE_PARTIAL_IN_ATTR_VALUE ValidationError_Code = 19 ValidationError_TEMPLATE_IN_ATTR_NAME ValidationError_Code = 20 ValidationError_INCONSISTENT_UNITS_FOR_WIDTH_AND_HEIGHT ValidationError_Code = 21 ValidationError_DISALLOWED_TAG_ANCESTOR ValidationError_Code = 23 ValidationError_MANDATORY_LAST_CHILD_TAG ValidationError_Code = 89 ValidationError_MANDATORY_TAG_ANCESTOR ValidationError_Code = 31 ValidationError_MANDATORY_TAG_ANCESTOR_WITH_HINT ValidationError_Code = 32 ValidationError_ATTR_DISALLOWED_BY_IMPLIED_LAYOUT ValidationError_Code = 33 ValidationError_ATTR_DISALLOWED_BY_SPECIFIED_LAYOUT ValidationError_Code = 34 ValidationError_INCORRECT_NUM_CHILD_TAGS ValidationError_Code = 56 ValidationError_INCORRECT_MIN_NUM_CHILD_TAGS ValidationError_Code = 85 ValidationError_DISALLOWED_CHILD_TAG_NAME ValidationError_Code = 57 ValidationError_DISALLOWED_FIRST_CHILD_TAG_NAME ValidationError_Code = 58 ValidationError_DISALLOWED_MANUFACTURED_BODY ValidationError_Code = 64 ValidationError_CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT ValidationError_Code = 66 ValidationError_MANDATORY_REFERENCE_POINT_MISSING ValidationError_Code = 67 ValidationError_DUPLICATE_REFERENCE_POINT ValidationError_Code = 68 ValidationError_TAG_NOT_ALLOWED_TO_HAVE_SIBLINGS ValidationError_Code = 87 ValidationError_TAG_REFERENCE_POINT_CONFLICT ValidationError_Code = 69 ValidationError_CHILD_TAG_DOES_NOT_SATISFY_REFERENCE_POINT_SINGULAR ValidationError_Code = 70 // TODO(gregable): Fix this spelling error: 'precede' ValidationError_BASE_TAG_MUST_PRECEED_ALL_URLS ValidationError_Code = 78 ValidationError_MISSING_REQUIRED_EXTENSION ValidationError_Code = 83 ValidationError_ATTR_MISSING_REQUIRED_EXTENSION ValidationError_Code = 97 ValidationError_DOCUMENT_TOO_COMPLEX ValidationError_Code = 86 ValidationError_INVALID_UTF8 ValidationError_Code = 96 ValidationError_DOCUMENT_SIZE_LIMIT_EXCEEDED ValidationError_Code = 108 ValidationError_DEV_MODE_ONLY ValidationError_Code = 109 ValidationError_AMP_EMAIL_MISSING_STRICT_CSS_ATTR ValidationError_Code = 120 ValidationError_VALUE_SET_MISMATCH ValidationError_Code = 110 ValidationError_CSS_SYNTAX_INVALID_AT_RULE ValidationError_Code = 29 ValidationError_CSS_SYNTAX_STRAY_TRAILING_BACKSLASH ValidationError_Code = 38 ValidationError_CSS_SYNTAX_UNTERMINATED_COMMENT ValidationError_Code = 39 ValidationError_CSS_SYNTAX_UNTERMINATED_STRING ValidationError_Code = 40 ValidationError_CSS_SYNTAX_BAD_URL ValidationError_Code = 41 ValidationError_CSS_SYNTAX_EOF_IN_PRELUDE_OF_QUALIFIED_RULE ValidationError_Code = 42 ValidationError_CSS_SYNTAX_INVALID_DECLARATION ValidationError_Code = 43 ValidationError_CSS_SYNTAX_INCOMPLETE_DECLARATION ValidationError_Code = 44 ValidationError_CSS_SYNTAX_ERROR_IN_PSEUDO_SELECTOR ValidationError_Code = 45 ValidationError_CSS_SYNTAX_MISSING_SELECTOR ValidationError_Code = 46 ValidationError_CSS_SYNTAX_NOT_A_SELECTOR_START ValidationError_Code = 47 ValidationError_CSS_SYNTAX_UNPARSED_INPUT_REMAINS_IN_SELECTOR ValidationError_Code = 48 ValidationError_CSS_SYNTAX_MISSING_URL ValidationError_Code = 52 ValidationError_CSS_SYNTAX_INVALID_URL ValidationError_Code = 53 ValidationError_CSS_SYNTAX_INVALID_URL_PROTOCOL ValidationError_Code = 54 ValidationError_CSS_SYNTAX_DISALLOWED_DOMAIN ValidationError_Code = 63 ValidationError_CSS_SYNTAX_DISALLOWED_RELATIVE_URL ValidationError_Code = 55 ValidationError_CSS_SYNTAX_INVALID_ATTR_SELECTOR ValidationError_Code = 59 ValidationError_CSS_SYNTAX_INVALID_PROPERTY ValidationError_Code = 90 ValidationError_CSS_SYNTAX_INVALID_PROPERTY_NOLIST ValidationError_Code = 95 ValidationError_CSS_SYNTAX_QUALIFIED_RULE_HAS_NO_DECLARATIONS ValidationError_Code = 91 ValidationError_CSS_SYNTAX_DISALLOWED_QUALIFIED_RULE_MUST_BE_INSIDE_KEYFRAME ValidationError_Code = 92 ValidationError_CSS_SYNTAX_DISALLOWED_KEYFRAME_INSIDE_KEYFRAME ValidationError_Code = 93 ValidationError_CSS_SYNTAX_MALFORMED_MEDIA_QUERY ValidationError_Code = 98 ValidationError_CSS_SYNTAX_DISALLOWED_MEDIA_TYPE ValidationError_Code = 99 ValidationError_CSS_SYNTAX_DISALLOWED_MEDIA_FEATURE ValidationError_Code = 100 ValidationError_CSS_SYNTAX_DISALLOWED_ATTR_SELECTOR ValidationError_Code = 114 ValidationError_CSS_SYNTAX_DISALLOWED_PSEUDO_CLASS ValidationError_Code = 115 ValidationError_CSS_SYNTAX_DISALLOWED_PSEUDO_ELEMENT ValidationError_Code = 116 ValidationError_CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE ValidationError_Code = 71 ValidationError_CSS_SYNTAX_DISALLOWED_IMPORTANT ValidationError_Code = 117 ValidationError_CSS_EXCESSIVELY_NESTED ValidationError_Code = 107 // The following codes are currently used only by A4A CSS validation. ValidationError_CSS_SYNTAX_DISALLOWED_PROPERTY_VALUE_WITH_HINT ValidationError_Code = 72 ValidationError_CSS_SYNTAX_PROPERTY_DISALLOWED_WITHIN_AT_RULE ValidationError_Code = 73 ValidationError_CSS_SYNTAX_PROPERTY_DISALLOWED_TOGETHER_WITH ValidationError_Code = 74 ValidationError_CSS_SYNTAX_PROPERTY_REQUIRES_QUALIFICATION ValidationError_Code = 75 )
func (ValidationError_Code) Descriptor ¶
func (ValidationError_Code) Descriptor() protoreflect.EnumDescriptor
func (ValidationError_Code) Enum ¶
func (x ValidationError_Code) Enum() *ValidationError_Code
func (ValidationError_Code) EnumDescriptor
deprecated
func (ValidationError_Code) EnumDescriptor() ([]byte, []int)
Deprecated: Use ValidationError_Code.Descriptor instead.
func (ValidationError_Code) Number ¶
func (x ValidationError_Code) Number() protoreflect.EnumNumber
func (ValidationError_Code) String ¶
func (x ValidationError_Code) String() string
func (ValidationError_Code) Type ¶
func (ValidationError_Code) Type() protoreflect.EnumType
func (*ValidationError_Code) UnmarshalJSON
deprecated
func (x *ValidationError_Code) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ValidationError_Severity ¶
type ValidationError_Severity int32
NEXT AVAILABLE TAG: 5
const ( ValidationError_UNKNOWN_SEVERITY ValidationError_Severity = 0 // A document with at least one error of this severity fails validation. ValidationError_ERROR ValidationError_Severity = 1 // A document may have warnings and still pass validation. ValidationError_WARNING ValidationError_Severity = 4 // DO NOT REASSIGN the previously used values 2, 3. )
func (ValidationError_Severity) Descriptor ¶
func (ValidationError_Severity) Descriptor() protoreflect.EnumDescriptor
func (ValidationError_Severity) Enum ¶
func (x ValidationError_Severity) Enum() *ValidationError_Severity
func (ValidationError_Severity) EnumDescriptor
deprecated
func (ValidationError_Severity) EnumDescriptor() ([]byte, []int)
Deprecated: Use ValidationError_Severity.Descriptor instead.
func (ValidationError_Severity) Number ¶
func (x ValidationError_Severity) Number() protoreflect.EnumNumber
func (ValidationError_Severity) String ¶
func (x ValidationError_Severity) String() string
func (ValidationError_Severity) Type ¶
func (ValidationError_Severity) Type() protoreflect.EnumType
func (*ValidationError_Severity) UnmarshalJSON
deprecated
func (x *ValidationError_Severity) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ValidationResult ¶
type ValidationResult struct { Status *ValidationResult_Status `protobuf:"varint,2,opt,name=status,enum=amp.validator.ValidationResult_Status" json:"status,omitempty"` Errors []*ValidationError `protobuf:"bytes,1,rep,name=errors" json:"errors,omitempty"` // The following field is deprecated and can return any value. Do not depend // on this. // // Deprecated: Do not use. ValidatorRevision *int32 `protobuf:"varint,3,opt,name=validator_revision,json=validatorRevision,def=-1" json:"validator_revision,omitempty"` // Deprecated: Do not use. SpecFileRevision *int32 `protobuf:"varint,4,opt,name=spec_file_revision,json=specFileRevision,def=-1" json:"spec_file_revision,omitempty"` // If the AMP document is a transformed AMP document, then this is the // version of the transformers that were used to transform it. If the document // is not transformed, then the transformer_version's value will be 0. // Note: the AMP Pacakager's transformer library specifies the version as // int64. However, JavaScript does not natively support int64 so int32 is // used instead. // https://github.com/ampproject/amppackager/blob/master/transformer/transformers/context.go TransformerVersion *int32 `protobuf:"varint,6,opt,name=transformer_version,json=transformerVersion,def=0" json:"transformer_version,omitempty"` // The type idenfitier of the parsed document, e.g. AMP, AMP4ADS or some other // type that has yet to be defined. These are declared on the HTML tag and // parsed by the Validator Engine. TypeIdentifier []string `protobuf:"bytes,5,rep,name=type_identifier,json=typeIdentifier" json:"type_identifier,omitempty"` // The set of provisions from all matching AttrSpecs in this TagSpec match. // If the TagSpec is selected, these will be added to the final set of // provisions. ValueSetProvisions []*ValueSetProvision `protobuf:"bytes,7,rep,name=value_set_provisions,json=valueSetProvisions" json:"value_set_provisions,omitempty"` // The set of requirements from all matching AttrSpecs in this TagSpec match. // If the TagSpec is selected, these will be added to the final set of // requirements. ValueSetRequirements []*ValueSetRequirement `protobuf:"bytes,8,rep,name=value_set_requirements,json=valueSetRequirements" json:"value_set_requirements,omitempty"` // contains filtered or unexported fields }
The validation result provided by Validator instances (see Validator::Result in validator.h). To render such a proto see RenderValidationResult. NEXT AVAILABLE TAG: 9
func (*ValidationResult) Descriptor
deprecated
func (*ValidationResult) Descriptor() ([]byte, []int)
Deprecated: Use ValidationResult.ProtoReflect.Descriptor instead.
func (*ValidationResult) GetErrors ¶
func (x *ValidationResult) GetErrors() []*ValidationError
func (*ValidationResult) GetSpecFileRevision
deprecated
func (x *ValidationResult) GetSpecFileRevision() int32
Deprecated: Do not use.
func (*ValidationResult) GetStatus ¶
func (x *ValidationResult) GetStatus() ValidationResult_Status
func (*ValidationResult) GetTransformerVersion ¶
func (x *ValidationResult) GetTransformerVersion() int32
func (*ValidationResult) GetTypeIdentifier ¶
func (x *ValidationResult) GetTypeIdentifier() []string
func (*ValidationResult) GetValidatorRevision
deprecated
func (x *ValidationResult) GetValidatorRevision() int32
Deprecated: Do not use.
func (*ValidationResult) GetValueSetProvisions ¶
func (x *ValidationResult) GetValueSetProvisions() []*ValueSetProvision
func (*ValidationResult) GetValueSetRequirements ¶
func (x *ValidationResult) GetValueSetRequirements() []*ValueSetRequirement
func (*ValidationResult) ProtoMessage ¶
func (*ValidationResult) ProtoMessage()
func (*ValidationResult) ProtoReflect ¶
func (x *ValidationResult) ProtoReflect() protoreflect.Message
func (*ValidationResult) Reset ¶
func (x *ValidationResult) Reset()
func (*ValidationResult) String ¶
func (x *ValidationResult) String() string
type ValidationResult_Status ¶
type ValidationResult_Status int32
NEXT AVAILABLE TAG: 3
const ( ValidationResult_UNKNOWN ValidationResult_Status = 0 ValidationResult_PASS ValidationResult_Status = 1 ValidationResult_FAIL ValidationResult_Status = 2 )
func (ValidationResult_Status) Descriptor ¶
func (ValidationResult_Status) Descriptor() protoreflect.EnumDescriptor
func (ValidationResult_Status) Enum ¶
func (x ValidationResult_Status) Enum() *ValidationResult_Status
func (ValidationResult_Status) EnumDescriptor
deprecated
func (ValidationResult_Status) EnumDescriptor() ([]byte, []int)
Deprecated: Use ValidationResult_Status.Descriptor instead.
func (ValidationResult_Status) Number ¶
func (x ValidationResult_Status) Number() protoreflect.EnumNumber
func (ValidationResult_Status) String ¶
func (x ValidationResult_Status) String() string
func (ValidationResult_Status) Type ¶
func (ValidationResult_Status) Type() protoreflect.EnumType
func (*ValidationResult_Status) UnmarshalJSON
deprecated
func (x *ValidationResult_Status) UnmarshalJSON(b []byte) error
Deprecated: Do not use.
type ValidatorRules ¶
type ValidatorRules struct { Tags []*TagSpec `protobuf:"bytes,1,rep,name=tags" json:"tags,omitempty"` AttrLists []*AttrList `protobuf:"bytes,7,rep,name=attr_lists,json=attrLists" json:"attr_lists,omitempty"` // The min file revision for validator.cc which can digest this file. // // Deprecated: Do not use. MinValidatorRevisionRequired *int32 `` /* 143-byte string literal not displayed */ // See comment in validator.protoascii. // // Deprecated: Do not use. SpecFileRevision *int32 `protobuf:"varint,6,opt,name=spec_file_revision,json=specFileRevision,def=-1" json:"spec_file_revision,omitempty"` // Spec URL for information about mustache templates. TemplateSpecUrl *string `protobuf:"bytes,8,opt,name=template_spec_url,json=templateSpecUrl" json:"template_spec_url,omitempty"` // Spec URL for information about styles and amp-custom stylesheet StylesSpecUrl *string `protobuf:"bytes,15,opt,name=styles_spec_url,json=stylesSpecUrl" json:"styles_spec_url,omitempty"` // Spec URL for information about script tags. ScriptSpecUrl *string `protobuf:"bytes,17,opt,name=script_spec_url,json=scriptSpecUrl" json:"script_spec_url,omitempty"` ErrorFormats []*ErrorFormat `protobuf:"bytes,9,rep,name=error_formats,json=errorFormats" json:"error_formats,omitempty"` ErrorSpecificity []*ErrorSpecificity `protobuf:"bytes,13,rep,name=error_specificity,json=errorSpecificity" json:"error_specificity,omitempty"` DescendantTagList []*DescendantTagList `protobuf:"bytes,16,rep,name=descendant_tag_list,json=descendantTagList" json:"descendant_tag_list,omitempty"` // The DocSpec rules are scoped by the document's HtmlFormat and Type // Identifiers and defined within each DocSpec. Doc []*DocSpec `protobuf:"bytes,21,rep,name=doc" json:"doc,omitempty"` Css []*DocCssSpec `protobuf:"bytes,19,rep,name=css" json:"css,omitempty"` DeclarationList []*DeclarationList `protobuf:"bytes,20,rep,name=declaration_list,json=declarationList" json:"declaration_list,omitempty"` // contains filtered or unexported fields }
Top level message - start reading here. The validator knows about a set of tag specifications. NEXT AVAILABLE TAG: 22
func (*ValidatorRules) Descriptor
deprecated
func (*ValidatorRules) Descriptor() ([]byte, []int)
Deprecated: Use ValidatorRules.ProtoReflect.Descriptor instead.
func (*ValidatorRules) GetAttrLists ¶
func (x *ValidatorRules) GetAttrLists() []*AttrList
func (*ValidatorRules) GetCss ¶
func (x *ValidatorRules) GetCss() []*DocCssSpec
func (*ValidatorRules) GetDeclarationList ¶
func (x *ValidatorRules) GetDeclarationList() []*DeclarationList
func (*ValidatorRules) GetDescendantTagList ¶
func (x *ValidatorRules) GetDescendantTagList() []*DescendantTagList
func (*ValidatorRules) GetDoc ¶
func (x *ValidatorRules) GetDoc() []*DocSpec
func (*ValidatorRules) GetErrorFormats ¶
func (x *ValidatorRules) GetErrorFormats() []*ErrorFormat
func (*ValidatorRules) GetErrorSpecificity ¶
func (x *ValidatorRules) GetErrorSpecificity() []*ErrorSpecificity
func (*ValidatorRules) GetMinValidatorRevisionRequired
deprecated
func (x *ValidatorRules) GetMinValidatorRevisionRequired() int32
Deprecated: Do not use.
func (*ValidatorRules) GetScriptSpecUrl ¶
func (x *ValidatorRules) GetScriptSpecUrl() string
func (*ValidatorRules) GetSpecFileRevision
deprecated
func (x *ValidatorRules) GetSpecFileRevision() int32
Deprecated: Do not use.
func (*ValidatorRules) GetStylesSpecUrl ¶
func (x *ValidatorRules) GetStylesSpecUrl() string
func (*ValidatorRules) GetTags ¶
func (x *ValidatorRules) GetTags() []*TagSpec
func (*ValidatorRules) GetTemplateSpecUrl ¶
func (x *ValidatorRules) GetTemplateSpecUrl() string
func (*ValidatorRules) ProtoMessage ¶
func (*ValidatorRules) ProtoMessage()
func (*ValidatorRules) ProtoReflect ¶
func (x *ValidatorRules) ProtoReflect() protoreflect.Message
func (*ValidatorRules) Reset ¶
func (x *ValidatorRules) Reset()
func (*ValidatorRules) String ¶
func (x *ValidatorRules) String() string
type ValueSetProvision ¶
type ValueSetProvision struct { // The collection to add the attribute value to. Set *AttrSpec_ValueSet `protobuf:"varint,1,opt,name=set,enum=amp.validator.AttrSpec_ValueSet" json:"set,omitempty"` // The value of the attribute itself. Value *string `protobuf:"bytes,2,opt,name=value" json:"value,omitempty"` // contains filtered or unexported fields }
A value to be added to a particular ValueSet, as found when scanning the document (i.e. AttrSpec.add_value_to_set). NEXT AVAILABLE TAG: 3
func (*ValueSetProvision) Descriptor
deprecated
func (*ValueSetProvision) Descriptor() ([]byte, []int)
Deprecated: Use ValueSetProvision.ProtoReflect.Descriptor instead.
func (*ValueSetProvision) GetSet ¶
func (x *ValueSetProvision) GetSet() AttrSpec_ValueSet
func (*ValueSetProvision) GetValue ¶
func (x *ValueSetProvision) GetValue() string
func (*ValueSetProvision) ProtoMessage ¶
func (*ValueSetProvision) ProtoMessage()
func (*ValueSetProvision) ProtoReflect ¶
func (x *ValueSetProvision) ProtoReflect() protoreflect.Message
func (*ValueSetProvision) Reset ¶
func (x *ValueSetProvision) Reset()
func (*ValueSetProvision) String ¶
func (x *ValueSetProvision) String() string
type ValueSetRequirement ¶
type ValueSetRequirement struct { // The provision that is required. Provision *ValueSetProvision `protobuf:"bytes,1,opt,name=provision" json:"provision,omitempty"` // The error that will appear if the requirement is not met. This includes the // line/col of the attribute that makes the requirement. ErrorIfUnsatisfied *ValidationError `protobuf:"bytes,2,opt,name=error_if_unsatisfied,json=errorIfUnsatisfied" json:"error_if_unsatisfied,omitempty"` // contains filtered or unexported fields }
A requirement that a particular value appears in a particular ValueSet (i.e. AttrSpec.value_oneof_set). All the provisions and requirements are collected until the document has been fully scanned, and then compared to ensure that all requirements are met. This allows provisions to appear after (or even alongside) requirements. NEXT AVAILABLE TAG: 3
func (*ValueSetRequirement) Descriptor
deprecated
func (*ValueSetRequirement) Descriptor() ([]byte, []int)
Deprecated: Use ValueSetRequirement.ProtoReflect.Descriptor instead.
func (*ValueSetRequirement) GetErrorIfUnsatisfied ¶
func (x *ValueSetRequirement) GetErrorIfUnsatisfied() *ValidationError
func (*ValueSetRequirement) GetProvision ¶
func (x *ValueSetRequirement) GetProvision() *ValueSetProvision
func (*ValueSetRequirement) ProtoMessage ¶
func (*ValueSetRequirement) ProtoMessage()
func (*ValueSetRequirement) ProtoReflect ¶
func (x *ValueSetRequirement) ProtoReflect() protoreflect.Message
func (*ValueSetRequirement) Reset ¶
func (x *ValueSetRequirement) Reset()
func (*ValueSetRequirement) String ¶
func (x *ValueSetRequirement) String() string