message

package
v0.9.1 Latest Latest
Warning

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

Go to latest
Published: Mar 26, 2021 License: AGPL-3.0 Imports: 16 Imported by: 0

Documentation

Overview

Package message provide types and functions to work with the RDSS API.

This package reflect what is in the specification repository: https://github.com/JiscSD/rdss-message-api-specification.

These are the main steps that need to be taken after a new release is made in the specification repository:

1) Update the commit of the message-api-spec git submodule so it points to the git tag desired, e.g. "v4.0.0".

2) Update the Version string in version.go.

3) When the API enumeration.json schema changes, update the corresponding shared_enumeration_gen.go using go generate. The generation happens in generator.go using text/template and go/format. Run:

go generate ./broker/message

Index

Constants

View Source
const (
	SchemaIDMetadataCreateRequest    = "https://www.jisc.ac.uk/rdss/schema/message/metadata/create_request.json/#/definitions/MetadataCreateRequest"
	SchemaIDMetadataUpdateRequest    = "https://www.jisc.ac.uk/rdss/schema/message/metadata/update_request.json/#/definitions/MetadataUpdateRequest"
	SchemaIDMetadataDeleteRequest    = "https://www.jisc.ac.uk/rdss/schema/message/metadata/delete_request.json/#/definitions/MetadataDeleteRequest"
	SchemaIDMetadataReadRequest      = "https://www.jisc.ac.uk/rdss/schema/message/metadata/read_request.json/#/definitions/MetadataReadRequest"
	SchemaIDMetadataReadResponse     = "https://www.jisc.ac.uk/rdss/schema/message/metadata/read_response.json/#/definitions/MetadataReadResponse"
	SchemaIDPreservationEventRequest = "" /* 126-byte string literal not displayed */
)
View Source
const Version = "4.0.0"

Version of the RDSS API specification supported.

Variables

This section is empty.

Functions

func NewJiscValidator

func NewJiscValidator(baseURL, userAgent, specVersion string) (*jiscValidatorImpl, error)

Types

type ALIFreeToRead

type ALIFreeToRead struct {
	StartDate Timestamp `json:"startDate,omitempty"`
	EndDate   Timestamp `json:"endDate,omitempty"`
}

type Access

type Access struct {
	AccessType      AccessTypeEnum `json:"accessType"`
	AccessStatement string         `json:"accessStatement,omitempty"`
}

type AccessTypeEnum

type AccessTypeEnum int
const (
	AccessTypeEnum_open AccessTypeEnum = iota
	AccessTypeEnum_safeguarded
	AccessTypeEnum_controlled
	AccessTypeEnum_restricted
	AccessTypeEnum_closed
)

func (AccessTypeEnum) MarshalJSON

