annotations

package
v1.1.11-dev-publish-rc1 Latest Latest
Warning

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

Go to latest
Published: Feb 5, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DocumentHashHeader         = "Document-Hash"
	PreviousDocumentHashHeader = "Previous-Document-Hash"
)

Variables

View Source
var (
	ErrDraftNotFound  = errors.New("draft was not found")
	ErrServiceTimeout = errors.New("downstream service timed out")
)

Functions

This section is empty.

Types

type Annotation

type Annotation struct {
	Predicate  string `json:"predicate"`
	ConceptID  string `json:"id"`
	APIURL     string `json:"apiUrl,omitempty"`
	Type       string `json:"type,omitempty"`
	PrefLabel  string `json:"prefLabel,omitempty"`
	IsFTAuthor bool   `json:"isFTAuthor,omitempty"`
}

type AnnotationsBody

type AnnotationsBody struct {
	Annotations []Annotation `json:"annotations"`
}

type AnnotationsClient

type AnnotationsClient interface {
	health.ExternalService
	GetAnnotations(ctx context.Context, uuid string) (AnnotationsBody, string, error)
	SaveAnnotations(ctx context.Context, uuid string, hash string, data AnnotationsBody) (AnnotationsBody, string, error)
}

func NewAnnotationsClient

func NewAnnotationsClient(endpoint string, client *http.Client) (AnnotationsClient, error)

type Publisher

type Publisher interface {
	health.ExternalService
	Publish(ctx context.Context, uuid string, body map[string]interface{}) error
	PublishFromStore(ctx context.Context, uuid string) error
	SaveAndPublish(ctx context.Context, uuid string, hash string, body AnnotationsBody) error
}

Publisher provides an interface to publish annotations to UPP

func NewPublisher

func NewPublisher(originSystemID string, draftAnnotationsClient AnnotationsClient, publishEndpoint string, gtgEndpoint string, client *http.Client) Publisher

NewPublisher returns a new Publisher instance

Jump to

Keyboard shortcuts

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