identifier

package
v1.6.4 Latest Latest
Warning

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

Go to latest
Published: Sep 5, 2016 License: Apache-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Filter

func Filter(ids []string, p Parseable) filtered

Filter restricts a Parseable to the supplied ids. Enables limit and exclude filters.

func Join

func Join(a, b Parseable) joint

Join two Parseables.

Types

type Base

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

A base identifier that can be embedded in other identifier

func Load

func Load(ls *persist.LoadSaver) *Base

func New

func New(p Parseable, zip string, extra ...string) *Base

func (*Base) Active

func (b *Base) Active(m core.MatcherType) bool

func (*Base) Add

func (b *Base) Add(m core.Matcher, t core.MatcherType) (core.Matcher, error)

func (*Base) Details

func (b *Base) Details() string

func (*Base) GraphP added in v1.6.4

func (b *Base) GraphP() string

func (*Base) HasSig

func (b *Base) HasSig(id string, ms ...core.MatcherType) bool

func (*Base) Hit

func (b *Base) Hit(m core.MatcherType, idx int) (bool, string)

func (*Base) IDs

func (b *Base) IDs(m core.MatcherType) []string

func (*Base) Inspect added in v1.6.3

func (b *Base) Inspect(ids ...string) string

func (*Base) Multi

func (b *Base) Multi() config.Multi

func (*Base) Name

func (b *Base) Name() string

func (*Base) NoPriority

func (b *Base) NoPriority() bool

func (*Base) Place

func (b *Base) Place(m core.MatcherType, idx int) (int, int)

func (*Base) Recognise

func (b *Base) Recognise(m core.MatcherType, idx int) (bool, string)

func (*Base) Save

func (b *Base) Save(ls *persist.LoadSaver)

func (*Base) Start

func (b *Base) Start(m core.MatcherType) int

func (*Base) String

func (b *Base) String() string

func (*Base) ZipDefault

func (b *Base) ZipDefault() bool

type Blank

type Blank struct{}

Blank parseable can be embedded within other parseables in order to include default nil implementations of the interface

func (Blank) Globs

func (b Blank) Globs() ([]string, []string)

func (Blank) IDs

func (b Blank) IDs() []string

func (Blank) Infos

func (b Blank) Infos() map[string]FormatInfo

func (Blank) MIMEs

func (b Blank) MIMEs() ([]string, []string)

func (Blank) MSCFBs

func (b Blank) MSCFBs() ([][]string, [][]frames.Signature, []string, error)

func (Blank) Priorities

func (b Blank) Priorities() priority.Map

func (Blank) RIFFs

func (b Blank) RIFFs() ([][4]byte, []string)

func (Blank) Signatures

func (b Blank) Signatures() ([]frames.Signature, []string, error)

func (Blank) Texts

func (b Blank) Texts() []string

func (Blank) XMLs

func (b Blank) XMLs() ([][2]string, []string)

func (Blank) Zips

func (b Blank) Zips() ([][]string, [][]frames.Signature, []string, error)

type FormatInfo

type FormatInfo interface {
	String() string
}

FormatInfo is Identifier-specific information to be retained for the Identifier.

type Mirror

type Mirror struct{ Parseable }

Mirror reverses the PREV wild segments within signatures as SUCC/EOF wild segments so they match at EOF as well as BOF.

func (Mirror) Signatures

func (m Mirror) Signatures() ([]frames.Signature, []string, error)

Signatures returns a signature set with corresponding IDs and weights for the bytematcher.

type Parseable

type Parseable interface {
	IDs() []string                                               // list of all IDs in identifier
	Infos() map[string]FormatInfo                                // identifier specific information
	Globs() ([]string, []string)                                 // signature set and corresponding IDs for globmatcher
	MIMEs() ([]string, []string)                                 // signature set and corresponding IDs for mimematcher
	XMLs() ([][2]string, []string)                               // signature set and corresponding IDs for xmlmatcher
	Signatures() ([]frames.Signature, []string, error)           // signature set and corresponding IDs for bytematcher
	Zips() ([][]string, [][]frames.Signature, []string, error)   // signature set and corresponding IDs for container matcher - Zip
	MSCFBs() ([][]string, [][]frames.Signature, []string, error) // signature set and corresponding IDs for container matcher - MSCFB
	RIFFs() ([][4]byte, []string)                                // signature set and corresponding IDs for riffmatcher
	Texts() []string                                             // IDs for textmatcher
	Priorities() priority.Map                                    // priority map
}

Parseable is something we can parse to derive filename, MIME, XML and byte signatures.

func ApplyConfig

func ApplyConfig(p Parseable) Parseable

Jump to

Keyboard shortcuts

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