Documentation
¶
Overview ¶
Package config sets up defaults used by both the SF and roy tools Config options can be overridden with build flags e.g. the brew and archivematica files.
Core siegfried defaults
Index ¶
- func ChangesURL() string
- func Checkpoint(i int64) bool
- func Choices() int
- func Clear() func() private
- func Conf() string
- func Container() string
- func ContainerBase() string
- func Debug() bool
- func Details(extra ...string) string
- func Distance() int
- func DoubleUp() bool
- func Droid() string
- func DroidBase() string
- func Exclude(ids []string) []string
- func ExcludeDoubles(puids, cont []string) []string
- func Extend() []string
- func ExtendC() []string
- func Fpr() string
- func HarvestOptions() (string, time.Duration, time.Duration, *http.Transport)
- func HasExclude() bool
- func HasLimit() bool
- func Home() string
- func LOC() string
- func Limit(ids []string) []string
- func Local(base string) string
- func MIMEInfo() string
- func MIMEVersion() []string
- func Magic() []byte
- func MaxBOF() int
- func MaxEOF() int
- func Name() string
- func NoByte() bool
- func NoContainer() bool
- func NoEOF() bool
- func NoMIME() bool
- func NoName() bool
- func NoPRONOM() bool
- func NoPriority() bool
- func NoRIFF() bool
- func NoText() bool
- func NoXML() bool
- func Out() io.Writer
- func Range() int
- func Reports() string
- func SetBOF(b int) func() private
- func SetChoices(i int) func() private
- func SetConf(s string)
- func SetContainer(c string) func() private
- func SetDebug()
- func SetDetails(d string) func() private
- func SetDistance(i int) func() private
- func SetDoubleUp() func() private
- func SetDroid(d string) func() private
- func SetEOF(e int) func() private
- func SetExclude(l []string) func() private
- func SetExtend(l []string) func() private
- func SetExtendC(l []string) func() private
- func SetHarvestThrottle(d time.Duration)
- func SetHarvestTimeout(d time.Duration)
- func SetHarvestTransport(t *http.Transport)
- func SetHome(h string)
- func SetLOC(fdd string) func() private
- func SetLimit(l []string) func() private
- func SetMIMEInfo(mi string) func() private
- func SetMulti(m string) func() private
- func SetName(n string) func() private
- func SetNoByte() func() private
- func SetNoContainer() func() private
- func SetNoEOF() func() private
- func SetNoMIME() func() private
- func SetNoName() func() private
- func SetNoPRONOM() func() private
- func SetNoRIFF() func() private
- func SetNoReports() func() private
- func SetNoText() func() private
- func SetNoXML() func() private
- func SetOut(o io.Writer)
- func SetRange(i int) func() private
- func SetSignature(s string)
- func SetSlow()
- func Signature() string
- func SignatureBase() string
- func Slow() bool
- func TextMIME() string
- func TextPuid() string
- func UpdateOptions() (string, time.Duration, *http.Transport)
- func Version() [3]int
- func ZipLOC() string
- func ZipMIME() string
- func ZipPuid() string
- type Archive
- type Multi
- type Option
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func ChangesURL ¶
func ChangesURL() string
func Checkpoint ¶
Checkpoint reports the offset at which slow logging should trigger.
func Choices ¶
func Choices() int
Choices is a bytematcher setting. It controls the number of tolerable strings produced by processing signature segments. E.g. signature has two adjoining frames ("PDF") and ("1.1" OR "1.2") it can be processed into two search strings: "PDF1.1" and "PDF1.2". A low number of choices means a smaller Aho Corasick search tree and more patterns to follow-up. A large of choices means a larger Aho Corasick search tree and more signatures immediately satisfied without follow-up pattern matching.
func Clear ¶ added in v1.7.6
func Clear() func() private
Clear clears loc and mimeinfo details to avoid pollution when creating multiple identifiers in same session
func Conf ¶ added in v1.7.9
func Conf() string
Conf returns the path to the siegfried configuration file.
func Container ¶
func Container() string
Container returns the location of the DROID container signature file. If not set, infers the latest file.
func ContainerBase ¶
func ContainerBase() string
ContainerBase returns the base filename of the DROID container signature file. If not set, infers the latest file.
func Details ¶
Details returns a description of the identifier. This is auto-populated if not set directly. Extra information from signatures such as date last modified can be given to this function.
func Distance ¶
func Distance() int
Distance is a bytematcher setting. It controls the absolute widths at which segments in signatures are split. E.g. if segments are separated by a minimum of 50 and maximum of 100 bytes, the distance is 100. A short distance means a smaller Aho Corasick search tree and more patterns to follow-up. A long distance means a larger Aho Corasick search tree and more signatures immediately satisfied without follow-up pattern matching.
func DoubleUp ¶
func DoubleUp() bool
DoubleUp reports whether the doubleup flag has been set. This will cause byte signatures to be built for formats where container signatures are also provided.
func Droid ¶
func Droid() string
DROID returns the location of the DROID signature file. If not set, infers the latest file.
func DroidBase ¶
func DroidBase() string
DROID base returns the base filename of the DROID signature file. If not set, infers the latest file.
func Exclude ¶
Exclude takes a slice of puids and omits those that are also in the identifier.exclude slice.
func ExcludeDoubles ¶
ExcludeDoubles takes a slice of puids and a slice of container puids and excludes those that are in the container slice, if nodoubles is set.
func Extend ¶
func Extend() []string
Extend reports whether a set of signature extensions has been provided.
func ExtendC ¶
func ExtendC() []string
Extend reports whether a set of container signature extensions has been provided.
func Fpr ¶
func Fpr() string
Fpr reports whether sf is being run in -fpr (Archivematica format policy registry) mode.
func HarvestOptions ¶
HarvestOptions reports the PRONOM url, timeout and transport.
func HasExclude ¶
func HasExclude() bool
HasExclude reports whether an exlusion set of signatures has been provided.
func HasLimit ¶
func HasLimit() bool
HasLimit reports whether a limited set of signatures has been selected.
func Limit ¶
Limit takes a slice of puids and returns a new slice containing only those puids in the limit set.
func MIMEInfo ¶
func MIMEInfo() string
MIMEInfo returns the location of the MIMEInfo signature file.
func MIMEVersion ¶ added in v1.7.7
func MIMEVersion() []string
func Magic ¶
func Magic() []byte
Magic returns the magic string encoded at the start of a siegfried signature file.
func NoByte ¶ added in v1.7.6
func NoByte() bool
NoByte reports whether byte signatures should be omitted.
func NoContainer ¶
func NoContainer() bool
NoContainer reports whether container signatures should be omitted.
func NoEOF ¶
func NoEOF() bool
NoEOF reports whether end of file segments of signatures should be trimmed.
func NoPriority ¶
func NoPriority() bool
NoPriority reports whether priorities between signatures should be omitted.
func Range ¶
func Range() int
Range is a bytematcher setting. It controls the relative widths at which segments in signatures are split. E.g. if segments are separated by a minimum of 50 and maximum of 100 bytes, the range is 50. A small range means a smaller Aho Corasick search tree and more patterns to follow-up. A large range means a larger Aho Corasick search tree and more signatures immediately satisfied without follow-up pattern matching.
func SetBOF ¶
func SetBOF(b int) func() private
SetBOF limits the number of bytes to scan from the beginning of file.
func SetChoices ¶
func SetChoices(i int) func() private
SetDistance sets the choices variable for the bytematcher.
func SetConf ¶ added in v1.7.9
func SetConf(s string)
SetConf sets the configuration filename or filepath.
func SetContainer ¶
func SetContainer(c string) func() private
SetContainer sets the name and/or location of the DROID container signature file. I.e. can provide a full path or a filename relative to the HOME directory.
func SetDetails ¶
func SetDetails(d string) func() private
SetDetails sets the identifier's description. If not provided, this description is automatically generated based on options set.
func SetDistance ¶
func SetDistance(i int) func() private
SetDistance sets the distance variable for the bytematcher.
func SetDoubleUp ¶
func SetDoubleUp() func() private
SetDoubleUp causes byte signatures to be built for formats where container signatures are also provided.
func SetDroid ¶
func SetDroid(d string) func() private
SetDroid sets the name and/or location of the DROID signature file. I.e. can provide a full path or a filename relative to the HOME directory.
func SetEOF ¶
func SetEOF(e int) func() private
SetEOF limits the number of bytes to scan from the end of file.
func SetExclude ¶
func SetExclude(l []string) func() private
SetExclude excludes the provided signatures from those built.
func SetExtend ¶
func SetExtend(l []string) func() private
SetExtend adds extension signatures to the build.
func SetExtendC ¶
func SetExtendC(l []string) func() private
SetExtendC adds container extension signatures to the build.
func SetHarvestThrottle ¶
func SetHarvestTimeout ¶
SetHarvestTimeout sets a time limit on PRONOM harvesting.
func SetHarvestTransport ¶
SetHarvestTransport sets the PRONOM harvesting transport.
func SetHome ¶
func SetHome(h string)
SetHome sets the siegfried HOME location (e.g. /usr/home/siegfried).
func SetLimit ¶
func SetLimit(l []string) func() private
SetLimit limits the set of signatures built to the list provide.
func SetMIMEInfo ¶
func SetMIMEInfo(mi string) func() private
func SetMulti ¶
func SetMulti(m string) func() private
SetMulti defines how identifiers report multiple results.
func SetNoByte ¶ added in v1.7.6
func SetNoByte() func() private
SetNoByte will cause byte signatures to be omitted.
func SetNoContainer ¶
func SetNoContainer() func() private
SetNoContainer will cause container signatures to be omitted.
func SetNoEOF ¶
func SetNoEOF() func() private
SetNoEOF will cause end of file segments to be trimmed from signatures.
func SetNoMIME ¶
func SetNoMIME() func() private
SetNoMIME will cause MIME signatures to be omitted.
func SetNoName ¶
func SetNoName() func() private
SetNoName will cause extension signatures to be omitted.
func SetNoPRONOM ¶
func SetNoPRONOM() func() private
func SetNoRIFF ¶
func SetNoRIFF() func() private
SetNoRIFF will cause RIFF FOURCC signatures to be omitted.
func SetNoReports ¶
func SetNoReports() func() private
SetNoReports instructs roy to build from the DROID signature file alone (and not from the PRONOM reports).
func SetNoText ¶
func SetNoText() func() private
SetNoText will cause text signatures to be omitted.
func SetRange ¶
func SetRange(i int) func() private
SetRange sets the range variable for the bytematcher.
func SetSignature ¶
func SetSignature(s string)
SetSignature sets the signature filename or filepath.
func Signature ¶
func Signature() string
Signature returns the path to the siegfried signature file.
func SignatureBase ¶
func SignatureBase() string
SignatureBase returns the filename of the siegfried signature file.
func UpdateOptions ¶
UpdateOptions returns the update URL, timeout and transport for the sf -update command.
Types ¶
type Archive ¶
type Archive int
Archive is a file format capable of decompression by sf.
type Multi ¶
type Multi int
Multi defines how identifiers treat multiple results.
const ( Single Multi = iota // Return a single result. If there is more than one result with the highest score, return UNKNOWN and a warning Conclusive // Default. Return only the results with the highest score. Positive // Return any result with a strong score (or if only weak results, return all). This means a byte match, container match or XML match. Text/MIME/extension-only matches are considered weak. Comprehensive // Same as positive but also turn off the priority rules during byte matching. Exhaustive // Turn off priority rules during byte matching and return all weak as well as strong results. )