Documentation
¶
Index ¶
- Constants
- Variables
- func ParseHTML(in string) (*html.Node, error)
- func PrettyHTML(in string) (string, error)
- type Content
- func (*Content) Descriptor() ([]byte, []int)deprecated
- func (x *Content) GetContent() *JSONNode
- func (x *Content) GetRawContent() string
- func (c *Content) GetSummary(length int) string
- func (x *Content) GetVersion() string
- func (x *Content) Populate() error
- func (*Content) ProtoMessage()
- func (x *Content) ProtoReflect() protoreflect.Message
- func (x *Content) Reset()
- func (m *Content) Sanitize() error
- func (x *Content) Scan(value any) error
- func (x *Content) String() string
- func (m *Content) Validate() error
- func (m *Content) ValidateAll() error
- func (x *Content) Value() (driver.Value, error)
- type ContentMultiError
- type ContentType
- func (ContentType) Descriptor() protoreflect.EnumDescriptor
- func (x ContentType) Enum() *ContentType
- func (ContentType) EnumDescriptor() ([]byte, []int)deprecated
- func (x ContentType) Number() protoreflect.EnumNumber
- func (x ContentType) String() string
- func (ContentType) Type() protoreflect.EnumType
- type ContentValidationError
- type JSONNode
- func (*JSONNode) Descriptor() ([]byte, []int)deprecated
- func (x *JSONNode) GetAttrs() map[string]string
- func (x *JSONNode) GetContent() []*JSONNode
- func (x *JSONNode) GetId() string
- func (x *JSONNode) GetTag() string
- func (x *JSONNode) GetText() string
- func (x *JSONNode) GetType() NodeType
- func (*JSONNode) ProtoMessage()
- func (x *JSONNode) ProtoReflect() protoreflect.Message
- func (x *JSONNode) Reset()
- func (m *JSONNode) Sanitize() error
- func (x *JSONNode) String() string
- func (n *JSONNode) ToHTML() (string, error)
- func (n *JSONNode) ToHTMLNode() (*html.Node, error)
- func (n *JSONNode) ToHTMLP() (string, error)
- func (m *JSONNode) Validate() error
- func (m *JSONNode) ValidateAll() error
- type JSONNodeMultiError
- type JSONNodeValidationError
- type NodeType
Constants ¶
const (
Version_v0 = "v0"
)
Variables ¶
var ( ContentType_name = map[int32]string{ 0: "CONTENT_TYPE_UNSPECIFIED", 1: "CONTENT_TYPE_HTML", 2: "CONTENT_TYPE_PLAIN", } ContentType_value = map[string]int32{ "CONTENT_TYPE_UNSPECIFIED": 0, "CONTENT_TYPE_HTML": 1, "CONTENT_TYPE_PLAIN": 2, } )
Enum value maps for ContentType.
var ( NodeType_name = map[int32]string{ 0: "NODE_TYPE_UNSPECIFIED", 1: "NODE_TYPE_DOC", 2: "NODE_TYPE_ELEMENT", 3: "NODE_TYPE_TEXT", 4: "NODE_TYPE_COMMENT", } NodeType_value = map[string]int32{ "NODE_TYPE_UNSPECIFIED": 0, "NODE_TYPE_DOC": 1, "NODE_TYPE_ELEMENT": 2, "NODE_TYPE_TEXT": 3, "NODE_TYPE_COMMENT": 4, } )
Enum value maps for NodeType.
var File_resources_common_content_content_proto protoreflect.FileDescriptor
Functions ¶
func PrettyHTML ¶
Types ¶
type Content ¶
type Content struct { Version *string `protobuf:"bytes,1,opt,name=version,proto3,oneof" json:"version,omitempty"` Content *JSONNode `protobuf:"bytes,2,opt,name=content,proto3,oneof" json:"content,omitempty"` // @sanitize RawContent *string `protobuf:"bytes,3,opt,name=raw_content,json=rawContent,proto3,oneof" json:"raw_content,omitempty"` // contains filtered or unexported fields }
func (*Content) Descriptor
deprecated
func (*Content) GetContent ¶
func (*Content) GetRawContent ¶
func (*Content) GetSummary ¶
func (*Content) GetVersion ¶
func (*Content) ProtoMessage ¶
func (*Content) ProtoMessage()
func (*Content) ProtoReflect ¶
func (x *Content) ProtoReflect() protoreflect.Message
func (*Content) Validate ¶
Validate checks the field values on Content with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*Content) ValidateAll ¶
ValidateAll checks the field values on Content with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in ContentMultiError, or nil if none found.
type ContentMultiError ¶
type ContentMultiError []error
ContentMultiError is an error wrapping multiple validation errors returned by Content.ValidateAll() if the designated constraints aren't met.
func (ContentMultiError) AllErrors ¶
func (m ContentMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (ContentMultiError) Error ¶
func (m ContentMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type ContentType ¶
type ContentType int32
const ( ContentType_CONTENT_TYPE_UNSPECIFIED ContentType = 0 ContentType_CONTENT_TYPE_HTML ContentType = 1 ContentType_CONTENT_TYPE_PLAIN ContentType = 2 )
func (ContentType) Descriptor ¶
func (ContentType) Descriptor() protoreflect.EnumDescriptor
func (ContentType) Enum ¶
func (x ContentType) Enum() *ContentType
func (ContentType) EnumDescriptor
deprecated
func (ContentType) EnumDescriptor() ([]byte, []int)
Deprecated: Use ContentType.Descriptor instead.
func (ContentType) Number ¶
func (x ContentType) Number() protoreflect.EnumNumber
func (ContentType) String ¶
func (x ContentType) String() string
func (ContentType) Type ¶
func (ContentType) Type() protoreflect.EnumType
type ContentValidationError ¶
type ContentValidationError struct {
// contains filtered or unexported fields
}
ContentValidationError is the validation error returned by Content.Validate if the designated constraints aren't met.
func (ContentValidationError) Cause ¶
func (e ContentValidationError) Cause() error
Cause function returns cause value.
func (ContentValidationError) Error ¶
func (e ContentValidationError) Error() string
Error satisfies the builtin error interface
func (ContentValidationError) ErrorName ¶
func (e ContentValidationError) ErrorName() string
ErrorName returns error name.
func (ContentValidationError) Field ¶
func (e ContentValidationError) Field() string
Field function returns field value.
func (ContentValidationError) Key ¶
func (e ContentValidationError) Key() bool
Key function returns key value.
func (ContentValidationError) Reason ¶
func (e ContentValidationError) Reason() string
Reason function returns reason value.
type JSONNode ¶
type JSONNode struct { Type NodeType `protobuf:"varint,1,opt,name=type,proto3,enum=resources.common.content.NodeType" json:"type,omitempty"` // @sanitize: method=StripTags Id *string `protobuf:"bytes,2,opt,name=id,proto3,oneof" json:"id,omitempty"` // @sanitize: method=StripTags Tag string `protobuf:"bytes,3,opt,name=tag,proto3" json:"tag,omitempty"` // @sanitize: method=StripTags Attrs map[string]string `` /* 137-byte string literal not displayed */ // @sanitize: method=StripTags Text *string `protobuf:"bytes,5,opt,name=text,proto3,oneof" json:"text,omitempty"` Content []*JSONNode `protobuf:"bytes,6,rep,name=content,proto3" json:"content,omitempty"` // contains filtered or unexported fields }
func (*JSONNode) Descriptor
deprecated
func (*JSONNode) GetContent ¶
func (*JSONNode) ProtoMessage ¶
func (*JSONNode) ProtoMessage()
func (*JSONNode) ProtoReflect ¶
func (x *JSONNode) ProtoReflect() protoreflect.Message
func (*JSONNode) Validate ¶
Validate checks the field values on JSONNode with the rules defined in the proto definition for this message. If any rules are violated, the first error encountered is returned, or nil if there are no violations.
func (*JSONNode) ValidateAll ¶
ValidateAll checks the field values on JSONNode with the rules defined in the proto definition for this message. If any rules are violated, the result is a list of violation errors wrapped in JSONNodeMultiError, or nil if none found.
type JSONNodeMultiError ¶
type JSONNodeMultiError []error
JSONNodeMultiError is an error wrapping multiple validation errors returned by JSONNode.ValidateAll() if the designated constraints aren't met.
func (JSONNodeMultiError) AllErrors ¶
func (m JSONNodeMultiError) AllErrors() []error
AllErrors returns a list of validation violation errors.
func (JSONNodeMultiError) Error ¶
func (m JSONNodeMultiError) Error() string
Error returns a concatenation of all the error messages it wraps.
type JSONNodeValidationError ¶
type JSONNodeValidationError struct {
// contains filtered or unexported fields
}
JSONNodeValidationError is the validation error returned by JSONNode.Validate if the designated constraints aren't met.
func (JSONNodeValidationError) Cause ¶
func (e JSONNodeValidationError) Cause() error
Cause function returns cause value.
func (JSONNodeValidationError) Error ¶
func (e JSONNodeValidationError) Error() string
Error satisfies the builtin error interface
func (JSONNodeValidationError) ErrorName ¶
func (e JSONNodeValidationError) ErrorName() string
ErrorName returns error name.
func (JSONNodeValidationError) Field ¶
func (e JSONNodeValidationError) Field() string
Field function returns field value.
func (JSONNodeValidationError) Key ¶
func (e JSONNodeValidationError) Key() bool
Key function returns key value.
func (JSONNodeValidationError) Reason ¶
func (e JSONNodeValidationError) Reason() string
Reason function returns reason value.
type NodeType ¶
type NodeType int32
func (NodeType) Descriptor ¶ added in v0.9.5
func (NodeType) Descriptor() protoreflect.EnumDescriptor
func (NodeType) EnumDescriptor
deprecated
added in
v0.9.5
func (NodeType) Number ¶ added in v0.9.5
func (x NodeType) Number() protoreflect.EnumNumber
func (NodeType) Type ¶ added in v0.9.5
func (NodeType) Type() protoreflect.EnumType