Documentation
¶
Overview ¶
Package span implements common functions.
Copyright 2015 by Leipzig University Library, http://ub.uni-leipzig.de
The Finc Authors, http://finc.info
Martin Czygan, <martin.czygan@uni-leipzig.de>
This file is part of some open source application.
Some open source application is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.
Some open source application is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
You should have received a copy of the GNU General Public License along with Foobar. If not, see <http://www.gnu.org/licenses/>.
@license GPL-3.0+ <http://spdx.org/licenses/GPL-3.0+>
Index ¶
Constants ¶
const ( // KeyLengthLimit was a limit imposed by the memcached protocol, which // was used for blob storage until Q1 2017. We switched the key-value // store, so this limit is somewhat obsolete. KeyLengthLimit = 250 )
Variables ¶
var AppVersion = "dev"
AppVersion of span package. Commandline tools will show this on -v. Set at build time via: -ldflags "-X github.com/miku/span.AppVersion=..."
var ISO639BibliographicToThree = map[string]string{
"alb": "sqi",
"arm": "hye",
"baq": "eus",
"bur": "mya",
"chi": "zho",
"cze": "ces",
"dut": "nld",
"fre": "fra",
"geo": "kat",
"ger": "deu",
"gre": "ell",
"ice": "isl",
"mac": "mkd",
"mao": "mri",
"may": "msa",
"per": "fas",
"rum": "ron",
"slo": "slk",
"tib": "bod",
"wel": "cym",
}
ISO639BibliographicToThree maps 639-2 identifier of the bibliographic applications to three-letter 639-3 identifier.
var ISO639NameToThree = map[string]string{}/* 7849 elements not displayed */
ISO639NameToThree maps a language name to three letter identifier.
var ISO639NameToThreeLower = func() map[string]string { m := make(map[string]string, len(ISO639NameToThree)) for k, v := range ISO639NameToThree { m[strings.ToLower(k)] = v } return m }()
ISO639NameToThreeLower is ISO639NameToThree with lowercased keys, for case insensitive lookups.
var ISO639OneToThree = map[string]string{}/* 184 elements not displayed */
ISO639OneToThree maps 639-1 identifier (two letters) (if there is one) to a three-letter 639-3 identifier.
var Static embed.FS
Functions ¶
func DetectLang3 ¶
DetectLang3 returns the best guess 3-letter language code for a given text.
func LanguageIdentifier ¶ added in v0.1.130
LanguageIdentifier returns the three letter identifier from a variety of language name notations. Returns the empty string, if nothing matches. All data from http://www-01.sil.org/iso639-3/codes.asp.
func MustLoadAsset ¶ added in v0.3.4
MustLoadAsset decodes the JSON file at path in Static into a value of type T. Assets are compiled into the binary, so any error is a programming error and panics.
Types ¶
Directories
¶
| Path | Synopsis |
|---|---|
|
cmd
|
|
|
span
command
Command span converts, licenses and exports library metadata.
|
Command span converts, licenses and exports library metadata. |
|
Package filter implements flexible ISIL attachments with expression trees[1], serialized as JSON.
|
Package filter implements flexible ISIL attachments with expression trees[1], serialized as JSON. |
|
Package folio add support for a minimal subset of the FOLIO library platform API.
|
Package folio add support for a minimal subset of the FOLIO library platform API. |
|
formats
|
|
|
doaj
Package doaj maps DOAJ metadata to intermediate schema.
|
Package doaj maps DOAJ metadata to intermediate schema. |
|
dummy
Package dummy is just a minimal example.
|
Package dummy is just a minimal example. |
|
elsevier
TODO.
|
TODO. |
|
genderopen
Package genderopen, refs #13024.
|
Package genderopen, refs #13024. |
|
jstor
TODO.
|
TODO. |
|
Package freeze provides functions for creating and unpacking frozen filterconfig zip files.
|
Package freeze provides functions for creating and unpacking frozen filterconfig zip files. |
|
internal
|
|
|
atomicfile
Package atomicfile writes files atomically.
|
Package atomicfile writes files atomically. |
|
cli
Package cli implements span's command line: one binary, one cobra command per verb.
|
Package cli implements span's command line: one binary, one cobra command per verb. |
|
cmd/compact
Package compact implements the core of span-compact: it deduplicates NDJSON streams on a user-defined field, keeping one record per key chosen by a selectable strategy.
|
Package compact implements the core of span-compact: it deduplicates NDJSON streams on a user-defined field, keeping one record per key chosen by a selectable strategy. |
|
cmd/crossrefcmd
Package crossrefcmd holds the library code backing the span-crossref-* commands: table, fast-snapshot, fastproc, members, snapshot and sync.
|
Package crossrefcmd holds the library code backing the span-crossref-* commands: table, fast-snapshot, fastproc, members, snapshot and sync. |
|
cmd/doisniffer
Package doisniffer implements the core of span-doisniffer: it sniffs out DOI from VuFind SOLR JSON documents and optionally updates docs with a found DOI.
|
Package doisniffer implements the core of span-doisniffer: it sniffs out DOI from VuFind SOLR JSON documents and optionally updates docs with a found DOI. |
|
cmd/export
Package export implements the core of span-export: it converts intermediate schema records into various destination formats, mostly for SOLR.
|
Package export implements the core of span-export: it converts intermediate schema records into various destination formats, mostly for SOLR. |
|
cmd/folio
Package folio implements the core of span-folio: it talks to the FOLIO API to fetch metadata collections and renders them for inspection.
|
Package folio implements the core of span-folio: it talks to the FOLIO API to fetch metadata collections and renders them for inspection. |
|
cmd/freeze
Package freezecmd implements the core of span-freeze: it packages a file containing URLs along with the content of all those URLs into a zip file.
|
Package freezecmd implements the core of span-freeze: it packages a file containing URLs along with the content of all those URLs into a zip file. |
|
cmd/index
Package index implements "span index", a read-only client for the finc SOLR index.
|
Package index implements "span index", a read-only client for the finc SOLR index. |
|
cmd/localdata
Package localdata implements the core of span-local-data: it extracts a small set of fields from intermediate schema records as comma separated values — something jq can do as well, albeit a bit slower.
|
Package localdata implements the core of span-local-data: it extracts a small set of fields from intermediate schema records as comma separated values — something jq can do as well, albeit a bit slower. |
|
cmd/mailcmd
Package mailcmd composes an email message and either writes it to a writer or sends it via an injected sender.
|
Package mailcmd composes an email message and either writes it to a writer or sends it via an injected sender. |
|
cmd/oafilter
Package oafilter implements the core of span-oa-filter: it sets x.oa to true on intermediate schema records that a given KBART file (or free content list) validates.
|
Package oafilter implements the core of span-oa-filter: it sets x.oa to true on intermediate schema records that a given KBART file (or free content list) validates. |
|
cmd/redact
Package redact implements the core of span-redact: it reads intermediate schema records and sets the fulltext field to the empty string.
|
Package redact implements the core of span-redact: it reads intermediate schema records and sets the fulltext field to the empty string. |
|
cmd/reshape
Package reshape implements the core of span-import (a.k.a.
|
Package reshape implements the core of span-import (a.k.a. |
|
cmd/tag
Package tag implements the core of span-tag: it runs a configuration forest of filters over intermediate schema records to produce a stream of tagged records.
|
Package tag implements the core of span-tag: it runs a configuration forest of filters over intermediate schema records to produce a stream of tagged records. |
|
cmd/updatelabels
Package updatelabels rewrites the x.labels field of intermediate schema records from an in-memory ID→ISIL mapping.
|
Package updatelabels rewrites the x.labels field of intermediate schema records from an in-memory ID→ISIL mapping. |
|
Package licensing implements support for KBART and ISIL attachments.
|
Package licensing implements support for KBART and ISIL attachments. |
|
kbart
Package kbart implements support for KBART (Knowledge Bases And Related Tools working group, http://www.uksg.org/kbart/) holding files (http://www.uksg.org/kbart/s5/guidelines/data_format).
|
Package kbart implements support for KBART (Knowledge Bases And Related Tools working group, http://www.uksg.org/kbart/) holding files (http://www.uksg.org/kbart/s5/guidelines/data_format). |
|
Package parallel implements helpers for fast processing of line oriented inputs.
|
Package parallel implements helpers for fast processing of line oriented inputs. |
|
Package solrutil implements helpers to access a SOLR index.
|
Package solrutil implements helpers to access a SOLR index. |

