entity

package
v1.0.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 10, 2024 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Field

type Field struct {
	Message       string      `bson:"message"`
	PreviousValue interface{} `bson:"previousValue"`
	CurrentValue  interface{} `bson:"currentValue"`
}

func NewReasonField

func NewReasonField(message string, previous, current interface{}) *Field

func (*Field) GetCurrentValue

func (f *Field) GetCurrentValue() interface{}

func (*Field) GetMessage

func (f *Field) GetMessage() string

func (*Field) GetPreviousValue

func (f *Field) GetPreviousValue() interface{}

type Page

type Page struct {
	vo.ID       `bson:",inline"`
	Version     int    `bson:"version"`
	URL         string `bson:"url"`
	UserAgent   string `bson:"userAgent"`
	Title       string `bson:"title"`
	Description string `bson:"description"`
	Canonical   string `bson:"canonical"`
	H1          string `bson:"h1"`
	PlainText   string `bson:"plainText"`
	HTML        string `bson:"html"`
	// FAQ is a map which contains map[question] = answer
	FAQ map[string]string `bson:"faq"`
	// HrefLangs is a map which contains map[rel + "_" + language] = link
	HrefLangs map[string]string `bson:"hrefLangs"`
	// AlternateMedias is a map which contains map[rel + "_" + media] = link
	AlternateMedias map[string]string `bson:"alternateMedias"`
	// RelinkingBlock is a map of maps which contains map[blockTitle][anchor] = link
	RelinkingBlock map[string]map[string]string `bson:"relinkingBlock"`
	// Headers is a map of slices which contains map[headerName][][headerValue1, headerValue2, ...]
	Headers map[string][]string `bson:"headers"`
	// Reason is a struct which contains the diff. of fields.
	Reason       *Reason `bson:"reason,omitempty"`
	vo.Timestamp `bson:",inline"`
}

func NewPage

func NewPage(url, userAgent string) *Page

func (*Page) GetAlternateMedias

func (p *Page) GetAlternateMedias() map[string]string

func (*Page) GetCanonical

func (p *Page) GetCanonical() string

func (*Page) GetDescription

func (p *Page) GetDescription() string

func (*Page) GetFAQ

func (p *Page) GetFAQ() map[string]string

func (*Page) GetH1

func (p *Page) GetH1() string

func (*Page) GetHTML

func (p *Page) GetHTML() string

func (*Page) GetHeaders

func (p *Page) GetHeaders() map[string][]string

func (*Page) GetHrefLangs

func (p *Page) GetHrefLangs() map[string]string

func (*Page) GetID

func (p *Page) GetID() vo.ID

func (*Page) GetPlainText

func (p *Page) GetPlainText() string

func (*Page) GetReason

func (p *Page) GetReason() *Reason

func (*Page) GetRelinkingBlock

func (p *Page) GetRelinkingBlock() map[string]map[string]string

func (*Page) GetTitle

func (p *Page) GetTitle() string

func (*Page) GetURL

func (p *Page) GetURL() string

func (*Page) GetVersion

func (p *Page) GetVersion() int

func (*Page) UpVersion

func (p *Page) UpVersion(previous *Page)

type Reason

type Reason struct {
	ComparedVersion int `bson:"comparedVersion"`
	// Fields is a map of diff. fields (key is a field name).
	Fields map[string]*Field `bson:"fields"`
}

func NewReason

func NewReason(comparedVersion int, fields map[string]*Field) *Reason

func (*Reason) GetComparedVersion

func (r *Reason) GetComparedVersion() int

func (*Reason) GetFields

func (r *Reason) GetFields() map[string]*Field

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL