Documentation ¶
Index ¶
- Variables
- func BlockFromRPC(r *Block) newsdoc.Block
- func DocumentFromRPC(r *Document) newsdoc.Document
- type Block
- func (*Block) Descriptor() ([]byte, []int)deprecated
- func (x *Block) GetContent() []*Block
- func (x *Block) GetContenttype() string
- func (x *Block) GetData() map[string]string
- func (x *Block) GetId() string
- func (x *Block) GetLinks() []*Block
- func (x *Block) GetMeta() []*Block
- func (x *Block) GetName() string
- func (x *Block) GetRel() string
- func (x *Block) GetRole() string
- func (x *Block) GetSensitivity() string
- func (x *Block) GetTitle() string
- func (x *Block) GetType() string
- func (x *Block) GetUri() string
- func (x *Block) GetUrl() string
- func (x *Block) GetUuid() string
- func (x *Block) GetValue() string
- func (*Block) ProtoMessage()
- func (x *Block) ProtoReflect() protoreflect.Message
- func (x *Block) Reset()
- func (x *Block) String() string
- type Document
- func (*Document) Descriptor() ([]byte, []int)deprecated
- func (x *Document) GetContent() []*Block
- func (x *Document) GetLanguage() string
- func (x *Document) GetLinks() []*Block
- func (x *Document) GetMeta() []*Block
- func (x *Document) GetTitle() string
- func (x *Document) GetType() string
- func (x *Document) GetUri() string
- func (x *Document) GetUrl() string
- func (x *Document) GetUuid() string
- func (*Document) ProtoMessage()
- func (x *Document) ProtoReflect() protoreflect.Message
- func (x *Document) Reset()
- func (x *Document) String() string
Constants ¶
This section is empty.
Variables ¶
View Source
var File_newsdoc_newsdoc_proto protoreflect.FileDescriptor
Functions ¶
func BlockFromRPC ¶
BlockFromRPC converts Block protobuf messages to NewsDoc structures.
func DocumentFromRPC ¶
DocumentFromRPC converts Document protobuf messages to NewsDoc structures.
Types ¶
type Block ¶
type Block struct { // ID is the block ID, Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"` // UUID is used to reference another Document in a block. Uuid string `protobuf:"bytes,2,opt,name=uuid,proto3" json:"uuid,omitempty"` // URI is used to reference another entity in a document. Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` // URL is a browseable URL for the the block. Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // Type is the type of the block Type string `protobuf:"bytes,5,opt,name=type,proto3" json:"type,omitempty"` // Title is the title/headline of the block, typically used in the // presentation of the block. Title string `protobuf:"bytes,6,opt,name=title,proto3" json:"title,omitempty"` // Data contains block data. Data map[string]string `` /* 135-byte string literal not displayed */ // Rel describes the relationship to the document/parent entity. Rel string `protobuf:"bytes,8,opt,name=rel,proto3" json:"rel,omitempty"` // Role is used either as an alternative to rel, or for nuancing the // relationship. Role string `protobuf:"bytes,9,opt,name=role,proto3" json:"role,omitempty"` // Name is a name for the block. An alternative to "rel" when // relationship is a term that doesn't fit. Name string `protobuf:"bytes,10,opt,name=name,proto3" json:"name,omitempty"` // Value is a value for the block. Useful when we want to store a // primitive value. Value string `protobuf:"bytes,11,opt,name=value,proto3" json:"value,omitempty"` // ContentType is used to describe the content type of the block/linked // entity if it differs from the type of the block. Contenttype string `protobuf:"bytes,12,opt,name=contenttype,proto3" json:"contenttype,omitempty"` // Links are used to link to other resources and documents. Links []*Block `protobuf:"bytes,13,rep,name=links,proto3" json:"links,omitempty"` // Content is used to embed content blocks. Content []*Block `protobuf:"bytes,14,rep,name=content,proto3" json:"content,omitempty"` // Meta is used to embed metadata Meta []*Block `protobuf:"bytes,15,rep,name=meta,proto3" json:"meta,omitempty"` // Sensitivity can be use to communicate how the information in a block // can be handled. It could f.ex. be set to "internal", to show that it // contains information that must be removed or transformed before // publishing. Sensitivity string `protobuf:"bytes,16,opt,name=sensitivity,proto3" json:"sensitivity,omitempty"` // contains filtered or unexported fields }
Block is the building block for data embedded in documents. It is used for both content, links and metadata. Blocks have can be nested, but that's nothing to strive for, keep it simple.
func BlockToRPC ¶
BlockToRPC converts Block protobuf messages to NewsDoc structures.
func (*Block) Descriptor
deprecated
func (*Block) GetContent ¶
func (*Block) GetContenttype ¶
func (*Block) GetSensitivity ¶ added in v0.11.1
func (*Block) ProtoMessage ¶
func (*Block) ProtoMessage()
func (*Block) ProtoReflect ¶
func (x *Block) ProtoReflect() protoreflect.Message
type Document ¶
type Document struct { // UUID is a unique ID for the document, this can for example be a // random v4 UUID, or a URI-derived v5 UUID. Uuid string `protobuf:"bytes,1,opt,name=uuid,proto3" json:"uuid,omitempty"` // Type is the content type of the document. Type string `protobuf:"bytes,2,opt,name=type,proto3" json:"type,omitempty"` // URI identifies the document (in a more human-readable way than the // UUID). Uri string `protobuf:"bytes,3,opt,name=uri,proto3" json:"uri,omitempty"` // URL is the browseable location of the document (if any). Url string `protobuf:"bytes,4,opt,name=url,proto3" json:"url,omitempty"` // Title is the title of the document, can be used as the document name, // or the headline when the document is displayed. Title string `protobuf:"bytes,5,opt,name=title,proto3" json:"title,omitempty"` // Content is the content of the document, this is essentially what gets // rendered on the page when you view a document. Content []*Block `protobuf:"bytes,6,rep,name=content,proto3" json:"content,omitempty"` // Meta is the metadata for a document, this could be things like // teasers, open graph data, newsvalues. Meta []*Block `protobuf:"bytes,7,rep,name=meta,proto3" json:"meta,omitempty"` // Links are links to other resources and entities. This could be links // to topics, categories and subjects for the document, or credited // authors. Links []*Block `protobuf:"bytes,8,rep,name=links,proto3" json:"links,omitempty"` // Language is the language used in the document as an IETF language // tag. F.ex. "en", "en-UK", "es", or "sv-SE". Language string `protobuf:"bytes,9,opt,name=language,proto3" json:"language,omitempty"` // contains filtered or unexported fields }
Document is a NewsDoc document.
func DocumentToRPC ¶
DocumentToRPC converts Document protobuf messages to NewsDoc structures.
func (*Document) Descriptor
deprecated
func (*Document) GetContent ¶
func (*Document) GetLanguage ¶
func (*Document) ProtoMessage ¶
func (*Document) ProtoMessage()
func (*Document) ProtoReflect ¶
func (x *Document) ProtoReflect() protoreflect.Message
Click to show internal directories.
Click to hide internal directories.