datacite

package
v2.0.9 Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	Data *APIDOIData `json:"data"`
}

type APIDOIData

type APIDOIData struct {
	Id   string `json:"id,omitempty"`
	Type string `json:"type"`

	Attributes APIDOIDataAttributes `json:"attributes"`
}

type APIDOIDataAttributes

type APIDOIDataAttributes struct {
	XMLName           xml.Name `xml:"http://datacite.org/schema/kernel-4 resource" json:"-"`
	XsiType           string   `xml:"xmlns:xsi,attr" json:"-"`
	XsiSchemaLocation string   `xml:"xsi:schemaLocation,attr" json:"-"`

	DOI                string                      `json:"doi,omitempty"`
	Prefix             string                      `json:"prefix,omitempty"`
	Suffix             string                      `json:"suffix,omitempty"`
	Event              string                      `json:"event,omitempty"` // Can be set to trigger a DOI state change.
	Identifiers        []dataciteModel.Identifier  `json:"identifiers,omitempty"`
	Creators           []dataciteModel.Creator     `json:"creators,omitempty"`
	Titles             []dataciteModel.Title       `json:"titles,omitempty"`
	Publisher          string                      `json:"publisher,omitempty"`
	Container          interface{}                 `json:"container,omitempty"`
	PublicationYear    int64                       `json:"publicationYear,omitempty"`
	Subjects           interface{}                 `json:"subjects,omitempty"`
	Contributors       []dataciteModel.Contributor `json:"contributors,omitempty"`
	Dates              []interface{}               `json:"dates,omitempty"`
	Language           string                      `json:"language,omitempty"`
	Types              map[string]string           `json:"types,omitempty"`
	RelatedIdentifiers []interface{}               `json:"related_identifiers,omitempty"`
	Sizes              []string                    `json:"sizes,omitempty"`
	Formats            []string                    `json:"formats,omitempty"`
	Version            string                      `json:"version,omitempty"`
	RightsList         []interface{}               `json:"rightsList,omitempty"`
	Descriptions       []interface{}               `json:"descriptions,omitempty"`
	GeoLocations       []interface{}               `json:"geoLocations,omitempty"`
	FundingReferences  []interface{}               `json:"fundingReferences,omitempty"`
	Xml                Base64String                `json:"xml,omitempty"`
	Url                string                      `json:"url,omitempty"`
	ContentUrl         []string                    `json:"contentUrl,omitempty"`
	MetadataVersion    int                         `json:"metadataVersion,omitempty"`
	SchemaVersion      string                      `json:"schemaVersion,omitempty"`
	Source             string                      `json:"source,omitempty"`
	IsActive           bool                        `json:"isActive,omitempty"`
	State              string                      `json:"state,omitempty"`
	Reason             string                      `json:"reason,omitempty"`
	LandingPage        interface{}                 `json:"landingPage,omitempty"` // Data describing the landing page, used by link checking.
	Created            string                      `json:"created,omitempty"`
	Registered         string                      `json:"registered,omitempty"`
	Updated            string                      `json:"updated,omitempty"`
}

func (*APIDOIDataAttributes) InitNamespace

func (dda *APIDOIDataAttributes) InitNamespace()

type APIError

type APIError struct {
	Status string `json:"status"`
	Title  string `json:"title"`
}

type APIErrorResult

type APIErrorResult struct {
	Errors []*APIError `json:"errors"`
}

type Base64String

type Base64String string

func (*Base64String) MarshalJSON

func (base64str *Base64String) MarshalJSON() ([]byte, error)

func (*Base64String) UnmarshalJSON

func (base64str *Base64String) UnmarshalJSON(data []byte) error

type Client

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

func NewClient

func NewClient(api, user, password string, prefix string) (*Client, error)

func (*Client) CreateDOI

func (c *Client) CreateDOI(data *dataciteModel.DataCite, doiSuffix, targetUrl string, status DCEvent) (*API, error)

func (*Client) Delete

func (c *Client) Delete(doi string) (*API, error)

func (*Client) GetPrefix

func (c *Client) GetPrefix() string

func (*Client) Heartbeat

func (c *Client) Heartbeat() error

func (*Client) RetrieveDOI

func (c *Client) RetrieveDOI(doi string) (*API, error)

func (*Client) SetEvent

func (c *Client) SetEvent(doiSuffix string, event DCEvent) (*API, error)

type DCEvent

type DCEvent string
const (
	DCEventPublish  DCEvent = "publish"
	DCEventHide     DCEvent = "hide"
	DCEventDraft    DCEvent = "draft"
	DCEventRegister DCEvent = "register"
)

Jump to

Keyboard shortcuts

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