filter

package
v0.1.75 Latest Latest
Warning

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

Go to latest
Published: Mar 4, 2016 License: GPL-3.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AndFilter added in v0.1.75

type AndFilter struct {
	// contains filtered or unexported fields
}

AndFilter returns true, only if all filters return true.

func (*AndFilter) Apply added in v0.1.75

func (f *AndFilter) Apply(is finc.IntermediateSchema) bool

Apply returns false if any of the filters returns false. Short circuited.

func (*AndFilter) UnmarshalJSON added in v0.1.75

func (f *AndFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a or filter.

type AnyFilter added in v0.1.75

type AnyFilter struct{}

AnyFilter validates any record.

func (*AnyFilter) Apply added in v0.1.75

Apply will just return true.

func (*AnyFilter) UnmarshalJSON added in v0.1.75

func (f *AnyFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a ISSN filter.

type CollectionFilter

type CollectionFilter struct {
	// contains filtered or unexported fields
}

CollectionFilter validates all records matching one of the given collections.

func (*CollectionFilter) Apply

Apply filters collections.

func (*CollectionFilter) UnmarshalJSON added in v0.1.75

func (f *CollectionFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a ISSN filter.

type DOIFilter

type DOIFilter struct {
	// contains filtered or unexported fields
}

DOIFilter allows records with a given DOI. Use in conjuction with "not" to create blacklists.

func (*DOIFilter) Apply

func (f *DOIFilter) Apply(is finc.IntermediateSchema) bool

Apply filters packages.

func (*DOIFilter) UnmarshalJSON added in v0.1.75

func (f *DOIFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a filter.

type Filter

type Filter interface {
	Apply(finc.IntermediateSchema) bool
}

Filter returns go or no for a given record.

type FilterFunc added in v0.1.75

type FilterFunc func(finc.IntermediateSchema) bool

FilterFunc makes a function satisfy an interface.

func (FilterFunc) Apply added in v0.1.75

func (f FilterFunc) Apply(is finc.IntermediateSchema) bool

Apply just calls the function.

type FilterTree added in v0.1.75

type FilterTree struct {
	// contains filtered or unexported fields
}

FilterTree allows polymorphic filters.

func (*FilterTree) Apply added in v0.1.75

func (f *FilterTree) Apply(is finc.IntermediateSchema) bool

Apply just applies the root filter.

func (*FilterTree) UnmarshalJSON added in v0.1.75

func (f *FilterTree) UnmarshalJSON(p []byte) error

UnmarshalJSON will decide which filter is the top level one, by peeking into the file.

type HoldingsFilter added in v0.1.75

type HoldingsFilter struct {
	// contains filtered or unexported fields
}

HoldingsFilter filters a record against a holding file. The holding file might be in KBART, Ovid or Google format. TODO(miku): move moving wall logic under `.Covers`.

func (*HoldingsFilter) Apply added in v0.1.75

Apply tests validity against holding file. TODO(miku): holdings file indentifiers can be ISSNs, ISBNs or DOIs

func (*HoldingsFilter) UnmarshalJSON added in v0.1.75

func (f *HoldingsFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON unwraps a JSON into a HoldingsFilter.

type ISSNFilter added in v0.1.75

type ISSNFilter struct {
	// contains filtered or unexported fields
}

ISSNFilter allows records with a certain ISSN.

func (*ISSNFilter) Apply added in v0.1.75

func (f *ISSNFilter) Apply(is finc.IntermediateSchema) bool

func (*ISSNFilter) UnmarshalJSON added in v0.1.75

func (f *ISSNFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a filter.

type NotFilter added in v0.1.75

type NotFilter struct {
	// contains filtered or unexported fields
}

NotFilter inverts a filter.

func (*NotFilter) Apply added in v0.1.75

func (f *NotFilter) Apply(is finc.IntermediateSchema) bool

NotFilter inverts a filter.

func (*NotFilter) UnmarshalJSON added in v0.1.75

func (f *NotFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a or filter.

type OrFilter added in v0.1.75

type OrFilter struct {
	// contains filtered or unexported fields
}

OrFilter returns true, if there is at least one filter matching.

func (*OrFilter) Apply added in v0.1.75

func (f *OrFilter) Apply(is finc.IntermediateSchema) bool

Apply returns true, if any of the filters returns true. Short circuited.

func (*OrFilter) UnmarshalJSON added in v0.1.75

func (f *OrFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a or filter.

type PackageFilter added in v0.1.59

type PackageFilter struct {
	// contains filtered or unexported fields
}

PackageFilter allows all records of one of the given package name.

func (*PackageFilter) Apply added in v0.1.59

Apply filters packages.

func (*PackageFilter) UnmarshalJSON added in v0.1.75

func (f *PackageFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a filter.

type SourceFilter

type SourceFilter struct {
	// contains filtered or unexported fields
}

CollectionFilter allows all records of one of the given collections.

func (*SourceFilter) Apply

Apply filters source ids.

func (*SourceFilter) UnmarshalJSON added in v0.1.75

func (f *SourceFilter) UnmarshalJSON(p []byte) error

UnmarshalJSON turns a config fragment into a filter.

type Tagger added in v0.1.75

type Tagger struct {
	// contains filtered or unexported fields
}

Tagger is takes a list of tags (ISILs) and annotates and intermediate schema accroding to a number of filter, defined per label. The tagger can be loaded directly from JSON.

func (*Tagger) Tag added in v0.1.75

Tag takes an intermediate schema and returns a labeled version of that schema.

func (*Tagger) UnmarshalJSON added in v0.1.75

func (t *Tagger) UnmarshalJSON(p []byte) error

Jump to

Keyboard shortcuts

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