zenodo

package
v0.4.6 Latest Latest
Warning

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

Go to latest
Published: Nov 7, 2024 License: MIT Imports: 7 Imported by: 3

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Verbose int

Functions

func CreateRecord added in v0.4.6

func CreateRecord() (int64, error)

func UpdateRecord added in v0.4.6

func UpdateRecord(docId int64, mrec MetaDataRecord) error

Types

type AddResponse added in v0.1.3

type AddResponse struct {
	Created  string `json:"created"`
	Modified string `json:"modified"`
	Size     int64  `json:"size"`
	Key      string `json:"key"`
	MimeType string `json:"mimetype"`
	Checksum string `json:"checksum"`
	Owner    int    `json:"owner"`
	RecordId int64  `json:"record_id"`
	Links    Links  `json:"links"`
}

AddResponse represents output of /create API

type CreateResponse added in v0.1.3

type CreateResponse struct {
	Id        int64    `json:"id"`
	MetaData  MetaData `json:"metadata"`
	Created   string   `json:"created"`
	Modified  string   `json:"modified"`
	Owner     int      `json:"owner"`
	RecordId  int64    `json:"record_id"`
	State     string   `json:"state"`
	Submitted bool     `json:"submitted"`
	Title     string   `json:"title"`
	Links     Links    `json:"links"`
}

CreateResponse represents output of /create API

type Creator added in v0.1.3

type Creator struct {
	Name        string `json:"name"`
	Affiliation string `json:"affiliation"`
}

Creator represents creator record

type DoiRecord added in v0.4.6

type DoiRecord struct {
	Id     int64  `json:"id"`
	Doi    string `json:"doi"`
	DoiUrl string `json:"doi_url"`
	Files  []File `json:"files,omitempty"`
	Links  Links  `json:"links"`
}

DoiRecord represents doi record

func PublishRecord added in v0.4.6

func PublishRecord(docId int64) (DoiRecord, error)

type Error added in v0.1.3

type Error struct {
	Field    string
	Messages []string
}

Error represents individual zenodo error struct

type File added in v0.4.6

type File struct {
	Name string `json:"name"`
	File string `json:"file"`
}

File describes common file record

type Links struct {
	Bucket             string `json:"bucket"`
	Discard            string `json:"discard"`
	Edit               string `json:"edit"`
	Files              string `json:"files"`
	Html               string `json:"html"`
	LatestDraft        string `json:"latest_draft"`
	LasestDraftHtml    string `json:"latest_draft_html"`
	NewVersion         string `json:"newversion"`
	Publish            string `json:"publish"`
	RegisterConceptDoi string `json:"registerconceptdoi"`
	Self               string `json:"self"`
}

Links contains zenodo links

type MetaData

type MetaData struct {
	AccessRight   string        `json:"access_right"`
	PrereserveDoi PrereserveDoi `json:"prereserve_doi"`
}

MetaData represents meta-data struct

type MetaDataRecord added in v0.1.3

type MetaDataRecord struct {
	PublicationType string    `json:"publication_type"`
	UploadType      string    `json:"upload_type"`
	Description     string    `json:"description"`
	Keywords        []string  `json:"keywords"`
	Title           string    `json:"title"`
	Licences        []string  `json:"licenses,omitempty"`
	Version         string    `json:"version,omitempty"`
	Publisher       string    `json:"publisher,omitempty"`
	Contributors    []Creator `json:"contributors,omitempty"`
	Creators        []Creator `json:"creators"`
}

MetaDataRecord represents meta-data record

func (*MetaDataRecord) Validate added in v0.1.3

func (m *MetaDataRecord) Validate() error

Validate provides validation of meta data record

type PrereserveDoi

type PrereserveDoi struct {
	Doi   string `json:"doi"`
	RecId int64  `json:"recid"`
}

PrereserveDoi represents PrereserveDoi struct

type Response added in v0.1.3

type Response struct {
	Status  int
	Message string
	Error   []Error
}

Reponse represents zenodo response

Jump to

Keyboard shortcuts

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