Documentation
¶
Overview ¶
Package folio add support for a minimal subset of the FOLIO library platform API.
Index ¶
Constants ¶
This section is empty.
Variables ¶
var ErrEmptyToken = errors.New("empty token")
Functions ¶
This section is empty.
Types ¶
type API ¶
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 (*API) Authenticate ¶
Authenticate retrieves a login token given username and plain password. The token is stored and used for any subsequent request.
func (*API) FetchFile ¶ added in v0.2.13
func (api *API) FetchFile(fileId string) (io.ReadCloser, error)
FetchFile downloads a file by its ID from the finc-config files endpoint. The caller is responsible for closing the returned ReadCloser.
func (*API) MetadataCollections ¶ added in v0.1.333
func (api *API) MetadataCollections(opts MetadataCollectionsOpts) (*MetadataCollectionsResponse, error)
MetadataCollections queries for collection and attachment information.
type FilterEntry ¶ added in v0.2.13
type FilterEntry struct {
Id string `json:"id"`
Label string `json:"label"`
Type string `json:"type"` // e.g. "Whitelist", "Blacklist"
FilterFiles []FilterFile `json:"filterFiles"`
Isil string `json:"isil"`
}
FilterEntry describes a filter applied to a collection for a specific ISIL.
type FilterFile ¶ added in v0.2.13
FilterFile references a file stored in FOLIO's finc-config module.
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"`
FilteredBy []FilterEntry `json:"filteredBy"`
}
FincConfigMetadataCollection is a single configuration entry.
type MetadataCollectionsOpts ¶ added in v0.1.333
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.