repo

package
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: 19 Imported by: 2

Documentation

Index

Constants

View Source
const FINDINGAID_URI_TEMPLATE string = "https://data.whosonfirst.org/findingaid/{id}"
View Source
const WOF_ID_PROPERTY string = "wof:id"
View Source
const WOF_REPO_PROPERTY string = "wof:repo"

Variables

This section is empty.

Functions

func NewCacheResolver added in v0.0.7

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

NewCacheResolver returns a findingaid.Resolver instance for exposing information about Who's On First repositories

func NewHTTPResolver added in v0.0.3

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

NewRepoResolver returns a findingaid.Resolver instance for exposing information about Who's On First repositories by retrieving information from an HTTP endpoint that returns JSON-encoded FindingAidResponse responses.

func NewIndexer

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

NewIndexer returns a findingaid.Indexer instance for exposing information about Who's On First repositories

Types

type CacheResolver added in v0.0.7

type CacheResolver struct {
	findingaid.Resolver
	// contains filtered or unexported fields
}

CacheResolver is a struct that implements the findingaid.Resolver interface for information about Who's On First repositories.

func (*CacheResolver) ResolveURI added in v0.0.7

func (fa *CacheResolver) ResolveURI(ctx context.Context, str_uri string) (interface{}, error)

ResolveURI will return 'repo.FindingAidResponse' for 'str_response' if it present in the finding aid.

type FindingAidResponse

type FindingAidResponse struct {
	// The unique Who's On First ID.
	ID int64 `json:"id"`
	// The name of the Who's On First repository.
	Repo string `json:"repo"`
	// The relative path for a Who's On First ID.
	URI string `json:"uri"`
}

FindingAidResonse is a struct that contains Who's On First repository information for Who's On First records.

func FindingAidResponseFromBytes added in v0.0.8

func FindingAidResponseFromBytes(ctx context.Context, body []byte) (*FindingAidResponse, error)

func FindingAidResponseFromReader

func FindingAidResponseFromReader(ctx context.Context, fh io.Reader) (*FindingAidResponse, error)

type HTTPResolver added in v0.0.3

type HTTPResolver struct {
	findingaid.Resolver
	// contains filtered or unexported fields
}

RepoResolver is a struct that implements the findingaid.Resolver interface for information about Who's On First repositories by retrieving information from an HTTP endpoint that returns JSON-encoded FindingAidResponse responses. For example, a remote server running the `application/lookupd` tool.

func (*HTTPResolver) ResolveURI added in v0.0.3

func (fa *HTTPResolver) ResolveURI(ctx context.Context, str_uri string) (interface{}, error)

ResolveURI will return 'repo.FindingAidResponse' for 'str_response' if it present in the finding aid.

type Indexer

type Indexer struct {
	findingaid.Indexer
	// contains filtered or unexported fields
}

Indexer is a struct that implements the findingaid.Indexer interface for information about Who's On First repositories.

func (*Indexer) IndexReader

func (fa *Indexer) IndexReader(ctx context.Context, fh io.Reader) error

IndexReader will index an individual Who's On First record in the finding aid.

func (*Indexer) IndexURIs

func (fa *Indexer) IndexURIs(ctx context.Context, sources ...string) error

Index will index records defined by 'sources...' in the finding aid, using the whosonfirst/go-whosonfirst-iterate package.

Jump to

Keyboard shortcuts

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