Documentation ¶
Index ¶
- Constants
- func NewInvalidMethodeCPH(msg string) error
- type AlternativeImages
- type AlternativeStandfirsts
- type AlternativeTitles
- type Attributes
- type Brand
- type DocStoreUppContent
- type Identifier
- type InvalidMethodeCPH
- type LeadHeadline
- type LeadImage
- type MethodeBody
- type MethodeContentPlaceholder
- type MockCPHAggregateMapper
- type MockCPHMapper
- type MockCPHValidator
- type MockDocStoreClient
- func (m *MockDocStoreClient) ConnectivityCheck() (string, error)
- func (m *MockDocStoreClient) ContentExists(uuid, tid string) (bool, error)
- func (m *MockDocStoreClient) ContentQuery(authority string, identifier string, tid string) (status int, location string, err error)
- func (m *MockDocStoreClient) GetContent(uuid, tid string) (*DocStoreUppContent, error)
- type MockIResolver
- type MockMessageCreator
- type MockNativeMapper
- type MockProducer
- type PromotionalImage
- type PublicationEvent
- type UppComplementaryContent
- type UppContent
- type UppContentPlaceholder
- type UppCoreContent
Constants ¶
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 ¶
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 ¶
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 ¶
func (*MockCPHAggregateMapper) MapContentPlaceholder ¶
func (m *MockCPHAggregateMapper) MapContentPlaceholder(mpc *MethodeContentPlaceholder, tid, lmd string) ([]UppContent, error)
type MockCPHMapper ¶
func (*MockCPHMapper) MapContentPlaceholder ¶
func (m *MockCPHMapper) MapContentPlaceholder(mpc *MethodeContentPlaceholder, uuid, tid, lmd string) ([]UppContent, error)
type MockCPHValidator ¶
func (*MockCPHValidator) Validate ¶
func (m *MockCPHValidator) Validate(mcp *MethodeContentPlaceholder) error
type MockDocStoreClient ¶
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 (*MockDocStoreClient) GetContent ¶
func (m *MockDocStoreClient) GetContent(uuid, tid string) (*DocStoreUppContent, error)
type MockIResolver ¶
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 ¶
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 ¶
func (*MockNativeMapper) Map ¶
func (m *MockNativeMapper) Map(messageBody []byte) (*MethodeContentPlaceholder, error)
type MockProducer ¶
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 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