Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Initial implementation. Only Status API call supported
- Loading branch information
0 parents
commit d61ecbf
Showing
5 changed files
with
418 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,4 @@ | |||
*~ | |||
*.[68] | |||
_obj | |||
main |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -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]) | |||
} | |||
} | |||
} |
Oops, something went wrong.