https://github.com/vito-go/fsearch
Search text in files quickly(using linux grep command), especially for log searching. Directories are supported. Support local remote online registration search.
https://github.com/vito-go/fsearch
grep grep-search log logging logsearch search
Last synced: 5 months ago
JSON representation
Search text in files quickly(using linux grep command), especially for log searching. Directories are supported. Support local remote online registration search.
- Host: GitHub
- URL: https://github.com/vito-go/fsearch
- Owner: vito-go
- License: mit
- Created: 2023-08-24T12:29:53.000Z (almost 3 years ago)
- Default Branch: master
- Last Pushed: 2024-12-06T02:15:57.000Z (over 1 year ago)
- Last Synced: 2024-12-06T03:20:57.101Z (over 1 year ago)
- Topics: grep, grep-search, log, logging, logsearch, search
- Language: Go
- Homepage:
- Size: 2.34 MB
- Stars: 7
- Watchers: 1
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# fsearch
Search text in files quickly(using linux grep command), especially for log searching. Directories are supported.
Support local remote online registration search and single machine search.
## Quick Start
- Look at the example directory for more details.
### Server
- go to the release page to download the `web.zip` file
- https://github.com/vito-go/fsearch_flutter/releases/
- unzip the `web.zip` file
```go
package main
import (
"github.com/vito-go/fsearch"
"log"
"net/http"
)
// uncomment this if you want to use embed file
/*
//go:embed web
var staticEmbededFile embed.FS
*/
func main() {
authMap := map[string]*fsearch.AccountConfig{
// you can add more account here
}
// authMap can be nil if you don't need auth
server := fsearch.NewServer( "/", authMap)
log.Println("server start: 9097")
// the dir is that you download and unzip above
staticWebFile := http.Dir("web")
// you can also use embed file here, but you need to uncomment the code above and import embed
// e.g staticWebFile := http.FS(staticEmbededFile)
err:=server.StartListenAndServe(staticWebFile, ":9097")
if err != nil{
panic(err)
}
}
```
### Client
```go
package main
import (
"github.com/vito-go/fsearch"
"github.com/vito-go/fsearch/util"
)
func main() {
appName := "demoApp"
searchDir := "github.com/vito-go/fsearch" // can be any directory, especially for logs/
cli, err := fsearch.NewClient(searchDir, appName)
if err != nil {
panic(err)
}
cli.RegisterToCenter("ws://127.0.0.1:9097/wsRegister")
// write here your own code instead of select {}
select {}
}
```
## Demo
`
## TODO
- [ ] Add more search options