Skip to content
This repository has been archived by the owner on Apr 17, 2018. It is now read-only.

nylar/wally

Repository files navigation

wally

wercker status godoc reference license Coverage Status

A full-text search engine built in Go.

Getting Started with Wally

Use go get to retrieve the latest version of Wally

go get -u github.com/nylar/wally

Wally's CLI can be built with go build and it will generate a binary for your machine.

cd cli/wally
go build

You can also install the compiled binary to your Go workspaces bin directory.

cd cli/wally
go install

Dependencies

There is one external dependency and serveral Go packages that Wally relies on. RethinkDB, the external dependency, can be installed from http://rethinkdb.com/ or through your favourite package manager.

Assuming you have you Go installed and configured on your system, you can grab all the Go dependencies with go get.

go get ./...

Running Wally's Tests

Wally's tests can be run with the built in go tool, to see code coverage you need to have the cover tool for go installed.

go get golang.org/x/tools/cmd/cover

Conversely, Wally's coverage reports can be seen on Coveralls. Wally is tested with continuous integration via Wercker.

Configuration

Wally depends on a YAML configuration file, a sample configuration file can be found at cli/wally/config.yaml.

database:
  host: localhost:28015
  name: wally
tables:
  document_table: documents
  index_table: indexes

To then use a configuration file in your project, you will need to do the following.

package main

import (
  "io/ioutil"
  "log"
  
  "github.com/nylar/wally"
  rdb "github.com/dancannon/gorethink"
)

var session *rdb.Session

func main() {
  var err error
  confData, err := ioutil.ReadFile("config.yml")
  if err != nil {
    log.Fatalln(err.Error())
  }

  wally.Conf, err = wally.LoadConfig(confData)
  if err != nil {
    log.Fatalln(err.Error())
  }

  session, err = rdb.Connect(rdb.ConnectOpts{
    Address:  wally.Conf.Database.Host,
    Database: wally.Conf.Database.Name,
  })
  if err != nil {
    log.Fatalln(err.Error())
  }
}

Demo

Wally demo app on GitHub.

screenshot

You can download the code for the Wally demo with the go get tool.

go get -u github.com/nylar/wally-ui

Then to run the application, use go run. You can then fire up your browser and point it to http://localhost:8008.

go run main.go

Inside this directory you will find a config file that you modify to match your environment. If port 8008 is occupied on your machine, you can modify the main() function in main.go, like so.

func main() {
  http.HandleFunc("/", handler)
  http.ListenAndServe(":8880", nil)
}

Releases

No releases published

Packages

 
 
 

Languages