metadata

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 5, 2026 License: MIT Imports: 8 Imported by: 0

Documentation

Overview

Package metadata fetches book metadata from Open Library.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BookMetadata

type BookMetadata struct {
	Title       string `json:"title"`
	Author      string `json:"author"`
	CoverURL    string `json:"cover_url"`
	Description string `json:"description"`
	Year        string `json:"year"`
	Series      string `json:"series"`
	SeriesPos   string `json:"series_position"`
	ISBN        string `json:"isbn"`
	PageCount   int    `json:"page_count"`
	Publisher   string `json:"publisher"`
	Language    string `json:"language"`
	OLID        string `json:"olid"`
}

BookMetadata holds enriched book information from Open Library.

type Client

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

Client fetches metadata from Open Library with in-memory caching.

func NewClient

func NewClient(httpClient *http.Client) *Client

NewClient creates a metadata client.

func (*Client) FetchMetadata

func (c *Client) FetchMetadata(title, author string) (*BookMetadata, error)

FetchMetadata looks up a book by title and author, returning enriched metadata.

func (*Client) FetchMetadataCtx

func (c *Client) FetchMetadataCtx(ctx context.Context, title, author string) (*BookMetadata, error)

FetchMetadataCtx looks up a book with a caller-provided context.

Jump to

Keyboard shortcuts

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