Documentation
¶
Overview ¶
Package datacite is the library behind the datacite command line: the HTTP client, request shaping, and the typed data models for the DataCite DOI Registry API at api.datacite.org.
The DataCite REST API is open for public read-only data: no API key, no auth required. This package wraps the API with a rate-limited client that the kit operations consume.
Index ¶
- Constants
- type Client
- func (c *Client) GetDOI(ctx context.Context, id string) (*DOI, error)
- func (c *Client) ListFunders(ctx context.Context, page, size int) ([]Funder, error)
- func (c *Client) ListMembers(ctx context.Context, page, size int) ([]Member, error)
- func (c *Client) SearchDOIs(ctx context.Context, query string, page, size int) ([]DOI, int, error)
- type Config
- type DOI
- type Domain
- type Funder
- type Member
Constants ¶
const DefaultUserAgent = "datacite-cli/0.1 (tamnd87@gmail.com)"
DefaultUserAgent identifies the client to DataCite honestly.
const Host = "datacite.org"
Host is the human-facing DataCite site.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
Client is a rate-limited HTTP client for the DataCite API.
func (*Client) GetDOI ¶
GetDOI fetches a single DOI record by its identifier (e.g. "10.1234/example").
func (*Client) ListFunders ¶
ListFunders fetches a page of DataCite funders.
func (*Client) ListMembers ¶
ListMembers fetches a page of DataCite members.
type Config ¶
type Config struct {
BaseURL string
UserAgent string
Rate time.Duration
Timeout time.Duration
Retries int
}
Config holds constructor parameters for Client.
func DefaultConfig ¶
func DefaultConfig() Config
DefaultConfig returns sensible defaults for api.datacite.org.
type DOI ¶
type DOI struct {
DOI string `json:"doi" kit:"id"`
Title string `json:"title"`
Creators string `json:"creators"`
Year string `json:"year"`
Publisher string `json:"publisher"`
Type string `json:"type"`
Description string `json:"description"`
URL string `json:"url"`
}
DOI is a single DataCite DOI record.
type Domain ¶
type Domain struct{}
Domain is the DataCite driver. It carries no state; the per-run client is built by the factory Register hands kit.
func (Domain) Info ¶
func (Domain) Info() kit.DomainInfo
Info describes the scheme and the identity the single-site binary inherits.