Documentation ¶
Index ¶
- Constants
- Variables
- func RegisterSpelunker(ctx context.Context, scheme string, init_func SpelunkerInitializationFunc) error
- func Schemes() []string
- type Concordance
- type CountryFilter
- type Facet
- type FacetCount
- type Faceting
- type Facets
- type Filter
- func NewCountryFilter(ctx context.Context, uri string) (Filter, error)
- func NewCountryFilterFromString(ctx context.Context, code string) (Filter, error)
- func NewIsCurrentFilter(ctx context.Context, uri string) (Filter, error)
- func NewIsCurrentFilterFromString(ctx context.Context, name string) (Filter, error)
- func NewIsDeprecatedFilter(ctx context.Context, uri string) (Filter, error)
- func NewIsDeprecatedFilterFromString(ctx context.Context, name string) (Filter, error)
- func NewPlacetypeFilter(ctx context.Context, uri string) (Filter, error)
- func NewPlacetypeFilterFromString(ctx context.Context, name string) (Filter, error)
- func NewTagFilter(ctx context.Context, uri string) (Filter, error)
- func NewTagFilterFromString(ctx context.Context, t string) (Filter, error)
- type IsCurrentFilter
- type IsDeprecatedFilter
- type Language
- type MachineTag
- type NullSpelunker
- func (s *NullSpelunker) CountDescendants(ctx context.Context, id int64) (int64, error)
- func (s *NullSpelunker) GetConcordances(ctx context.Context) (*Faceting, error)
- func (s *NullSpelunker) GetDescendants(ctx context.Context, pg_opts pagination.Options, id int64, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) GetDescendantsFaceted(ctx context.Context, id int64, filters []Filter, facets []*Facet) ([]*Faceting, error)
- func (s *NullSpelunker) GetFeatureForId(ctx context.Context, id int64, uri_args *uri.URIArgs) ([]byte, error)
- func (s *NullSpelunker) GetPlacetypes(ctx context.Context) (*Faceting, error)
- func (s *NullSpelunker) GetRecent(ctx context.Context, pg_opts pagination.Options, d time.Duration, ...) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) GetRecentFaceted(ctx context.Context, d time.Duration, filters []Filter, facets []*Facet) ([]*Faceting, error)
- func (s *NullSpelunker) GetRecordForId(ctx context.Context, id int64, uri_args *uri.URIArgs) ([]byte, error)
- func (s *NullSpelunker) GetSPRForId(ctx context.Context, id int64, uri_args *uri.URIArgs) (spr.StandardPlacesResult, error)
- func (s *NullSpelunker) GetTags(ctx context.Context) (*Faceting, error)
- func (s *NullSpelunker) HasConcordance(ctx context.Context, pg_opts pagination.Options, namespace string, ...) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) HasConcordanceFaceted(ctx context.Context, namespace string, predicate string, value any, ...) ([]*Faceting, error)
- func (s *NullSpelunker) HasPlacetype(ctx context.Context, pg_opts pagination.Options, pt *placetypes.WOFPlacetype, ...) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) HasPlacetypeFaceted(ctx context.Context, pt *placetypes.WOFPlacetype, filters []Filter, ...) ([]*Faceting, error)
- func (s *NullSpelunker) HasTag(ctx context.Context, pg_opts pagination.Options, tag string, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) HasTagFaceted(ctx context.Context, tag string, filters []Filter, facets []*Facet) ([]*Faceting, error)
- func (s *NullSpelunker) Search(ctx context.Context, pg_opts pagination.Options, q *SearchOptions, ...) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) SearchFaceted(ctx context.Context, q *SearchOptions, filters []Filter, facets []*Facet) ([]*Faceting, error)
- func (s *NullSpelunker) VisitingNullIsland(ctx context.Context, pg_opts pagination.Options, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
- func (s *NullSpelunker) VisitingNullIslandFaceted(ctx context.Context, filters []Filter, facets []*Facet) ([]*Faceting, error)
- type PlacetypeFilter
- type SearchOptions
- type Sort
- type Spelunker
- type SpelunkerInitializationFunc
- type TagFilter
Constants ¶
const COUNTRY_FILTER_SCHEME string = "country"
const IS_CURRENT_FILTER_SCHEME string = "iscurrent"
const IS_DEPRECATED_FILTER_SCHEME string = "isdeprecated"
const PLACETYPE_FILTER_SCHEME string = "placetype"
Variables ¶
var ErrNotFound = errors.New("Not found")
var ErrNotImplemented = errors.New("Not implemented")
Functions ¶
func RegisterSpelunker ¶
func RegisterSpelunker(ctx context.Context, scheme string, init_func SpelunkerInitializationFunc) error
RegisterSpelunker registers 'scheme' as a key pointing to 'init_func' in an internal lookup table used to create new `Spelunker` instances by the `NewSpelunker` method.
Types ¶
type Concordance ¶
type Concordance struct { MachineTag // contains filtered or unexported fields }
func NewConcordanceFromString ¶
func NewConcordanceFromString(str_concordance string) (*Concordance, error)
func NewConcordanceFromTriple ¶
func NewConcordanceFromTriple(namespace string, predicate string, value any) *Concordance
func (*Concordance) Namespace ¶
func (c *Concordance) Namespace() string
func (*Concordance) Predicate ¶
func (c *Concordance) Predicate() string
func (*Concordance) String ¶
func (c *Concordance) String() string
func (*Concordance) Value ¶
func (c *Concordance) Value() any
type CountryFilter ¶
type CountryFilter struct { Filter // contains filtered or unexported fields }
func (*CountryFilter) Scheme ¶
func (f *CountryFilter) Scheme() string
func (*CountryFilter) Value ¶
func (f *CountryFilter) Value() any
type FacetCount ¶
type Faceting ¶
type Faceting struct { Facet *Facet `json:"facet"` Results []*FacetCount `json:"results"` }
type Filter ¶
func NewIsDeprecatedFilter ¶
type IsCurrentFilter ¶
type IsCurrentFilter struct { Filter // contains filtered or unexported fields }
func (*IsCurrentFilter) Scheme ¶
func (f *IsCurrentFilter) Scheme() string
func (*IsCurrentFilter) Value ¶
func (f *IsCurrentFilter) Value() any
type IsDeprecatedFilter ¶
type IsDeprecatedFilter struct { Filter // contains filtered or unexported fields }
func (*IsDeprecatedFilter) Scheme ¶
func (f *IsDeprecatedFilter) Scheme() string
func (*IsDeprecatedFilter) Value ¶
func (f *IsDeprecatedFilter) Value() any
type MachineTag ¶
type NullSpelunker ¶
type NullSpelunker struct {
Spelunker
}
NullSpelunker implements the Spelunker interface but returns an `ErrNotImplemented` error for every method. The easiest way to think about NullSpelunker is that its a template for implementing the Spelunker interface for an actual working database.
func (*NullSpelunker) CountDescendants ¶
func (*NullSpelunker) GetConcordances ¶
func (s *NullSpelunker) GetConcordances(ctx context.Context) (*Faceting, error)
func (*NullSpelunker) GetDescendants ¶
func (*NullSpelunker) GetDescendantsFaceted ¶
func (*NullSpelunker) GetFeatureForId ¶
func (*NullSpelunker) GetPlacetypes ¶
func (s *NullSpelunker) GetPlacetypes(ctx context.Context) (*Faceting, error)
func (*NullSpelunker) GetRecentFaceted ¶
func (*NullSpelunker) GetRecordForId ¶
func (*NullSpelunker) GetSPRForId ¶
func (s *NullSpelunker) GetSPRForId(ctx context.Context, id int64, uri_args *uri.URIArgs) (spr.StandardPlacesResult, error)
func (*NullSpelunker) GetTags ¶
func (s *NullSpelunker) GetTags(ctx context.Context) (*Faceting, error)
func (*NullSpelunker) HasConcordance ¶
func (*NullSpelunker) HasConcordanceFaceted ¶
func (*NullSpelunker) HasPlacetype ¶
func (s *NullSpelunker) HasPlacetype(ctx context.Context, pg_opts pagination.Options, pt *placetypes.WOFPlacetype, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
func (*NullSpelunker) HasPlacetypeFaceted ¶
func (*NullSpelunker) HasTagFaceted ¶
func (*NullSpelunker) Search ¶
func (s *NullSpelunker) Search(ctx context.Context, pg_opts pagination.Options, q *SearchOptions, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
func (*NullSpelunker) SearchFaceted ¶
func (s *NullSpelunker) SearchFaceted(ctx context.Context, q *SearchOptions, filters []Filter, facets []*Facet) ([]*Faceting, error)
func (*NullSpelunker) VisitingNullIsland ¶
func (s *NullSpelunker) VisitingNullIsland(ctx context.Context, pg_opts pagination.Options, filters []Filter) (spr.StandardPlacesResults, pagination.Results, error)
func (*NullSpelunker) VisitingNullIslandFaceted ¶
type PlacetypeFilter ¶
type PlacetypeFilter struct { Filter // contains filtered or unexported fields }
func (*PlacetypeFilter) Scheme ¶
func (f *PlacetypeFilter) Scheme() string
func (*PlacetypeFilter) Value ¶
func (f *PlacetypeFilter) Value() any
type SearchOptions ¶
type SearchOptions struct {
Query string `json:"query"`
}
type Spelunker ¶
type Spelunker interface { // Retrieve properties (or more specifically the "document") for... GetRecordForId(context.Context, int64, *uri.URIArgs) ([]byte, error) GetSPRForId(context.Context, int64, *uri.URIArgs) (spr.StandardPlacesResult, error) // Retrive GeoJSON Feature for... GetFeatureForId(context.Context, int64, *uri.URIArgs) ([]byte, error) // Retrieve all the Who's On First record that are a descendant of a specific Who's On First ID. GetDescendants(context.Context, pagination.Options, int64, []Filter) (spr.StandardPlacesResults, pagination.Results, error) GetDescendantsFaceted(context.Context, int64, []Filter, []*Facet) ([]*Faceting, error) // Return the total number of Who's On First records that are a descendant of a specific Who's On First ID. CountDescendants(context.Context, int64) (int64, error) // Retrieve all the Who's On First records that match a search criteria. Search(context.Context, pagination.Options, *SearchOptions, []Filter) (spr.StandardPlacesResults, pagination.Results, error) SearchFaceted(context.Context, *SearchOptions, []Filter, []*Facet) ([]*Faceting, error) // Retrieve all the Who's On First records that have been modified with a window of time. GetRecent(context.Context, pagination.Options, time.Duration, []Filter) (spr.StandardPlacesResults, pagination.Results, error) GetRecentFaceted(context.Context, time.Duration, []Filter, []*Facet) ([]*Faceting, error) GetPlacetypes(context.Context) (*Faceting, error) HasPlacetype(context.Context, pagination.Options, *placetypes.WOFPlacetype, []Filter) (spr.StandardPlacesResults, pagination.Results, error) HasPlacetypeFaceted(context.Context, *placetypes.WOFPlacetype, []Filter, []*Facet) ([]*Faceting, error) GetConcordances(context.Context) (*Faceting, error) HasConcordance(context.Context, pagination.Options, string, string, any, []Filter) (spr.StandardPlacesResults, pagination.Results, error) HasConcordanceFaceted(context.Context, string, string, any, []Filter, []*Facet) ([]*Faceting, error) GetTags(context.Context) (*Faceting, error) HasTag(context.Context, pagination.Options, string, []Filter) (spr.StandardPlacesResults, pagination.Results, error) HasTagFaceted(context.Context, string, []Filter, []*Facet) ([]*Faceting, error) VisitingNullIsland(context.Context, pagination.Options, []Filter) (spr.StandardPlacesResults, pagination.Results, error) VisitingNullIslandFaceted(context.Context, []Filter, []*Facet) ([]*Faceting, error) }
Spelunker is an interface for writing data to multiple sources or targets.
func NewSpelunker ¶
NewSpelunker returns a new `Spelunker` instance configured by 'uri'. The value of 'uri' is parsed as a `url.URL` and its scheme is used as the key for a corresponding `SpelunkerInitializationFunc` function used to instantiate the new `Spelunker`. It is assumed that the scheme (and initialization function) have been registered by the `RegisterSpelunker` method.
type SpelunkerInitializationFunc ¶
SpelunkerInitializationFunc is a function defined by individual spelunker package and used to create an instance of that spelunker