model

package
v2.0.0-k8s-migrate-to-... Latest Latest
Warning

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

Go to latest
Published: Jan 15, 2020 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

View Source
const (
	MethodeSystemID = "http://cmdb.ft.com/systems/methode-web-pub"
	UPPDateFormat   = "2006-01-02T15:04:05.000Z0700"
)

Variables

This section is empty.

Functions

func NewInvalidMethodeCPH

func NewInvalidMethodeCPH(msg string) error

Types

type AlternativeImages

type AlternativeImages struct {
	PromotionalImage *PromotionalImage `json:"promotionalImage"`
}

type AlternativeStandfirsts

type AlternativeStandfirsts struct {
	PromotionalStandfirst string `json:"promotionalStandfirst"`
}

type AlternativeTitles

type AlternativeTitles struct {
	PromotionalTitle    string `json:"promotionalTitle,omitempty"`
	ContentPackageTitle string `json:"contentPackageTitle,omitempty"`
}

AlternativeTitles represents the alternative titles for content according to UP data model

type Attributes

type Attributes struct {
	XMLName             xml.Name `xml:"ObjectMetadata"`
	SourceCode          string   `xml:"EditorialNotes>Sources>Source>SourceCode"`
	OriginalUUID        string   `xml:"EditorialNotes>OriginalUUID"`
	LastPublicationDate string   `xml:"OutputChannels>DIFTcom>DIFTcomLastPublication"`
	RefField            string   `xml:"WiresIndexing>ref_field"`
	ServiceId           string   `xml:"WiresIndexing>serviceid"`
	Category            string   `xml:"WiresIndexing>category"`
	IsDeleted           bool     `xml:"OutputChannels>DIFTcom>DIFTcomMarkDeleted"`
}

Attributes is the data structure that models methode content placeholders attributes

type Brand

type Brand struct {
	ID string `json:"id"`
}

Brand represents a content brand according to UP data model

func BuildBrands

func BuildBrands() []Brand

type DocStoreUppContent

type DocStoreUppContent struct {
	UppCoreContent
	Brands []Brand `json:"brands"`
}

type Identifier

type Identifier struct {
	Authority       string `json:"authority"`
	IdentifierValue string `json:"identifierValue"`
}

Identifier represents content identifiers according to UP data model

type InvalidMethodeCPH

type InvalidMethodeCPH struct {
	// contains filtered or unexported fields
}

func (*InvalidMethodeCPH) Error

func (e *InvalidMethodeCPH) Error() string

type LeadHeadline

type LeadHeadline struct {
	Text string `xml:",chardata"`
	URL  string `xml:"href,attr"`
}

LeadHeadline represents the LeadHeadline of a content placeholder

type LeadImage

type LeadImage struct {
	FileRef string `xml:"fileref,attr"`
}

LeadImage represents the image attribute of a methode content placeholder

type MethodeBody

type MethodeBody struct {
	XMLName                xml.Name     `xml:"doc"`
	LeadHeadline           LeadHeadline `xml:"lead>lead-headline>headline>ln>a"`
	LeadImage              LeadImage    `xml:"lead>lead-images>web-master"`
	LongStandfirst         string       `xml:"lead>web-stand-first>p"`
	ContentPackageHeadline string       `xml:"lead>package-navigation-headline>ln"`
}

MethodeBody represents the body of a methode content placeholder

type MethodeContentPlaceholder

type MethodeContentPlaceholder struct {
	AttributesXML    string      `json:"attributes"`
	SystemAttributes string      `json:"systemAttributes"`
	Type             string      `json:"type"`
	UsageTickets     string      `json:"usageTickets"`
	UUID             string      `json:"uuid"`
	Value            string      `json:"value"`
	WorkflowStatus   string      `json:"workflowStatus"`
	Attributes       Attributes  `json:"-"`
	Body             MethodeBody `json:"-"`
}

MethodeContentPlaceholder is a data structure that models native methode content placeholders

type MockCPHAggregateMapper

type MockCPHAggregateMapper struct {
	mock.Mock
}

func (*MockCPHAggregateMapper) MapContentPlaceholder

func (m *MockCPHAggregateMapper) MapContentPlaceholder(mpc *MethodeContentPlaceholder, tid, lmd string) ([]UppContent, error)

type MockCPHMapper

type MockCPHMapper struct {
	mock.Mock
}

func (*MockCPHMapper) MapContentPlaceholder

