content

package
v1.7.2-staging-depreca... Latest Latest
Warning

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

Go to latest
Published: Nov 18, 2021 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Attributes

type Attributes struct {
	XMLName             xml.Name `xml:"ObjectMetadata"`
	SourceCode          string   `xml:"EditorialNotes>Sources>Source>SourceCode"`
	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"`
	OriginalUUID        string   `xml:"EditorialNotes>OriginalUUID"`
}

Attributes is the data structure that models methode content placeholders attributes

type Content

type Content interface {
	Initialize(binaryContent []byte) Content
	Validate(externalValidationEndpoint string, txID string, username string, password string) ValidationResponse
	GetType() string
	GetUUID() string
}

Content is the interface for different type of contents from different CMSs.

type DocStoreClient added in v1.0.4

type DocStoreClient interface {
	ContentQuery(authority string, identifier string, tid string) (status int, location string, err error)
	IsUUIDPresent(uuid, tid string) (isPresent bool, err error)
}

type EomFile

type EomFile struct {
	UUID             string        `json:"uuid"`
	LinkedObjects    []interface{} `json:"linkedObjects"`
	ContentType      string        `json:"type"`
	Value            string        `json:"value"`
	Attributes       string        `json:"attributes"`
	SystemAttributes string        `json:"systemAttributes"`
	UsageTickets     string        `json:"usageTickets"`
	WorkflowStatus   string        `json:"workflowStatus"`
	Type             string        `json:"-"` //This field is for internal application usage
	Source           Source        `json:"-"` //This field is for internal application usage
	BinaryContent    []byte        `json:"-"` //This field is for internal application usage
}

EomFile models Methode content

func (EomFile) GetType

func (eomfile EomFile) GetType() string

func (EomFile) GetUUID

func (eomfile EomFile) GetUUID() string

func (EomFile) Initialize

func (eomfile EomFile) Initialize(binaryContent []byte) Content

func (EomFile) Validate

func (eomfile EomFile) Validate(externalValidationEndpoint string, txID string, username string, password string) ValidationResponse

type GenericContent added in v1.1.0

type GenericContent struct {
	UUID          string `json:"uuid"`
	Type          string `json:"-"` //This field is for internal application usage
	BinaryContent []byte `json:"-"` //This field is for internal application usage
}

func (GenericContent) GetType added in v1.1.0

func (gc GenericContent) GetType() string

func (GenericContent) GetUUID added in v1.1.0

func (gc GenericContent) GetUUID() string

func (GenericContent) Initialize added in v1.1.0

func (gc GenericContent) Initialize(binaryContent []byte) Content

func (GenericContent) Validate added in v1.1.0

func (gc GenericContent) Validate(externalValidationEndpoint string, txID string, username string, password string) ValidationResponse

type HTTPDocStoreClient added in v1.0.4

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

func NewHTTPDocStoreClient added in v1.0.4

func NewHTTPDocStoreClient(docStoreAddress string, httpCaller httpcaller.Caller, username, password string) *HTTPDocStoreClient

func (*HTTPDocStoreClient) ContentQuery added in v1.0.4

func (c *HTTPDocStoreClient) ContentQuery(authority string, identifier string, tid string) (status int, location string, err error)

func (*HTTPDocStoreClient) IsUUIDPresent added in v1.0.4

func (c *HTTPDocStoreClient) IsUUIDPresent(uuid, tid string) (isPresent bool, err error)

type Post

type Post struct {
	Type string `json:"type"`
	UUID string `json:"uuid"`
	Url  string `json:"url"`
}

Post models WordPress content neglect unused fields (e.g. id, slug, title, content, etc)

type Source

type Source struct {
	XMLName    xml.Name `xml:"ObjectMetadata"`
	SourceCode string   `xml:"EditorialNotes>Sources>Source>SourceCode"`
}

type TypeResolver added in v1.0.4

type TypeResolver interface {
	ResolveTypeAndUUID(eomFile EomFile, txID string) (string, string, error)
}

func NewMethodeTypeResolver added in v1.0.4

func NewMethodeTypeResolver(uuidResolver UUIDResolver) TypeResolver

type UUIDResolver added in v1.0.4

type UUIDResolver interface {
	ResolveIdentifier(serviceID, refField, tid string) (string, error)
	ResolveOriginalUUID(uuid, tid string) (string, error)
}

func NewHTTPUUIDResolver added in v1.0.4

func NewHTTPUUIDResolver(client DocStoreClient, brandMappings map[string]string) UUIDResolver

type ValidationResponse

type ValidationResponse struct {
	IsValid         bool
	IsMarkedDeleted bool
}

type Video

type Video struct {
	ID            string `json:"id"`
	Deleted       bool   `json:"deleted,omitempty"`
	BinaryContent []byte `json:"-"` //This field is for internal application usage
}

func (Video) GetType

func (video Video) GetType() string

func (Video) GetUUID

func (video Video) GetUUID() string

func (Video) Initialize

func (video Video) Initialize(binaryContent []byte) Content

func (Video) Validate

func (video Video) Validate(externalValidationEndpoint string, txId string, username string, password string) ValidationResponse

type WordPressMessage

type WordPressMessage struct {
	Status        string `json:"status"`
	Error         string `json:"error"`
	Post          Post   `json:"post"`
	PreviousURL   string `json:"previousUrl"`
	BinaryContent []byte `json:"-"` //This field is for internal application usage
}

WordPressMessage models messages from Wordpress

func (WordPressMessage) GetType

func (wordPressMessage WordPressMessage) GetType() string

func (WordPressMessage) GetUUID

func (wordPressMessage WordPressMessage) GetUUID() string

func (WordPressMessage) Initialize

func (wordPressMessage WordPressMessage) Initialize(binaryContent []byte) Content

func (WordPressMessage) Validate

func (wordPressMessage WordPressMessage) Validate(extValEndpoint string, txId string, username string, password string) ValidationResponse

Jump to

Keyboard shortcuts

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