verif

package
v1.6.2 Latest Latest
Warning

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

Go to latest
Published: May 18, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type MatchRecord

type MatchRecord struct {
	ID                 string
	Name               string
	Cardinality        int
	CanonicalSimple    string
	CanonicalFull      string
	Authors            []string
	Year               int
	DataSourcesNum     int
	DataSourcesDetails []vlib.DataSourceDetails
	Overload           bool
	// MatchResults contains all matches to Input.
	MatchResults []*vlib.ResultData
	// Sorted indicates if MatchResults are already sorted by their Score field.
	Sorted bool
}

MatchRecord contains information necessary for generating final verification output. Most of its fields has the same semantic meaning as `entity.Verification` fields.

type MatchSplit

type MatchSplit struct {
	// NoMatch contains failed matches.
	NoMatch []*mlib.Match

	// Virus contains matches to virus names.
	Virus []*mlib.Match

	// Canonical contains matches to canonical forms of names.
	Canonical []*mlib.Match
}

MatchSplit contains three slices of matches: no match, virus, and canonical. They correspond to 3 possible matches types.

type Verifier

type Verifier interface {

	// DataSources takes a list of data-source IDs and returns a slice of
	// data-sources that correspond to these IDs. If no ids are provided, return
	// all data-sources.
	DataSources(ids ...int) []*vlib.DataSource

	// MatchRecords function returns unsorted records corresponding to Input
	// matches.  Matches contain an input name-string, and strings that matched
	// that input.
	MatchRecords(
		ctx context.Context,
		matches []mlib.Match,
		input vlib.Input,
	) (map[string]*MatchRecord, error)

	// NameByID takes a name-string UUID with options and returns back
	// matched results or an error in case of a failure.
	NameByID(vlib.NameStringInput) (*MatchRecord, error)

	// NameStringByID takes UUID as an argument and returns back a name-string
	// that corresponds to that UUID.
	NameStringByID(string) (string, error)
}

Jump to

Keyboard shortcuts

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