This is a Go interface to the wikifier server. It is abstracted so that various types of transports can be added to communicate with the wikiserver. Currently though only UNIX sockets are supported.
package main
import (
wikiclient "github.com/cooper/go-wikiclient"
"log"
"time"
)
var tr wikiclient.Transport
var sess *wikiclient.Session
func main() {
// initialize the transport
tr = wikiclient.NewUnixTransport("/path/to/wikiserver.sock")
if err := tr.Connect(); err != nil {
log.Fatal(err)
}
// create a session
sess = &wikiclient.Session{WikiName: "mywiki", WikiPassword: "secret"}
}
func someHTTPHandlerProbably() {
// create a client, which pairs the transport and session and
// provides the high-level methods
c := wikiclient.NewClient(tr, sess, 3 * time.Second)
c.DisplayPage("some_page")
}