Getting Started
ACOR requires Go 1.25 or newer and Redis 3.0 or newer, or Valkey 7.2 or newer.
go get github.com/skyoo2003/acor/pkg/acor@v0.10.0
package main
import (
"fmt"
"github.com/skyoo2003/acor/pkg/acor"
)
func main() {
ac, err := acor.Create(&acor.AhoCorasickArgs{
Addr: "localhost:6379",
Name: "sample",
})
if err != nil {
panic(err)
}
defer ac.Close()
_, _ = ac.Add("redis")
matched, _ := ac.Find("redis-backed matching")
fmt.Println(matched)
}