Documentation
¶
Index ¶
Constants ¶
const ( // NoAnnotationsMsg is error message used when there are no processed annotations. NoAnnotationsMsg = "No annotations found" // UPPBadRequestMsg is error message used when UPP annotations endpoint returns bad request. UPPBadRequestMsg = "UPP responded with a client error" // UPPNotFoundMsg is error message used when UPP annotations endpoint returns not found. UPPNotFoundMsg = "UPP responded with not found" // different from bad request and not found UPPServiceUnavailableMsg = "Service unavailable" )
const ( DocumentHashHeader = "Document-Hash" PreviousDocumentHashHeader = "Previous-Document-Hash" SchemaVersionHeader = "X-Schema-Version" DefaultSchemaVersion = "1" )
const ( OriginSystemIDHeader = "X-Origin-System-Id" PACOriginSystemID = "http://cmdb.ft.com/systems/pac" )
Variables ¶
var ErrGTGNotOK = errors.New("gtg returned a non-200 HTTP status")
var ErrUnexpectedStatusRead = errors.New("annotations RW returned an unexpected HTTP status code in read operation")
var ErrUnexpectedStatusWrite = errors.New("annotations RW returned an unexpected HTTP status code in write operation")
Functions ¶
Types ¶
type Canonicalizer ¶
type Canonicalizer struct {
// contains filtered or unexported fields
}
func NewCanonicalizer ¶
func NewCanonicalizer(sorterFactory func(ann []interface{}) sort.Interface) *Canonicalizer
func (*Canonicalizer) Canonicalize ¶
func (c *Canonicalizer) Canonicalize(in []interface{}) []interface{}
type OriginSystemIDHeaderKey ¶
type OriginSystemIDHeaderKey string
type RW ¶
type SchemaVersionHeaderKey ¶
type SchemaVersionHeaderKey string
type UPPAnnotationsAPI ¶
type UPPAnnotationsAPI struct {
// contains filtered or unexported fields
}
UPPAnnotationsAPI retrieves published annotations from UPP.
func NewUPPAnnotationsAPI ¶
func NewUPPAnnotationsAPI(client *http.Client, endpoint string, username string, password string, log *logger.UPPLogger) *UPPAnnotationsAPI
NewUPPAnnotationsAPI initializes UPPAnnotationsAPI by given http client, the url of the UPP public endpoint for getting published annotations and UPP API key.
func (*UPPAnnotationsAPI) Endpoint ¶
func (api *UPPAnnotationsAPI) Endpoint() string
Endpoint retrieves the template for UPP annotations endpoint
func (*UPPAnnotationsAPI) GTG ¶
func (api *UPPAnnotationsAPI) GTG() error
GTG is making call the UPP annotations endpoint for predefined synthetic content UUID and check that response is returned
func (*UPPAnnotationsAPI) GetAll ¶
func (api *UPPAnnotationsAPI) GetAll(ctx context.Context, contentUUID string) ([]interface{}, error)
GetAll retrieves the list of published annotations for given contentUUID. The returned list contains the annotations returned by UPP without filtering.
func (*UPPAnnotationsAPI) GetAllButV2 ¶
func (api *UPPAnnotationsAPI) GetAllButV2(ctx context.Context, contentUUID string) ([]interface{}, error)
GetAllButV2 retrieves the list of published annotations for given contentUUID but filtering v2 annotations.
type UPPError ¶
type UPPError struct {
// contains filtered or unexported fields
}
UPPError encapsulates error information for errors originating from calls to UPP annotations endpoint.
func NewUPPError ¶ added in v1.4.9
NewUPPError initializes UPPError