Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add File search endpoint #44

Open
wants to merge 17 commits into
base: main
Choose a base branch
from

Conversation

QuintenQVD0
Copy link
Contributor

@QuintenQVD0 QuintenQVD0 commented Oct 5, 2024

Changes

This PR ads an endpoint that allows you to search through files./
Closed #43

How it works

You give it a directory and a pattern to search, and it will return with a list of files (recursively) that matched that pattern.

Valid patterns:

  • txt
  • .txt
  • *.txt
  • start (if file for example is StartServer.bat)
  • server.jar (full filename)

a pattern must be at least 3 char long

all patterns are treaded case-insensitive

afbeelding

What it will return:

afbeelding

where name is the relative path + the filename

Config options

  • BlacklistedDirs: currently does work because of some panic error but for now hard-coded to:
    var blacklist = []string{"node_modules", ".wine", "appcache", "depotcache", "vendor"}
    Are the current blacklisted dir where we will not go in recursive
  • MaxRecursionDepth: this works and is the max of how deep the recursion will go (default: 8)

Performance

on a local node with a wine conan-exiles server that has almost 6 GiB of files, it takes 24ms for the request to respond (1026 files found on *** pattern)

Boy132 added a commit to pelican-dev/panel that referenced this pull request Oct 7, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Search files endpoint
1 participant