Documentation ¶
Index ¶
- Constants
- func OptionsTable() *cmdutil.Table
- type Entry
- type EntryPredicate
- type EntryPredicateAnd
- func (op *EntryPredicateAnd) Combine(p1 predicate.Predicate, p2 predicate.Predicate) predicate.Predicate
- func (op *EntryPredicateAnd) IsSatisfiedBy(v interface{}) bool
- func (op *EntryPredicateAnd) Negate() predicate.Predicate
- func (op *EntryPredicateAnd) P(e Entry) bool
- func (p1 EntryPredicateAnd) RequireSchema()
- func (p1 EntryPredicateAnd) SchemaP() EntrySchemaPredicate
- func (p1 EntryPredicateAnd) SchemaRequired() bool
- func (p1 EntryPredicateAnd) SetSchemaP(schemaP EntrySchemaPredicate)
- type EntryPredicateOr
- func (op *EntryPredicateOr) Combine(p1 predicate.Predicate, p2 predicate.Predicate) predicate.Predicate
- func (op *EntryPredicateOr) IsSatisfiedBy(v interface{}) bool
- func (op *EntryPredicateOr) Negate() predicate.Predicate
- func (op *EntryPredicateOr) P(e Entry) bool
- func (p1 EntryPredicateOr) RequireSchema()
- func (p1 EntryPredicateOr) SchemaP() EntrySchemaPredicate
- func (p1 EntryPredicateOr) SchemaRequired() bool
- func (p1 EntryPredicateOr) SetSchemaP(schemaP EntrySchemaPredicate)
- type EntryPredicateParser
- type EntrySchema
- type EntrySchemaPredicate
- type EntrySchemaPredicateParser
- type HelpOption
- type Options
Constants ¶
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" )
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 (*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 ¶
func (op *EntryPredicateAnd) Combine(p1 predicate.Predicate, p2 predicate.Predicate) predicate.Predicate
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 ¶
func (op *EntryPredicateOr) Combine(p1 predicate.Predicate, p2 predicate.Predicate) predicate.Predicate
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) 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 ¶
func Prune(s *EntrySchema, p EntrySchemaPredicate, opts Options) *EntrySchema
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
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.