Skip to content

Commit

Permalink
Initial implementation. Only Status API call supported
Browse files Browse the repository at this point in the history
  • Loading branch information
kpumuk committed Jan 18, 2010
0 parents commit d61ecbf
Show file tree
Hide file tree
Showing 5 changed files with 418 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .gitignore
@@ -0,0 +1,4 @@
*~
*.[68]
_obj
main
14 changes: 14 additions & 0 deletions Makefile
@@ -0,0 +1,14 @@
include $(GOROOT)/src/Make.$(GOARCH)

TARG=net/sphinx
GOFILES=sphinx.go

include $(GOROOT)/src/Make.pkg

main: package
$(GC) -I_obj main.go
$(LD) -L_obj -o $@ main.$O

format:
gofmt -spaces=true -tabindent=false -tabwidth=4 -w sphinx.go
gofmt -spaces=true -tabindent=false -tabwidth=4 -w test.go
18 changes: 18 additions & 0 deletions README.markdown
@@ -0,0 +1,18 @@
# gosphinx

[Go][Go] Clients and Connectors for [Sphinx][Sphinx].

# Getting started:

To build and install gosphinx, from the root directory of the git clone:

make install

## examples

After installing gosphinx (per above), try (again from the root dir of gosphinx):

make main && ./main

[Go]: http://golang.org/
[Sphinx]: http://sphinxsearch.com/
21 changes: 21 additions & 0 deletions main.go
@@ -0,0 +1,21 @@
package main

import (
"net/sphinx"
"fmt"
)

func main() {
sphinx := sphinx.NewClient()
sphinx.SetServer("127.0.0.1", 3312)

fmt.Println("Retrieving Sphinx status")
status, err := sphinx.Status()
if err != nil {
fmt.Println("Error: ", err)
} else {
for i := 0; i < len(status); i++ {
fmt.Printf("%20s %s\n", status[i][0] + ":", status[i][1])
}
}
}

0 comments on commit d61ecbf

Please sign in to comment.