find

package
v1.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2026 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Run

func Run(args []string) error

Types

type Config

type Config struct {
	Name     string `flag:"" desc:"File name pattern (supports * and ?)"`
	Type     string `flag:"" desc:"File type: f (regular), d (directory), l (symlink)"`
	MTime    int    `flag:"" desc:"Modified within N days"`
	Size     int64  `flag:"" desc:"File size in bytes"`
	MaxDepth int    `flag:"" desc:"Maximum directory depth"`
	Invert   bool   `flag:"" desc:"Invert match conditions"`
	Or       bool   `flag:"" desc:"OR between conditions"`
	XML      bool
	JSON     bool
	Plain    bool
	Pretty   bool
}

type FindCondition

type FindCondition struct {
	XMLName xml.Name `xml:"condition"`
	Type    string   `xml:"type,attr"`
	Value   string   `xml:"value,attr"`
}

type FindError

type FindError struct {
	XMLName xml.Name `xml:"error"`
	Code    int      `xml:"code,attr"`
	Msg     string   `xml:"msg,attr"`
	Path    string   `xml:"path,attr"`
}

type FindFile

type FindFile struct {
	XMLName      xml.Name `xml:"file"`
	Path         string   `xml:"path,attr"`
	Absolute     string   `xml:"absolute,attr"`
	Type         string   `xml:"type,attr"`
	SizeBytes    int64    `xml:"size_bytes,attr"`
	Modified     int64    `xml:"modified,attr"`
	ModifiedAgoS int64    `xml:"modified_ago_s,attr"`
	Language     string   `xml:"language,attr"`
	MIME         string   `xml:"mime,attr"`
	Depth        int      `xml:"depth,attr"`
}

type FindResult

type FindResult struct {
	XMLName      xml.Name        `xml:"find"`
	SearchRoot   string          `xml:"search_root,attr"`
	Absolute     string          `xml:"absolute,attr"`
	Conditions   []FindCondition `xml:"condition"`
	TotalMatches int             `xml:"total_matches,attr"`
	Timestamp    int64           `xml:"timestamp,attr"`
	Matches      []FindFile      `xml:"match"`
	Errors       []FindError     `xml:"error,omitempty"`
}

Jump to

Keyboard shortcuts

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