types

package
v0.0.0-...-2bc12df Latest Latest
Warning

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

Go to latest
Published: Mar 18, 2021 License: Apache-2.0 Imports: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// DepthFlag is the name of the depth option's flag
	DepthFlag = "depth"
	// MindepthFlag is the name of the mindepth option's flag
	MindepthFlag = "mindepth"
	// MaxdepthFlag is the name of the maxdepth option's flag
	MaxdepthFlag = "maxdepth"
	// DaystartFlag is the name of the daystart option's flag
	DaystartFlag = "daystart"
	// FullmetaFlag is the name of the fullmeta option's flag
	FullmetaFlag = "fullmeta"
)
View Source
const DefaultMaxdepth = 1<<31 - 1

DefaultMaxdepth is the default value of the maxdepth option. It is set to the max value of a 32-bit integer.

Variables

This section is empty.

Functions

func OptionsTable

func OptionsTable() *cmdutil.Table

OptionsTable returns a table containing all of `wash find`'s available options

Types

type Entry

type Entry struct {
	apitypes.Entry
	NormalizedPath string
	SchemaKnown    bool
	Schema         *EntrySchema
}

Entry represents an Entry as interpreted by `wash find`

func NewEntry

func NewEntry(e apitypes.Entry, normalizedPath string) Entry

NewEntry constructs a new `wash find` entry

func (*Entry) SetSchema

func (e *Entry) SetSchema(s *EntrySchema)

SetSchema sets the entry's schema. Note that s == nil means the entry's schema was pruned from the stree.

type EntryPredicate

type EntryPredicate interface {
	predicate.Predicate
	P(Entry) bool
	SchemaP() EntrySchemaPredicate
	SetSchemaP(EntrySchemaPredicate)
	SchemaRequired() bool
	RequireSchema()
}

EntryPredicate represents a predicate on a Wash entry.

func ToEntryP

func ToEntryP(p func(e Entry) bool) EntryPredicate

ToEntryP converts p to an EntryPredicate object

type EntryPredicateAnd

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

EntryPredicateAnd represents an And operation on Entry predicates

func (*EntryPredicateAnd) Combine

Combine implements predicate.BinaryOp#Combine

func (*EntryPredicateAnd) IsSatisfiedBy

func (op *EntryPredicateAnd) IsSatisfiedBy(v interface{}) bool

IsSatisfiedBy returns true if v satisfies the predicate, false otherwise

func (*EntryPredicateAnd) Negate

func (op *EntryPredicateAnd) Negate() predicate.Predicate

Negate returns Not(op)

func (*EntryPredicateAnd) P

func (op *EntryPredicateAnd) P(e Entry) bool

P returns true if e satisfies the predicate, false otherwise

func (EntryPredicateAnd) RequireSchema

func (p1 EntryPredicateAnd) RequireSchema()

func (EntryPredicateAnd) SchemaP

func (p1 EntryPredicateAnd) SchemaP() EntrySchemaPredicate

func (EntryPredicateAnd) SchemaRequired

func (p1 EntryPredicateAnd) SchemaRequired() bool

func (EntryPredicateAnd) SetSchemaP

func (p1 EntryPredicateAnd) SetSchemaP(schemaP EntrySchemaPredicate)

type EntryPredicateOr

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

EntryPredicateOr represents an Or operation on Entry predicates

func (*EntryPredicateOr) Combine

Combine implements predicate.BinaryOp#Combine

func (*EntryPredicateOr) IsSatisfiedBy

func (op *EntryPredicateOr) IsSatisfiedBy(v interface{}) bool

IsSatisfiedBy returns true if v satisfies the predicate, false otherwise

func (*EntryPredicateOr) Negate

func (op *EntryPredicateOr) Negate() predicate.Predicate

Negate returns Not(op)

func (*EntryPredicateOr) P

func (op *EntryPredicateOr) P(e Entry) bool

P returns true if e satisfies the predicate, false otherwise

func (EntryPredicateOr) RequireSchema

func (p1 EntryPredicateOr) RequireSchema()

func (EntryPredicateOr) SchemaP

func (p1 EntryPredicateOr) SchemaP() EntrySchemaPredicate

func (EntryPredicateOr) SchemaRequired

func (p1 EntryPredicateOr) SchemaRequired() bool

func (EntryPredicateOr) SetSchemaP

func (p1 EntryPredicateOr) SetSchemaP(schemaP EntrySchemaPredicate)

type EntryPredicateParser

type EntryPredicateParser func(tokens []string) (EntryPredicate, []string, error)

EntryPredicateParser parses Entry predicates

func (EntryPredicateParser) Parse

func (parser EntryPredicateParser) Parse(tokens []string) (predicate.Predicate, []string, error)

Parse parses an EntryPredicate from the given input.

func (EntryPredicateParser) ToSchemaPParser

func (parser EntryPredicateParser) ToSchemaPParser() EntrySchemaPredicateParser

ToSchemaPParser converts parser to a schema predicate parser. This is mostly used by the tests

type EntrySchema

type EntrySchema = apitypes.EntrySchema

EntrySchema is a wrapper to apitypes.EntrySchema

func Prune

Prune prunes s to contain only nodes that satisfy p. It modifies s' state so it is not an idempotent operation.

type EntrySchemaPredicate

type EntrySchemaPredicate interface {
	predicate.Predicate
	P(*EntrySchema) bool
}

EntrySchemaPredicate represents a predicate on an entry's schema. Only implement this interface if your schema predicate has specialized negation semantics. See the meta primary's schema predicate for an example.

func ToEntrySchemaP

func ToEntrySchemaP(p func(*EntrySchema) bool) EntrySchemaPredicate

ToEntrySchemaP converts p to an EntrySchemaPredicate object

type EntrySchemaPredicateParser

type EntrySchemaPredicateParser func(tokens []string) (EntrySchemaPredicate, []string, error)

EntrySchemaPredicateParser parses EntrySchema predicates

func (EntrySchemaPredicateParser) Parse

func (parser EntrySchemaPredicateParser) Parse(tokens []string) (predicate.Predicate, []string, error)

Parse parses an entrySchemaPredicateFunc from the given input.

type HelpOption

type HelpOption struct {
	Requested bool
	HasValue  bool
	// Cannot use *primary.Primary here b/c doing so would introduce
	// an import cycle. Resolving that import cycle for a slightly
	// cleaner implementation is not worth the additional complexity
	// associated with introducing more fine-grained packages.
	Primary string
	Syntax  bool
}

HelpOption represents the -help option. If HasValue is set, then that means the input was "-help <primary>|syntax". In that case, only one of Primary/Syntax is set. Otherwise, the input was "-help".

See the comments in parser.parseOptions for more details on why this does not implement the Value interface.

type Options

type Options struct {
	Depth    bool
	Maxdepth int
	Mindepth uint
	Daystart bool
	Fullmeta bool
	Help     HelpOption
	// contains filtered or unexported fields
}

Options represents the find command's options.

func NewOptions

func NewOptions() Options

NewOptions creates a new Options object

func (*Options) FlagSet

func (opts *Options) FlagSet() *flag.FlagSet

FlagSet returns a flagset representing opts.

func (*Options) IsSet

func (opts *Options) IsSet(flag string) bool

IsSet returns true if the flag was set, false otherwise.

func (*Options) MarkAsSet

func (opts *Options) MarkAsSet(flag string)

MarkAsSet marks the flag as set.

Jump to

Keyboard shortcuts

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