go fist
1.0.0
Cliente Golang para interagir com o punho, um servidor de pesquisa de índice de texto completo minimalista, com foco em manter as coisas simples
go get -u github.com/sonirico/go-fist
import fistClient "github.com/sonirico/go-fist"
// ...
client , err := fistClient . NewFistClient ( "localhost" , "5575" )
if err != nil {
fmt . Println ( "Connection Error! Is Fist up and running?" )
return
}
// Obtain server version
version , _ := client . Version ()
fmt . Println ( "Server version is " + version )
// Index some data
client . Index ( "articles" , "a an the" )
client . Index ( "TODO" , "wash the car" )
client . Index ( "TODO" , "walk the dog" )
client . Index ( "podcasts" , "DSE - Daily software engineering" )
// Search for "the" keyword
documents := client . Search ( "the" )
fmt . Println ( documents ) // ["articles", "TODO"]
// Not needing articles?
client . Delete ( "the" )
documents = client . Search ( "the" )
fmt . Println ( documents ) // [] Exemplos mais detalhados podem ser encontrados sob a subpackage ./examples Example
Toda vez que uma nova versão para o servidor deve ser lançada, também será o cliente para manter um espelhamento direto e fácil de seguir
Liberado nos termos da licença do MIT. Consulte a licença para obter mais detalhes.