findingaid

package module
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2021 License: BSD-3-Clause Imports: 4 Imported by: 1

README

go-whosonfirst-findingaid

A Go language interface for building and querying finding aids of Who's On First documents.

Documentation

Documentation is incomplete.

FindingAids

Conceptually a finding aid consists of two parts:

  • An indexer which indexes (or catalogs) one or more Who's On First (WOF) records in to a cache. WOF records may be cataloged in full, truncated or otherwise manipulated according to logic implemented by the indexing or caching layers.
  • A cache of WOF records, in full or otherwise manipulated, that can resolved using a given WOF ID.

It is generally assumed that a complete catalog of WOF records will be assembled in advance of any query actions but that is not an absolute requirement. For an example of a lazy-loading catalog and query implementation, where all operations are performed at runtime, consult the documentation for the readercache chaching layer below.

There can be more than one kind of finding aid. Finding aids can implement their own internal logic for cataloging, caching and querying WOF records. A finding aid need only implement the following interface:

type FindingAid interface {
     Resolver
     Indexer
}

type Indexer interface {
	IndexURIs(context.Context, ...string) error
	IndexReader(context.Context, io.Reader) error
}

type Resolver interface {
	ResolveURI(context.Context, string) (interface{}, error)
}

Note the ambiguous return value (interface{}) for the ResolveURI method. Since it impossible to know in advance the response properties of any given finding aid it is left to developers to cast query results in to the appropriate type if necessary.

...

See also

Documentation

Overview

package findingaid provides interfaces for building and querying finding aids of Who's On First documents.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RegisterFindingAid

func RegisterFindingAid(ctx context.Context, name string, c FindingAidInitializationFunc) error

func RegisterIndexer

func RegisterIndexer(ctx context.Context, name string, c IndexerInitializationFunc) error

func RegisterResolver

func RegisterResolver(ctx context.Context, name string, c ResolverInitializationFunc) error

Types

type FindingAid

type FindingAid interface {
	Resolver
	Indexer
}

func NewFindingAid

func NewFindingAid(ctx context.Context, uri string) (FindingAid, error)

type FindingAidInitializationFunc

type FindingAidInitializationFunc func(ctx context.Context, uri string) (FindingAid, error)

type Indexer

type Indexer interface {
	IndexURIs(context.Context, ...string) error
	IndexReader(context.Context, io.Reader) error
}

func NewIndexer

func NewIndexer(ctx context.Context, uri string) (Indexer, error)

type IndexerInitializationFunc

type IndexerInitializationFunc func(ctx context.Context, uri string) (Indexer, error)

type Resolver

type Resolver interface {
	ResolveURI(context.Context, string) (interface{}, error)
}

func NewResolver

func NewResolver(ctx context.Context, uri string) (Resolver, error)

type ResolverInitializationFunc

type ResolverInitializationFunc func(ctx context.Context, uri string) (Resolver, error)

Directories

Path Synopsis
lookupd
package lookupd provides an HTTP server for returning finding aid information.
package lookupd provides an HTTP server for returning finding aid information.
cmd

Jump to

Keyboard shortcuts

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