osti

package
v0.6.1 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2026 License: BSD-3-Clause Imports: 12 Imported by: 0

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 (
	ErrDoesNotExist = errors.New("osti record does not exist")
)

Functions

This section is empty.

Types

type Client

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

Client represents an OSTI API client

func NewClient

func NewClient() *Client

NewClient creates a new OSTI API client

func NewClientWithTimeout

func NewClientWithTimeout(timeout time.Duration) *Client

NewClientWithTimeout creates a new OSTI API client with custom timeout

func (*Client) GetRecord

func (c *Client) GetRecord(ostiID string) (*Record, error)

GetRecord retrieves a specific OSTI record by ID

func (*Client) GetRecordsByPage

func (c *Client) GetRecordsByPage(page, perPage int) (*RecordsResponse, error)

GetRecordsByPage retrieves records with pagination

func (*Client) ListRecords

func (c *Client) ListRecords(opts *ListRecordsOptions) (*RecordsResponse, error)

ListRecords retrieves a list of OSTI records

func (*Client) SearchRecords

func (c *Client) SearchRecords(query string) (*RecordsResponse, error)

SearchRecords performs a search query and returns matching records

type ListRecordsOptions

type ListRecordsOptions struct {
	Page    int
	PerPage int
	Query   string
}

ListRecordsOptions represents options for listing records

type Record

type Record struct {
	OstiID          string   `json:"osti_id"`
	Title           string   `json:"title"`
	Authors         []string `json:"authors"`
	PublicationDate string   `json:"publication_date"`
	ConferenceInfo  string   `json:"conference_info"`
	DOI             string   `json:"doi"`
	ResearchOrg     string   `json:"research_org"`
	SponsorOrg      string   `json:"sponsor_org"`
	ContributorOrg  string   `json:"contributor_org"`
}

Record represents an OSTI record https://www.osti.gov/api/v1/docs#general-guidelines-responseformats

func (*Record) ToString

func (r *Record) ToString() string

type RecordsResponse

type RecordsResponse struct {
	Records []Record `json:"records"`
	Total   int      `json:"total"`
	Page    int      `json:"page"`
	PerPage int      `json:"per_page"`
}

RecordsResponse represents the response when fetching multiple records

Jump to

Keyboard shortcuts

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