oabutton

package
v0.1.5 Latest Latest
Warning

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

Go to latest
Published: May 26, 2022 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PublishedVersion = "publishedVersion"
	AcceptedVerstion = "acceptedVersion"
	SubmittedVersion = "submittedVersion"
)

Variables

View Source
var ErrNotArticle = &ErrServer{
	Code:    501,
	Message: "DOI is not a journal article",
}

Functions

This section is empty.

Types

type ArchiveConditions

type ArchiveConditions struct {
	CanArchive     bool     `json:"can_archive"`
	EmbargoEnd     string   `json:"embargo_end"`
	Version        string   `json:"version"`
	Versions       []string `json:"versions"`
	Locations      []string `json:"locations"`
	License        string   `json:"licence"`
	StatementGuess string   `json:"deposit_statement"`
}

ArchiveConditions are conditions from OAB's permissions API This may change!

func (ArchiveConditions) BestLicense

func (ac ArchiveConditions) BestLicense() string

func (ArchiveConditions) ScholarSphereOK

func (ac ArchiveConditions) ScholarSphereOK() bool

type Author

type Author struct {
	Family   string `json:"family"`
	Given    string `json:"given"`
	Sequence string `json:"sequence"`
	ORCID    string
}

Author field in the citation

type Client

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

Client is an http client for calling OAB endpoit

func NewClient

func NewClient(k string) *Client

NewClient returns new OABClient

func (*Client) GetPermissions

func (c *Client) GetPermissions(doi string) ([]ArchiveConditions, error)

GetPermissionsVersion calls the permission endpoint and retirns the ArchiveCondtions object for the article version with the doi

func (*Client) GetPub

func (c *Client) GetPub(doi string) (*PubMeta, error)

GetPub returns PubMeta for doi

func (*Client) TestPermissionsAPI

func (c *Client) TestPermissionsAPI() error

TestPermissionsAPI checks whether the OAB Permissions API is working as expected.

type ErrServer

type ErrServer struct {
	Code    int
	Message string
}

func (*ErrServer) Error

func (e *ErrServer) Error() string

type PubMeta

type PubMeta struct {
	Title     string   `json:"title"`
	Author    []Author `json:"author"`
	Abstract  string   `json:"abstract"`
	Subject   []string `json:"subject"`
	Type      string   `json:"crossref_type"`
	ISSN      string   `json:"issn"`
	Keywords  []string `json:"keywords"`
	Journal   string   `json:"journal"`
	Publisher string   `json:"publisher"`
	Published string   `json:"published"`
	URL       []string `json:"url"`
}

PubMeta data

Jump to

Keyboard shortcuts

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