This is a standards compliant Gopher library for the Go programming languageimplementing the RFC 1436 specification. The library includes both client andserver handling and examples of each.
$ go get git.mills.io/prologic/go-gopher
import "git.mills.io/prologic/go-gopher"
package mainimport ("fmt""git.mills.io/prologic/go-gopher")func main() {res, _ := gopher.Get("gopher://gopher.floodgap.com/")bytes, _ := res.Dir.ToText()fmt.Println(string(bytes))}
package mainimport ("log""git.mills.io/prologic/go-gopher")func hello(w gopher.ResponseWriter, r *gopher.Request) {w.WriteInfo("Hello World!")}func main() {gopher.HandleFunc("/hello", hello)log.Fatal(gopher.ListenAndServe("localhost:70", nil))}
Related projects:
gopherproxygopherproxy is Gopher to HTTP proxy that uses go-gopherfor all of its core functionality.
gopherclientgopherclient is a cross-platform QT/QML GUI Gopher Clientusing the gopherproxy library as its backend.
MIT