scholargo

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, MIT Imports: 11 Imported by: 0

README

This package provides a golang library and command line tool for depositing work to ScholarSphere. See cmd/deposit for usage example.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	BaseURL string
	Key     string
}

Client is base object for interacting with ScholarSphere API

func (*Client) DOIs

func (c *Client) DOIs() (DOIMap, error)

func (*Client) Deposit

func (c *Client) Deposit(meta *WorkMeta, depositor string, files ...string) (*DepositResponse, error)

func (*Client) NewRequest

func (c *Client) NewRequest(method string, path string, body io.Reader) (*http.Request, error)

NewRequest creates a new request to ScholarSphere API endpoint path.

type Creator

type Creator struct {
	Name  string `json:"display_name,omitempty"`
	Email string `json:"email,omitempty"`
	PSUID string `json:"psu_id,omitempty"`
	Orcid string `json:"orcid,omitempty"`
}

Creator information sent with deposi

type DOIMap

type DOIMap map[string][]string

type DepositResponse

type DepositResponse struct {
	Message string `json:"message"`
	URL     string `json:"url"`
}

DepositResponse is API response on successful deposit

type Permissions

type Permissions struct{}

type WorkMeta

type WorkMeta struct {
	// required
	WorkType      string    `json:"work_type"`
	Title         string    `json:"title"`
	Description   string    `json:"description"`
	Creators      []Creator `json:"creators"`
	Visibility    string    `json:"visibility"`
	Rights        string    `json:"rights"`
	PublishedDate string    `json:"published_date"`
	// optional
	Embargo            string   `json:"embargoed_until,omitempty"`
	Subtitle           string   `json:"subtitle,omitempty"`
	PublisherStatement string   `json:"publisher_statement,omitempty"`
	Keyword            []string `json:"keyword,omitempty"`
	Identifier         []string `json:"identifier,omitempty"`
	RelatedURL         []string `json:"related_url,omitempty"`
	Source             []string `json:"source,omitempty"`
	BasedNear          []string `json:"based_near,omitempty"`
	Language           []string `json:"language,omitempty"`
	Subject            []string `json:"subject,omitempty"`
	Publisher          []string `json:"publisher,omitempty"`
	Contributor        []string `json:"contributor,omitempty"`
}

Work metadata sent with deposit

Directories

Path Synopsis
cmd

Jump to

Keyboard shortcuts

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