func (r AccessTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so AccessTypeEnum satisfies json.Marshaler.

func (AccessTypeEnum) String

func (t AccessTypeEnum) String() string

func (*AccessTypeEnum) UnmarshalJSON

func (r *AccessTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so AccessTypeEnum satisfies json.Unmarshaler.

type Article

type Article struct {
	ObjectUUID              *UUID                    `json:"objectUUID"`
	ObjectTitle             string                   `json:"objectTitle"`
	ObjectPersonRole        []PersonRole             `json:"objectPersonRole"`
	ObjectDescription       []ObjectDescription      `json:"objectDescription"`
	ObjectRights            Rights                   `json:"objectRights"`
	ObjectDate              []Date                   `json:"objectDate"`
	ObjectKeyword           []string                 `json:"objectKeyword,omitempty"`
	ObjectCategory          []string                 `json:"objectCategory,omitempty"`
	ObjectResourceType      ResourceTypeEnum         `json:"objectResourceType"`
	ObjectValue             ObjectValueEnum          `json:"objectValue"`
	ObjectIdentifier        []Identifier             `json:"objectIdentifier"`
	ObjectRelatedIdentifier []IdentifierRelationship `json:"objectRelatedIdentifier,omitempty"`
	ObjectOrganisationRole  []OrganisationRole       `json:"objectOrganisationRole"`
	ObjectFile              []File                   `json:"objectFile,omitempty"`
	FreeToRead              ALIFreeToRead            `json:"freeToRead,omitempty"`
	Coverage                Coverage                 `json:"coverage,omitempty"`
	Language                []string                 `json:"language"`
	ArticleProcessingCharge RIOXXTermsAPCEnum        `json:"articleProcessingCharge,omitempty"`
	PublicationVersion      PublicationVersionEnum   `json:"publicationVersion"`
	Journal                 Journal                  `json:"journal,omitempty"`
}

Article inherits from ResearchObject.

type Attributes

type Attributes struct {
	Version       string `json:"version"`
	MessageType   string `json:"messageType"`
	CorrelationID string `json:"correlationId"`
}

type Checksum

type Checksum struct {
	ChecksumUUID  *UUID            `json:"checksumUUID,omitempty"`
	ChecksumType  ChecksumTypeEnum `json:"checksumType"`
	ChecksumValue string           `json:"checksumValue"`
}

type ChecksumTypeEnum

type ChecksumTypeEnum int
const (
	ChecksumTypeEnum_md5 ChecksumTypeEnum = iota
	ChecksumTypeEnum_sha256
)

func (ChecksumTypeEnum) MarshalJSON

func (r ChecksumTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so ChecksumTypeEnum satisfies json.Marshaler.

func (ChecksumTypeEnum) String

func (t ChecksumTypeEnum) String() string

func (*ChecksumTypeEnum) UnmarshalJSON

func (r *ChecksumTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so ChecksumTypeEnum satisfies json.Unmarshaler.

type Collection

type Collection struct {
	CollectionUUID              *UUID                    `json:"collectionUUID"`
	CollectionName              string                   `json:"collectionName"`
	CollectionObject            []ResearchObject         `json:"collectionObject,omitempty"`
	CollectionKeyword           []string                 `json:"collectionKeyword,omitempty"`
	CollectionCategory          []string                 `json:"collectionCategory,omitempty"`
	CollectionDescription       []string                 `json:"collectionDescription"`
	CollectionRights            []Rights                 `json:"collectionRights"`
	CollectionIdentifier        []Identifier             `json:"collectionIdentifier,omitempty"`
	CollectionRelatedIdentifier []IdentifierRelationship `json:"collectionRelatedIdentifier,omitempty"`
	CollectionPersonRole        []PersonRole             `json:"collectionPersonRole,omitempty"`
	CollectionOrganisationRole  []OrganisationRole       `json:"collectionOrganisationRole,omitempty"`
}

type ContainerTypeEnum

type ContainerTypeEnum int
const (
	ContainerTypeEnum_zip ContainerTypeEnum = iota
	ContainerTypeEnum_none
)

func (ContainerTypeEnum) MarshalJSON

func (r ContainerTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so ContainerTypeEnum satisfies json.Marshaler.

func (ContainerTypeEnum) String

func (t ContainerTypeEnum) String() string

func (*ContainerTypeEnum) UnmarshalJSON

func (r *ContainerTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so ContainerTypeEnum satisfies json.Unmarshaler.

type Coverage

type Coverage struct {
	GeospatialCoverage    []GeospatialCoverage `json:"geospatialCoverage"`
	TemporalCoverageStart Timestamp            `json:"temporalCoverageStart"`
	TemporalCoverageEnd   Timestamp            `json:"temporalCoverageEnd"`
}

type Dataset

type Dataset struct {
	ObjectUUID              *UUID                    `json:"objectUUID"`
	ObjectTitle             string                   `json:"objectTitle"`
	ObjectPersonRole        []PersonRole             `json:"objectPersonRole"`
	ObjectDescription       []ObjectDescription      `json:"objectDescription,omitempty"`
	ObjectRights            Rights                   `json:"objectRights"`
	ObjectDate              []Date                   `json:"objectDate"`
	ObjectKeyword           []string                 `json:"objectKeyword,omitempty"`
	ObjectCategory          []string                 `json:"objectCategory,omitempty"`
	ObjectResourceType      ResourceTypeEnum         `json:"objectResourceType"`
	ObjectValue             ObjectValueEnum          `json:"objectValue"`
	ObjectIdentifier        []Identifier             `json:"objectIdentifier"`
	ObjectRelatedIdentifier []IdentifierRelationship `json:"objectRelatedIdentifier,omitempty"`
	ObjectOrganisationRole  []OrganisationRole       `json:"objectOrganisationRole"`
	ObjectFile              []File                   `json:"objectFile,omitempty"`
	Language                []string                 `json:"language,omitempty"`
	Coverage                Coverage                 `json:"coverage,omitempty"`
	Version                 string                   `json:"version,omitempty"`
}

Dataset inherits from ResearchObject.

type Date

type Date struct {
	DateValue Timestamp    `json:"dateValue"`
	DateType  DateTypeEnum `json:"dateType"`
}

type DateTypeEnum

type DateTypeEnum int
const (
	DateTypeEnum_accepted DateTypeEnum = iota
	DateTypeEnum_approved
	DateTypeEnum_available
	DateTypeEnum_awarded
	DateTypeEnum_collected
	DateTypeEnum_copyrighted
	DateTypeEnum_created
	DateTypeEnum_issued
	DateTypeEnum_modified
	DateTypeEnum_posted
	DateTypeEnum_published
)

func (DateTypeEnum) MarshalJSON

func (r DateTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so DateTypeEnum satisfies json.Marshaler.

func (DateTypeEnum) String

func (t DateTypeEnum) String() string

func (*DateTypeEnum) UnmarshalJSON

func (r *DateTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so DateTypeEnum satisfies json.Unmarshaler.

type DescriptionTypeEnum

type DescriptionTypeEnum int
const (
	DescriptionTypeEnum_abstract DescriptionTypeEnum = iota
	DescriptionTypeEnum_description
	DescriptionTypeEnum_methods
	DescriptionTypeEnum_seriesInformation
	DescriptionTypeEnum_tableOfContents
	DescriptionTypeEnum_technicalInfo
	DescriptionTypeEnum_other
)

func (DescriptionTypeEnum) MarshalJSON

func (r DescriptionTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so DescriptionTypeEnum satisfies json.Marshaler.

func (DescriptionTypeEnum) String

func (t DescriptionTypeEnum) String() string

func (*DescriptionTypeEnum) UnmarshalJSON

func (r *DescriptionTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so DescriptionTypeEnum satisfies json.Unmarshaler.

type Envelope

type Envelope struct {
	MessageHeader json.RawMessage `json:"messageHeader"`
	MessageBody   json.RawMessage `json:"messageBody"`
	Attributes    Attributes      `json:"-"`
}

Envelop reads messages superficially only to extract the core attributes. It enables users to look up enough information to perform validation and/or conversion while avoding other potential decoding issues that we prefer to defer.

func Open

func Open(stream []byte) (*Envelope, error)

Open returns the Envelope of a message stream.

func (*Envelope) SchemaDefinition

func (e *Envelope) SchemaDefinition() string

SchemaDefinition returns the ID of the schema definition of the message.

type File

type File struct {
	FileUUID               *UUID               `json:"fileUUID"`
	FileIdentifier         string              `json:"fileIdentifier"`
	FileName               string              `json:"fileName"`
	FileSize               int                 `json:"fileSize"`
	FileLabel              string              `json:"fileLabel,omitempty"`
	FileDateCreated        *Timestamp          `json:"fileDateCreated,omitempty"`
	FileRights             *Rights             `json:"fileRights,omitempty"`
	FileChecksum           []Checksum          `json:"fileChecksum"`
	FileFormatType         string              `json:"fileFormatType,omitempty"`
	FileCompositionLevel   string              `json:"fileCompositionLevel"`
	FileHasMimeType        bool                `json:"fileHasMimeType,omitempty"`
	FileDateModified       []Timestamp         `json:"fileDateModified"`
	FilePUID               []string            `json:"filePuid,omitempty"`
	FileUse                FileUseEnum         `json:"fileUse"`
	FilePreservationEvent  string              `json:"filePreservationEvent,omitempty"`
	FileUploadStatus       UploadStatusEnum    `json:"fileUploadStatus"`
	FileStorageStatus      StorageStatusEnum   `json:"fileStorageStatus"`
	FileLastDownload       *Timestamp          `json:"fileLastDownloaded,omitempty"`
	FileTechnicalAttribute []string            `json:"fileTechnicalAttribute,omitempty"`
	FileStorageLocation    string              `json:"fileStorageLocation"`
	FileStoragePlatform    FileStoragePlatform `json:"fileStoragePlatform"`
}

type FileStoragePlatform

type FileStoragePlatform struct {
	StoragePlatformUUID *UUID           `json:"storagePlatformUUID"`
	StoragePlatformName string          `json:"storagePlatformName"`
	StoragePlatformType StorageTypeEnum `json:"storagePlatformType"`
	StoragePlatformCost string          `json:"storagePlatformCost"`
}

type FileUseEnum

type FileUseEnum int
const (
	FileUseEnum_originalFile FileUseEnum = iota
	FileUseEnum_thumbnailImage
	FileUseEnum_extractedText
	FileUseEnum_preservationMasterFile
	FileUseEnum_intermediateFile
	FileUseEnum_serviceFile
	FileUseEnum_transcript
)

func (FileUseEnum) MarshalJSON

func (r FileUseEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so FileUseEnum satisfies json.Marshaler.

func (FileUseEnum) String

func (t FileUseEnum) String() string

func (*FileUseEnum) UnmarshalJSON

func (r *FileUseEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so FileUseEnum satisfies json.Unmarshaler.

type GeolocationPoint

type GeolocationPoint struct {
	Latitude  float64 `json:"latitude"`
	Longitude float64 `json:"longitude"`
}

type GeospatialCoverage

type GeospatialCoverage struct {
	GeolocationPoint          *GeolocationPoint  `json:"geolocationPoint,omitempty"`
	GeolocationPolygon        []GeolocationPoint `json:"geolocationPolygon,omitempty"`
	GeolocationPlace          string             `json:"geolocationPlace,omitempty"`
	CoordinateReferenceSystem string             `json:"coordinateReferenceSystem,omitempty"`
}

type Grant

type Grant struct {
	GrantUUID       *UUID            `json:"grantUUID"`
	GrantIdentifier string           `json:"grantIdentifier"`
	GrantFunder     OrganisationRole `json:"grantFunder"`
	GrantStart      Timestamp        `json:"grantStart"`
	GrantEnd        Timestamp        `json:"grantEnd"`
}

type Identifier

type Identifier struct {
	IdentifierValue string             `json:"identifierValue"`
	IdentifierType  IdentifierTypeEnum `json:"identifierType"`
}

type IdentifierRelationship

type IdentifierRelationship struct {
	Identifier   Identifier       `json:"identifier"`
	RelationType RelationTypeEnum `json:"relationType"`
}

type IdentifierTypeEnum

type IdentifierTypeEnum int
const (
	IdentifierTypeEnum_ARK IdentifierTypeEnum = iota
	IdentifierTypeEnum_arXiv
	IdentifierTypeEnum_bibcode
	IdentifierTypeEnum_DOI
	IdentifierTypeEnum_EAN13
	IdentifierTypeEnum_EISSN
	IdentifierTypeEnum_Handle
	IdentifierTypeEnum_ISBN
	IdentifierTypeEnum_ISSN
	IdentifierTypeEnum_ISTC
	IdentifierTypeEnum_LISSN
	IdentifierTypeEnum_LSID
	IdentifierTypeEnum_PMID
	IdentifierTypeEnum_PUID
	IdentifierTypeEnum_PURL
	IdentifierTypeEnum_SourceID
	IdentifierTypeEnum_UPC
	IdentifierTypeEnum_URL
	IdentifierTypeEnum_URN
	IdentifierTypeEnum_UUID
)

func (IdentifierTypeEnum) MarshalJSON

func (r IdentifierTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so IdentifierTypeEnum satisfies json.Marshaler.

func (IdentifierTypeEnum) String

func (t IdentifierTypeEnum) String() string

func (*IdentifierTypeEnum) UnmarshalJSON

func (r *IdentifierTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so IdentifierTypeEnum satisfies json.Unmarshaler.

type InformationPackage

type InformationPackage struct {
	ObjectUUID               *UUID              `json:"objectUUID"`
	PackageUUID              *UUID              `json:"packageUUID"`
	PackageType              *PackageTypeEnum   `json:"packageType"`
	PackageContainerType     *ContainerTypeEnum `json:"packageContainerType"`
	PackageDescription       string             `json:"packageDescription,omitempty"`
	PackagePreservationEvent PreservationEvent  `json:"packagePreservationEvent"`
}

type Journal

type Journal struct {
	ISSN          string `json:"ISSN"`
	FullTitle     string `json:"fullTitle,omitempty"`
	JournalVolume string `json:"journalVolume"`
	FirstPage     string `json:"firstPage"`
	LastPage      string `json:"lastPage"`
	JournalIssue  string `json:"journalIssue"`
}

type Licence

type Licence struct {
	LicenceName       string    `json:"licenceName,omitempty"`
	LicenceIdentifier string    `json:"licenceIdentifier"`
	LicenseStartDate  Timestamp `json:"licenseStartDate,omitempty"`
	LicenseEndDate    Timestamp `json:"licenseEndDate,omitempty"`
}

type Message

type Message struct {
	// MessageHeader carries the message headers.
	MessageHeader MessageHeader

	// MessageBody carries the message payload.
	MessageBody interface{}
}

Message represents RDSS messages.

func New

New returns a pointer to a new message with a new ID.

func (*Message) ID

func (m *Message) ID() string

func (*Message) MarshalJSON

func (m *Message) MarshalJSON() ([]byte, error)

MarshalJSON implements Marshaler.

func (Message) MetadataCreateRequest

func (m Message) MetadataCreateRequest() (*MetadataCreateRequest, error)

MetadataCreateRequest returns the body of the message.

func (Message) MetadataDeleteRequest

func (m Message) MetadataDeleteRequest() (*MetadataDeleteRequest, error)

MetadataDeleteRequest returns the body of the message.

func (Message) MetadataReadRequest

func (m Message) MetadataReadRequest() (*MetadataReadRequest, error)

MetadataReadRequest returns the body of the message.

func (Message) MetadataReadResponse

func (m Message) MetadataReadResponse() (*MetadataReadResponse, error)

MetadataReadResponse returns the body of the message.

func (Message) MetadataUpdateRequest

func (m Message) MetadataUpdateRequest() (*MetadataUpdateRequest, error)

MetadataUpdateRequest returns the body of the message.

func (Message) PreservationEventRequest

func (m Message) PreservationEventRequest() (*PreservationEventRequest, error)

PreservationEventRequest returns the body of the message.

func (*Message) TagError

func (m *Message) TagError(err error)

func (*Message) UnmarshalJSON

func (m *Message) UnmarshalJSON(data []byte) error

UnmarshalJSON implements Unmarshaler.

type MessageClassEnum

type MessageClassEnum int
const (
	MessageClassEnum_Command MessageClassEnum = iota
	MessageClassEnum_Event
	MessageClassEnum_Document
)

func (MessageClassEnum) MarshalJSON

func (r MessageClassEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so MessageClassEnum satisfies json.Marshaler.

func (MessageClassEnum) String

func (t MessageClassEnum) String() string

func (*MessageClassEnum) UnmarshalJSON

func (r *MessageClassEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so MessageClassEnum satisfies json.Unmarshaler.

type MessageHeader

type MessageHeader struct {
	ID               *UUID            `json:"messageId"`
	CorrelationID    *UUID            `json:"correlationId,omitempty"`
	MessageClass     MessageClassEnum `json:"messageClass"`
	MessageType      MessageTypeEnum  `json:"messageType"`
	ReturnAddress    string           `json:"returnAddress,omitempty"`
	MessageTimings   MessageTimings   `json:"messageTimings"`
	MessageSequence  MessageSequence  `json:"messageSequence"`
	MessageHistory   []MessageHistory `json:"messageHistory,omitempty"`
	Version          string           `json:"version"`
	ErrorCode        string           `json:"errorCode,omitempty"`
	ErrorDescription string           `json:"errorDescription,omitempty"`
	Generator        string           `json:"generator"`
	TenantJiscID     uint64           `json:"tenantJiscID"`
}

MessageHeader contains important metadata describing the Message itself, including the type of Message, routing information, timings, sequencing, and so forth.

type MessageHistory

type MessageHistory struct {
	MachineID      string    `json:"machineId"`
	MachineAddress string    `json:"machineAddress"`
	Timestamp      Timestamp `json:"timestamp"`
}

type MessageSequence

type MessageSequence struct {
	Sequence *UUID `json:"sequence"`
	Position int   `json:"position"`
	Total    int   `json:"total"`
}

type MessageTimings

type MessageTimings struct {
	PublishedTimestamp  Timestamp `json:"publishedTimestamp"`
	ExpirationTimestamp Timestamp `json:"expirationTimestamp,omitempty"`
}

type MessageTypeEnum

type MessageTypeEnum int
const (
	MessageTypeEnum_MetadataCreate MessageTypeEnum = iota
	MessageTypeEnum_MetadataUpdate
	MessageTypeEnum_MetadataDelete
	MessageTypeEnum_MetadataRead
	MessageTypeEnum_PreservationEvent
)

func (MessageTypeEnum) MarshalJSON

func (r MessageTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so MessageTypeEnum satisfies json.Marshaler.

func (MessageTypeEnum) String

func (t MessageTypeEnum) String() string

func (*MessageTypeEnum) UnmarshalJSON

func (r *MessageTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so MessageTypeEnum satisfies json.Unmarshaler.

type MetadataCreateRequest

type MetadataCreateRequest struct {
	ResearchObjectBase
}

MetadataCreateRequest represents the body of the message.

type MetadataDeleteRequest

type MetadataDeleteRequest struct {
	ObjectUUID *UUID `json:"objectUUID"`
}

MetadataDeleteRequest represents the body of the message.

type MetadataReadRequest

type MetadataReadRequest struct {
	ObjectUUID *UUID `json:"objectUUID"`
}

MetadataReadRequest represents the body of the message.

type MetadataReadResponse

type MetadataReadResponse struct {
	ResearchObjectBase
}

MetadataReadResponse represents the body of the message.

type MetadataUpdateRequest

type MetadataUpdateRequest struct {
	ResearchObjectBase
}

MetadataUpdateRequest represents the body of the message.

type NoOpValidatorImpl

type NoOpValidatorImpl struct{}

NoOpValidatorImpl is a no-op validator.

func NewValidator

func NewValidator() (*NoOpValidatorImpl, error)

func (*NoOpValidatorImpl) Validate

func (v *NoOpValidatorImpl) Validate(ctx context.Context, stream []byte) ([]byte, error)

type ObjectDescription

type ObjectDescription struct {
	DescriptionValue string              `json:"descriptionValue"`
	DescriptionType  DescriptionTypeEnum `json:"descriptionType"`
}

type ObjectValueEnum

type ObjectValueEnum int
const (
	ObjectValueEnum_normal ObjectValueEnum = iota
	ObjectValueEnum_high
	ObjectValueEnum_veryHigh
)

func (ObjectValueEnum) MarshalJSON

func (r ObjectValueEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so ObjectValueEnum satisfies json.Marshaler.

func (ObjectValueEnum) String

func (t ObjectValueEnum) String() string

func (*ObjectValueEnum) UnmarshalJSON

func (r *ObjectValueEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so ObjectValueEnum satisfies json.Unmarshaler.

type Organisation

type Organisation struct {
	OrganisationJiscId  int                  `json:"organisationJiscId"`
	OrganisationName    string               `json:"organisationName"`
	OrganisationType    OrganisationTypeEnum `json:"organisationType,omitempty"`
	OrganisationAddress string               `json:"organisationAddress,omitempty"`
}

type OrganisationRole

type OrganisationRole struct {
	Organisation Organisation         `json:"organisation"`
	Role         OrganisationRoleEnum `json:"role"`
}

type OrganisationRoleEnum

type OrganisationRoleEnum int
const (
	OrganisationRoleEnum_advocacy OrganisationRoleEnum = iota
	OrganisationRoleEnum_author
	OrganisationRoleEnum_awardingInstitution
	OrganisationRoleEnum_distributor
	OrganisationRoleEnum_funder
	OrganisationRoleEnum_hostingInstitution
	OrganisationRoleEnum_publisher
	OrganisationRoleEnum_registrationAgency
	OrganisationRoleEnum_registrationAuthority
	OrganisationRoleEnum_rightsHolder
	OrganisationRoleEnum_sponsor
)

func (OrganisationRoleEnum) MarshalJSON

func (r OrganisationRoleEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so OrganisationRoleEnum satisfies json.Marshaler.

func (OrganisationRoleEnum) String

func (t OrganisationRoleEnum) String() string

func (*OrganisationRoleEnum) UnmarshalJSON

func (r *OrganisationRoleEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so OrganisationRoleEnum satisfies json.Unmarshaler.

type OrganisationTypeEnum

type OrganisationTypeEnum int
const (
	OrganisationTypeEnum_billing OrganisationTypeEnum = iota
	OrganisationTypeEnum_charity
	OrganisationTypeEnum_commercial
	OrganisationTypeEnum_display
	OrganisationTypeEnum_funder
	OrganisationTypeEnum_furtherEducation
	OrganisationTypeEnum_government
	OrganisationTypeEnum_health
	OrganisationTypeEnum_heritage
	OrganisationTypeEnum_higherEducation
	OrganisationTypeEnum_other
	OrganisationTypeEnum_professionalBody
	OrganisationTypeEnum_research
	OrganisationTypeEnum_school
	OrganisationTypeEnum_skills
)

func (OrganisationTypeEnum) MarshalJSON

func (r OrganisationTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so OrganisationTypeEnum satisfies json.Marshaler.

func (OrganisationTypeEnum) String

func (t OrganisationTypeEnum) String() string

func (*OrganisationTypeEnum) UnmarshalJSON

func (r *OrganisationTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so OrganisationTypeEnum satisfies json.Unmarshaler.

type OrganisationUnit

type OrganisationUnit struct {
	OrganisationUnitUUID *UUID        `json:"organisationUnitUUID"`
	OrganisationUnitName string       `json:"organisationUnitName"`
	Organisation         Organisation `json:"organisation"`
}

type PackageTypeEnum

type PackageTypeEnum int
const (
	PackageTypeEnum_AIP PackageTypeEnum = iota
	PackageTypeEnum_DIP
	PackageTypeEnum_SIP
)

func (PackageTypeEnum) MarshalJSON

func (r PackageTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so PackageTypeEnum satisfies json.Marshaler.

func (PackageTypeEnum) String

func (t PackageTypeEnum) String() string

func (*PackageTypeEnum) UnmarshalJSON

func (r *PackageTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so PackageTypeEnum satisfies json.Unmarshaler.

type Person

type Person struct {
	PersonUUID             *UUID              `json:"personUUID"`
	PersonIdentifier       []PersonIdentifier `json:"personIdentifier"`
	PersonHonorificPrefix  string             `json:"personHonorificPrefix,omitempty"`
	PersonGivenNames       string             `json:"personGivenNames"`
	PersonFamilyNames      string             `json:"personFamilyNames"`
	PersonHonorificSuffix  string             `json:"personHonorificSuffix,omitempty"`
	PersonMail             string             `json:"personMail,omitempty"`
	PersonOrganisationUnit *OrganisationUnit  `json:"personOrganisationUnit,omitempty"`
}

type PersonIdentifier

type PersonIdentifier struct {
	PersonIdentifierValue string                   `json:"personIdentifierValue"`
	PersonIdentifierType  PersonIdentifierTypeEnum `json:"personIdentifierType"`
}

type PersonIdentifierTypeEnum

type PersonIdentifierTypeEnum int
const (
	PersonIdentifierTypeEnum_ORCID PersonIdentifierTypeEnum = iota
	PersonIdentifierTypeEnum_researcherID
)

func (PersonIdentifierTypeEnum) MarshalJSON

func (r PersonIdentifierTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so PersonIdentifierTypeEnum satisfies json.Marshaler.

func (PersonIdentifierTypeEnum) String

func (t PersonIdentifierTypeEnum) String() string

func (*PersonIdentifierTypeEnum) UnmarshalJSON

func (r *PersonIdentifierTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so PersonIdentifierTypeEnum satisfies json.Unmarshaler.

type PersonRole

type PersonRole struct {
	Person Person         `json:"person"`
	Role   PersonRoleEnum `json:"role"`
}

type PersonRoleEnum

type PersonRoleEnum int
const (
	PersonRoleEnum_administrator PersonRoleEnum = iota
	PersonRoleEnum_author
	PersonRoleEnum_contactPerson
	PersonRoleEnum_dataAnalyser
	PersonRoleEnum_dataCollector
	PersonRoleEnum_dataCreator
	PersonRoleEnum_dataManager
	PersonRoleEnum_depositingUser
	PersonRoleEnum_editor
	PersonRoleEnum_investigator
	PersonRoleEnum_other
	PersonRoleEnum_producer
	PersonRoleEnum_projectLeader
	PersonRoleEnum_projectMember
	PersonRoleEnum_publisher
	PersonRoleEnum_relatedPerson
	PersonRoleEnum_researcher
	PersonRoleEnum_researcherGroup
	PersonRoleEnum_rightsHolder
	PersonRoleEnum_sponsor
	PersonRoleEnum_supervisor
)

func (PersonRoleEnum) MarshalJSON

func (r PersonRoleEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so PersonRoleEnum satisfies json.Marshaler.

func (PersonRoleEnum) String

func (t PersonRoleEnum) String() string

func (*PersonRoleEnum) UnmarshalJSON

func (r *PersonRoleEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so PersonRoleEnum satisfies json.Unmarshaler.

type PreservationEvent

type PreservationEvent struct {
	PreservationEventValue  string                     `json:"preservationEventValue"`
	PreservationEventType   *PreservationEventTypeEnum `json:"preservationEventType"`
	PreservationEventDetail string                     `json:"preservationEventDetail,omitempty"`
}

type PreservationEventRequest

type PreservationEventRequest struct {
	InformationPackage
}

PreservationEventRequest represents the body of the message.

type PreservationEventTypeEnum

type PreservationEventTypeEnum int
const (
	PreservationEventTypeEnum_accession PreservationEventTypeEnum = iota
	PreservationEventTypeEnum_appraisal
	PreservationEventTypeEnum_capture
	PreservationEventTypeEnum_compression
	PreservationEventTypeEnum_creation
	PreservationEventTypeEnum_deaccession
	PreservationEventTypeEnum_decompression
	PreservationEventTypeEnum_decryption
	PreservationEventTypeEnum_deletion
	PreservationEventTypeEnum_digitalSignatureGeneration
	PreservationEventTypeEnum_digitalSignatureValidation
	PreservationEventTypeEnum_dissemination
	PreservationEventTypeEnum_encryption
	PreservationEventTypeEnum_filenameChange
	PreservationEventTypeEnum_fixityCheck
	PreservationEventTypeEnum_forensicFeatureAnalysis
	PreservationEventTypeEnum_formatIdentification
	PreservationEventTypeEnum_imaging
	PreservationEventTypeEnum_informationPackageCreation
	PreservationEventTypeEnum_informationPackageMerging
	PreservationEventTypeEnum_informationPackageSplitting
	PreservationEventTypeEnum_ingestion
	PreservationEventTypeEnum_ingestionEnd
	PreservationEventTypeEnum_ingestionStart
	PreservationEventTypeEnum_messageDigestCalculation
	PreservationEventTypeEnum_metadataExtraction
	PreservationEventTypeEnum_metadataModification
	PreservationEventTypeEnum_migration
	PreservationEventTypeEnum_modification
	PreservationEventTypeEnum_normalization
	PreservationEventTypeEnum_packing
	PreservationEventTypeEnum_policyAssignment
	PreservationEventTypeEnum_quarantine
	PreservationEventTypeEnum_recovery
	PreservationEventTypeEnum_redaction
	PreservationEventTypeEnum_refreshment
	PreservationEventTypeEnum_replication
	PreservationEventTypeEnum_transfer
	PreservationEventTypeEnum_unpacking
	PreservationEventTypeEnum_unquarantine
	PreservationEventTypeEnum_validation
	PreservationEventTypeEnum_virusCheck
)

func (PreservationEventTypeEnum) MarshalJSON

func (r PreservationEventTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so PreservationEventTypeEnum satisfies json.Marshaler.

func (PreservationEventTypeEnum) String

func (t PreservationEventTypeEnum) String() string

func (*PreservationEventTypeEnum) UnmarshalJSON

func (r *PreservationEventTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so PreservationEventTypeEnum satisfies json.Unmarshaler.

type Project

type Project struct {
	ProjectUUID        *UUID        `json:"projectUUID"`
	ProjectIdentifier  []Identifier `json:"projectIdentifier"`
	ProjectName        string       `json:"projectName"`
	ProjectDescription string       `json:"projectDescription"`
	ProjectCollection  []Collection `json:"projectCollection"`
	ProjectGrant       []Grant      `json:"projectGrant,omitempty"`
	ProjectStart       Timestamp    `json:"projectStart"`
	ProjectEnd         Timestamp    `json:"projectEnd"`
}

type PublicationVersionEnum

type PublicationVersionEnum int
const (
	PublicationVersionEnum_AO PublicationVersionEnum = iota
	PublicationVersionEnum_SMUR
	PublicationVersionEnum_AM
	PublicationVersionEnum_P
	PublicationVersionEnum_VoR
	PublicationVersionEnum_CVoR
	PublicationVersionEnum_EVoR
	PublicationVersionEnum_NA
)

func (PublicationVersionEnum) MarshalJSON

func (r PublicationVersionEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so PublicationVersionEnum satisfies json.Marshaler.

func (PublicationVersionEnum) String

func (t PublicationVersionEnum) String() string

func (*PublicationVersionEnum) UnmarshalJSON

func (r *PublicationVersionEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so PublicationVersionEnum satisfies json.Unmarshaler.

type RIOXXTermsAPCEnum

type RIOXXTermsAPCEnum int
const (
	RIOXXTermsAPCEnum_paid RIOXXTermsAPCEnum = iota
	RIOXXTermsAPCEnum_partiallyWaived
	RIOXXTermsAPCEnum_fullyWaived
	RIOXXTermsAPCEnum_notCharged
	RIOXXTermsAPCEnum_notRequired
	RIOXXTermsAPCEnum_unknown
)

func (RIOXXTermsAPCEnum) MarshalJSON

func (r RIOXXTermsAPCEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so RIOXXTermsAPCEnum satisfies json.Marshaler.

func (RIOXXTermsAPCEnum) String

func (t RIOXXTermsAPCEnum) String() string

func (*RIOXXTermsAPCEnum) UnmarshalJSON

func (r *RIOXXTermsAPCEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so RIOXXTermsAPCEnum satisfies json.Unmarshaler.

type RelationTypeEnum

type RelationTypeEnum int
const (
	RelationTypeEnum_basedOnData RelationTypeEnum = iota
	RelationTypeEnum_cites
	RelationTypeEnum_compiles
	RelationTypeEnum_continues
	RelationTypeEnum_documents
	RelationTypeEnum_hasComment
	RelationTypeEnum_hasMetadata
	RelationTypeEnum_hasParent
	RelationTypeEnum_hasPart
	RelationTypeEnum_hasRelatedMaterial
	RelationTypeEnum_hasReply
	RelationTypeEnum_isAIPOf
	RelationTypeEnum_isBasedOn
	RelationTypeEnum_isBasisFor
	RelationTypeEnum_isCitedBy
	RelationTypeEnum_isCommentOn
	RelationTypeEnum_isCompiledBy
	RelationTypeEnum_isContinuedBy
	RelationTypeEnum_isDerivedFrom
	RelationTypeEnum_isDocumentedBy
	RelationTypeEnum_isIdenticalTo
	RelationTypeEnum_isMetadataFor
	RelationTypeEnum_isNewVersionOf
	RelationTypeEnum_isOriginalFormOf
	RelationTypeEnum_isParentOf
	RelationTypeEnum_isPartOf
	RelationTypeEnum_isPreviousVersionOf
	RelationTypeEnum_isReferencedBy
	RelationTypeEnum_isReplyTo
	RelationTypeEnum_isRequiredBy
	RelationTypeEnum_isReviewedBy
	RelationTypeEnum_isSourceOf
	RelationTypeEnum_isSupplementedBy
	RelationTypeEnum_isSupplementTo
	RelationTypeEnum_isVariantFormOf
	RelationTypeEnum_references
	RelationTypeEnum_requires
	RelationTypeEnum_reviews
)

func (RelationTypeEnum) MarshalJSON

func (r RelationTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so RelationTypeEnum satisfies json.Marshaler.

func (RelationTypeEnum) String

func (t RelationTypeEnum) String() string

func (*RelationTypeEnum) UnmarshalJSON

func (r *RelationTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so RelationTypeEnum satisfies json.Unmarshaler.

type ResearchObject

type ResearchObject struct {
	ObjectUUID              *UUID                    `json:"objectUUID"`
	ObjectTitle             string                   `json:"objectTitle"`
	ObjectPersonRole        []PersonRole             `json:"objectPersonRole"`
	ObjectDescription       []ObjectDescription      `json:"objectDescription,omitempty"`
	ObjectRights            Rights                   `json:"objectRights"`
	ObjectDate              []Date                   `json:"objectDate"`
	ObjectKeyword           []string                 `json:"objectKeyword,omitempty"`
	ObjectCategory          []string                 `json:"objectCategory,omitempty"`
	ObjectResourceType      ResourceTypeEnum         `json:"objectResourceType"`
	ObjectValue             ObjectValueEnum          `json:"objectValue"`
	ObjectIdentifier        []Identifier             `json:"objectIdentifier"`
	ObjectRelatedIdentifier []IdentifierRelationship `json:"objectRelatedIdentifier,omitempty"`
	ObjectOrganisationRole  []OrganisationRole       `json:"objectOrganisationRole"`
	ObjectFile              []File                   `json:"objectFile,omitempty"`
}

type ResearchObjectBase

type ResearchObjectBase struct {
	*Article
	*Dataset
	*ThesisDissertation
	*ResearchObject
}

ResearchObjectBase knows how to marshal/unmarshal the different subtypes allowed, e.g. an article is also a research object. Use the InferResearchObject method when you want to access the latter.

Is there a better way to do this? E.g. ResearchObjectBase could be embedded instead.

func (ResearchObjectBase) InferResearchObject

func (m ResearchObjectBase) InferResearchObject() *ResearchObject

func (ResearchObjectBase) MarshalJSON

func (m ResearchObjectBase) MarshalJSON() ([]byte, error)

func (*ResearchObjectBase) UnmarshalJSON

func (m *ResearchObjectBase) UnmarshalJSON(data []byte) error

type ResourceTypeEnum

type ResourceTypeEnum int
const (
	ResourceTypeEnum_artDesignItem ResourceTypeEnum = iota
	ResourceTypeEnum_article
	ResourceTypeEnum_audio
	ResourceTypeEnum_book
	ResourceTypeEnum_bookSection
	ResourceTypeEnum_conferenceWorkshopItem
	ResourceTypeEnum_dataset
	ResourceTypeEnum_examPaper
	ResourceTypeEnum_image
	ResourceTypeEnum_informationPackage
	ResourceTypeEnum_learningObject
	ResourceTypeEnum_movingImage
	ResourceTypeEnum_musicComposition
	ResourceTypeEnum_other
	ResourceTypeEnum_patent
	ResourceTypeEnum_performance
	ResourceTypeEnum_preprint
	ResourceTypeEnum_report
	ResourceTypeEnum_review
	ResourceTypeEnum_showExhibition
	ResourceTypeEnum_software
	ResourceTypeEnum_text
	ResourceTypeEnum_thesisDissertation
	ResourceTypeEnum_unknown
	ResourceTypeEnum_website
	ResourceTypeEnum_workflow
)

func (ResourceTypeEnum) MarshalJSON

func (r ResourceTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so ResourceTypeEnum satisfies json.Marshaler.

func (ResourceTypeEnum) String

func (t ResourceTypeEnum) String() string

func (*ResourceTypeEnum) UnmarshalJSON

func (r *ResourceTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so ResourceTypeEnum satisfies json.Unmarshaler.

type Rights

type Rights struct {
	RightsStatement []string  `json:"rightsStatement,omitempty"`
	RightsHolder    []string  `json:"rightsHolder,omitempty"`
	Licence         []Licence `json:"licence"`
	Access          []Access  `json:"access"`
}

type StorageStatusEnum

type StorageStatusEnum int
const (
	StorageStatusEnum_online StorageStatusEnum = iota
	StorageStatusEnum_nearline
	StorageStatusEnum_offline
)

func (StorageStatusEnum) MarshalJSON

func (r StorageStatusEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so StorageStatusEnum satisfies json.Marshaler.

func (StorageStatusEnum) String

func (t StorageStatusEnum) String() string

func (*StorageStatusEnum) UnmarshalJSON

func (r *StorageStatusEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so StorageStatusEnum satisfies json.Unmarshaler.

type StorageTypeEnum

type StorageTypeEnum int
const (
	StorageTypeEnum_S3 StorageTypeEnum = iota
	StorageTypeEnum_HTTP
)

func (StorageTypeEnum) MarshalJSON

func (r StorageTypeEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so StorageTypeEnum satisfies json.Marshaler.

func (StorageTypeEnum) String

func (t StorageTypeEnum) String() string

func (*StorageTypeEnum) UnmarshalJSON

func (r *StorageTypeEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so StorageTypeEnum satisfies json.Unmarshaler.

type ThesisDissertation

type ThesisDissertation struct {
	ObjectUUID              *UUID                    `json:"objectUUID"`
	ObjectTitle             string                   `json:"objectTitle"`
	ObjectPersonRole        []PersonRole             `json:"objectPersonRole"`
	ObjectDescription       []ObjectDescription      `json:"objectDescription"`
	ObjectRights            Rights                   `json:"objectRights"`
	ObjectDate              []Date                   `json:"objectDate"`
	ObjectKeyword           []string                 `json:"objectKeyword,omitempty"`
	ObjectCategory          []string                 `json:"objectCategory,omitempty"`
	ObjectResourceType      ResourceTypeEnum         `json:"objectResourceType"`
	ObjectValue             ObjectValueEnum          `json:"objectValue"`
	ObjectIdentifier        []Identifier             `json:"objectIdentifier"`
	ObjectRelatedIdentifier []IdentifierRelationship `json:"objectRelatedIdentifier,omitempty"`
	ObjectOrganisationRole  []OrganisationRole       `json:"objectOrganisationRole"`
	ObjectFile              []File                   `json:"objectFile,omitempty"`
	Coverage                Coverage                 `json:"coverage,omitempty"`
	Language                []string                 `json:"language"`
	QualificationLevel      string                   `json:"qualificationLevel"`
	QualificationName       string                   `json:"qualificationName"`
}

ThesisDissertation inherits from ResearchObject.

type Timestamp

type Timestamp time.Time

Timestamp is similar to time.Time but implementing the formatting specifics described in the API: see https://git.io/v5obt for more details.

func (Timestamp) MarshalJSON

func (t Timestamp) MarshalJSON() ([]byte, error)

func (Timestamp) String

func (t Timestamp) String() string

func (*Timestamp) UnmarshalJSON

func (t *Timestamp) UnmarshalJSON(data []byte) error

UnmarshalJSON implements the json.Unmarshaler interface. The time is expected to be a quoted string in RFC 3339 format.

type UUID

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

func MustUUID

func MustUUID(str string) *UUID

func NewUUID

func NewUUID() *UUID

func ParseUUID

func ParseUUID(str string) (*UUID, error)

func (UUID) MarshalJSON

func (u UUID) MarshalJSON() ([]byte, error)

func (UUID) String

func (u UUID) String() string

func (*UUID) UnmarshalJSON

func (u *UUID) UnmarshalJSON(data []byte) error

type UploadStatusEnum

type UploadStatusEnum int
const (
	UploadStatusEnum_uploadStarted UploadStatusEnum = iota
	UploadStatusEnum_uploadComplete
	UploadStatusEnum_uploadAborted
)

func (UploadStatusEnum) MarshalJSON

func (r UploadStatusEnum) MarshalJSON() ([]byte, error)

MarshalJSON is generated so UploadStatusEnum satisfies json.Marshaler.

func (UploadStatusEnum) String

func (t UploadStatusEnum) String() string

func (*UploadStatusEnum) UnmarshalJSON

func (r *UploadStatusEnum) UnmarshalJSON(data []byte) error

UnmarshalJSON is generated so UploadStatusEnum satisfies json.Unmarshaler.

type ValidationError

type ValidationError struct {
	Errors []ValidationErrorDetail
}

func (ValidationError) Error

func (err ValidationError) Error() string

type ValidationErrorDetail

type ValidationErrorDetail struct {
	Message string `json:"message"`
	Path    string `json:"path"`
}

type Validator

type Validator interface {
	Validate(ctx context.Context, stream []byte) ([]byte, error)
}

Validator performs validation of incoming messages.

Implementors must look up the version of the message first and perform transformation in case of version mismatch, or validation otherwise. ValidationError may be returned to share validation issues precisely.

Jump to

Keyboard shortcuts

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