func (m *MockCPHMapper) MapContentPlaceholder(mpc *MethodeContentPlaceholder, uuid, tid, lmd string) ([]UppContent, error)

type MockCPHValidator

type MockCPHValidator struct {
	mock.Mock
}

func (*MockCPHValidator) Validate

type MockDocStoreClient

type MockDocStoreClient struct {
	mock.Mock
}

func (*MockDocStoreClient) ConnectivityCheck

func (m *MockDocStoreClient) ConnectivityCheck() (string, error)

func (*MockDocStoreClient) ContentExists

func (m *MockDocStoreClient) ContentExists(uuid, tid string) (bool, error)

func (*MockDocStoreClient) ContentQuery

func (m *MockDocStoreClient) ContentQuery(authority string, identifier string, tid string) (status int, location string, err error)

func (*MockDocStoreClient) GetContent

func (m *MockDocStoreClient) GetContent(uuid, tid string) (*DocStoreUppContent, error)

type MockIResolver

type MockIResolver struct {
	mock.Mock
}

func (*MockIResolver) ContentExists

func (m *MockIResolver) ContentExists(uuid, tid string) (bool, error)

func (*MockIResolver) ResolveIdentifier

func (m *MockIResolver) ResolveIdentifier(serviceId, refField, tid string) (string, error)

type MockMessageCreator

type MockMessageCreator struct {
	mock.Mock
}

func (*MockMessageCreator) ToPublicationEvent

func (m *MockMessageCreator) ToPublicationEvent(coreAttributes *UppCoreContent, payload interface{}) *PublicationEvent

func (*MockMessageCreator) ToPublicationEventMessage

func (m *MockMessageCreator) ToPublicationEventMessage(coreAttributes *UppCoreContent, payload interface{}) (*producer.Message, error)

type MockNativeMapper

type MockNativeMapper struct {
	mock.Mock
}

func (*MockNativeMapper) Map

func (m *MockNativeMapper) Map(messageBody []byte) (*MethodeContentPlaceholder, error)

type MockProducer

type MockProducer struct {
	mock.Mock
}

func (*MockProducer) ConnectivityCheck

func (p *MockProducer) ConnectivityCheck() (string, error)

func (*MockProducer) SendMessage

func (p *MockProducer) SendMessage(key string, msg producer.Message) error

type PromotionalImage

type PromotionalImage struct {
	Id string `json:"id"`
}

type PublicationEvent

type PublicationEvent struct {
	ContentURI   string      `json:"contentUri"`
	Payload      interface{} `json:"payload,omitempty"`
	LastModified string      `json:"lastModified"`
}

type UppComplementaryContent

type UppComplementaryContent struct {
	UppCoreContent
	AlternativeTitles      *AlternativeTitles      `json:"alternativeTitles"`
	AlternativeImages      *AlternativeImages      `json:"alternativeImages"`
	AlternativeStandfirsts *AlternativeStandfirsts `json:"alternativeStandfirsts"`
	Brands                 []Brand                 `json:"brands"`
	Type                   string                  `json:"type"`
}

type UppContent

type UppContent interface {
	GetUUID() string
	GetUppCoreContent() *UppCoreContent
}

type UppContentPlaceholder

type UppContentPlaceholder struct {
	UppCoreContent
	PublishedDate     string             `json:"publishedDate"`
	Title             string             `json:"title"`
	Identifiers       []Identifier       `json:"identifiers"`
	Brands            []Brand            `json:"brands"`
	AlternativeTitles *AlternativeTitles `json:"alternativeTitles"`
	WebURL            string             `json:"webUrl"`
	CanonicalWebUrl   string             `json:"canonicalWebUrl"`
	Type              string             `json:"type"`
	CanBeSyndicated   string             `json:"canBeSyndicated"`
	CanBeDistributed  string             `json:"canBeDistributed"`
}

UppContentPlaceholder represents the content placeholder representation according to UPP model. Note: Title holds the text of alternativeTitle as a CPH does not have a title and some clients expect one.

type UppCoreContent

type UppCoreContent struct {
	UUID             string `json:"uuid"`
	PublishReference string `json:"publishReference"`
	LastModified     string `json:"lastModified"`
	ContentURI       string `json:"-"`
	IsMarkedDeleted  bool   `json:"-"`
}

func (*UppCoreContent) GetUUID

func (ucp *UppCoreContent) GetUUID() string

func (*UppCoreContent) GetUppCoreContent

func (ucp *UppCoreContent) GetUppCoreContent() *UppCoreContent

Jump to

Keyboard shortcuts

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