oafilter

package
v0.2.36 Latest Latest
Warning

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

Go to latest
Published: Aug 18, 2026 License: GPL-3.0 Imports: 9 Imported by: 0

Documentation

Overview

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.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(cfg Config, r io.Reader, w io.Writer) error

Run reads intermediate schema records from r, sets x.oa according to the configured KBART filter and free content list and writes them to w.

Types

type Config

type Config struct {
	KbartFile        string
	FreeContentFile  string
	Verbose          bool
	BatchSize        int
	BatchMemoryLimit int64
	BestEffort       bool
	ExcludeSids      []string
	OpenAccessSids   []string
}

Config holds the tunables for an oa-filter run.

func DefaultConfig

func DefaultConfig() Config

DefaultConfig returns the default configuration.

type FreeContentItem

type FreeContentItem struct {
	FreeContent    string `json:"freeContent"`
	MegaCollection string `json:"mega_collection"`
	Shard          string `json:"shard"`
	Sid            string `json:"sid"`
}

FreeContentItem is a single item from the API response (2017-12-01).

type FreeContentLookup

type FreeContentLookup map[string]bool

FreeContentLookup maps a string of the form "Sid:MegaCollection" to a bool, indicating free access (true) and uncertainty or closed access (false).

Jump to

Keyboard shortcuts

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