folio

package
v0.2.12 Latest Latest
Warning

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

Go to latest
Published: Oct 23, 2025 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Overview

Package folio add support for a minimal subset of the FOLIO library platform API.

Index

Constants

This section is empty.

Variables

View Source
var ErrEmptyToken = errors.New("empty token")

Functions

This section is empty.

Types

type API

type API struct {
	Base   string
	Tenant string // e.g. "de_15"
	Client Doer
	Token  string
}

API wraps a few high level operations of a small part of the FOLIO API, e.g. authentication and metadata lookups. This types carries some state, e.g. in form of the auth token obtained after authentication.

func New

func New() *API

func (*API) Authenticate

func (api *API) Authenticate(username, password string) (err error)

Authenticate retrieves a login token given username and plain password. The token is stored and used for any subsequent request.

func (*API) MetadataCollections added in v0.1.333

func (api *API) MetadataCollections(opts MetadataCollectionsOpts) (*MetadataCollectionsResponse, error)

MetadataCollections queries for collection and attachment information.

type Doer

type Doer interface {
	Do(*http.Request) (*http.Response, error)
}

Doer is implemented by HTTP clients, typically.

type FincConfigMetadataCollection added in v0.1.333

type FincConfigMetadataCollection struct {
	CollectionId string   `json:"collectionId"`
	ContentFiles []string `json:"contentFiles"`
	Description  string   `json:"description"`
	FacetLabel   string   `json:"facetLabel"`
	FreeContent  string   `json:"freeContent"`
	Id           string   `json:"id"`
	Label        string   `json:"label"`
	Lod          struct {
		Note        string `json:"note"`
		Publication string `json:"publication"`
	} `json:"lod"`
	MdSource struct {
		Id   string `json:"id"`
		Name string `json:"name"`
	} `json:"mdSource"`
	Metadata struct {
		CreatedDate string `json:"createdDate"`
		UpdatedDate string `json:"updatedDate"`
	} `json:"metadata"`
	MetadataAvailable   string   `json:"metadataAvailable"`
	PermittedFor        []string `json:"permittedFor"`
	SelectedBy          []string `json:"selectedBy"`
	SolrMegaCollections []string `json:"solrMegaCollections"`
	Tickets             []string `json:"tickets"`
	UsageRestricted     string   `json:"usageRestricted"`
}

FincConfigMetadataCollection is a single configuration entry.

type MetadataCollectionsOpts added in v0.1.333

type MetadataCollectionsOpts struct {
	CQL   string
	Limit int
}

MetadataCollectionsOpts collections options for the metadata collections API. Not complete.

type MetadataCollectionsResponse added in v0.1.333

type MetadataCollectionsResponse struct {
	FincConfigMetadataCollections []FincConfigMetadataCollection `json:"fincConfigMetadataCollections"`
	TotalRecords                  int64                          `json:"totalRecords"`
}

MetadataCollectionsResponse collects zero, one or more collection entries obtained from the API.

Jump to

Keyboard shortcuts

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