Skip to content

cooper/go-wikiclient

Repository files navigation

go-wikiclient

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.

Usage

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")
}

See also

  • wikifier
  • quiki - a standalone webserver for wikifier built atop go-wikiclient

Releases

No releases published

Packages

No packages published

Languages