Documentation
¶
Overview ¶
Copyright 2025 National Technology and Engineering Solutions of Sandia SPDX-License-Identifier: BSD-3-Clause
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var (
DoesNotExistError = errors.New("doi does not exist")
)
Functions ¶
This section is empty.
Types ¶
type DOIOptions ¶
type DOIOptions struct {
Pretty bool // Pretty-print JSON output
Auth bool // Authoritative query (bypass cache)
Cert bool // Certified query (require authenticated response)
Callback string // JSONP callback function name
Types []string // Filter by element types
Indexes []int // Filter by element indexes
}
DOIOptions represents optional parameters for DOI resolution
type DOIResponse ¶
type DOIResponse struct {
ResponseCode int `json:"responseCode"`
Handle string `json:"handle"`
RecordElements []RecordElement `json:"values,omitempty"`
Message string `json:"message,omitempty"`
}
DOIResponse represents the JSON response from the DOI REST API
func ResolveDOI ¶
func ResolveDOI(doi string) (*DOIResponse, error)
ResolveDOI resolves a DOI and returns all record elements
func ResolveDOIByIndex ¶
func ResolveDOIByIndex(doi string, indexes ...int) (*DOIResponse, error)
ResolveDOIByIndex resolves a DOI and returns only elements at specified indexes
func ResolveDOIByType ¶
func ResolveDOIByType(doi string, types ...string) (*DOIResponse, error)
ResolveDOIByType resolves a DOI and returns only elements of specified types
func ResolveDOIWithOptions ¶
func ResolveDOIWithOptions(doi string, options DOIOptions) (*DOIResponse, error)
ResolveDOIWithOptions resolves a DOI with custom options
Click to show internal directories.
Click to hide internal directories.