dependabot-preview[bot] e7ec35345d | il y a 2 ans | |
---|---|---|
.github | il y a 2 ans | |
examples | il y a 4 ans | |
testdata | il y a 3 ans | |
.gitignore | il y a 5 ans | |
LICENSE | il y a 7 ans | |
Makefile | il y a 5 ans | |
README.md | il y a 3 ans | |
_config.yml | il y a 5 ans | |
go.mod | il y a 3 ans | |
go.sum | il y a 3 ans | |
gopher.go | il y a 3 ans | |
gopher_test.go | il y a 3 ans |
This is a standards compliant Gopher library for the Go programming language implementing the RFC 1436 specification. The library includes both client and server handling and examples of each.
$ go get github.com/prologic/go-gopher
import "github.com/prologic/go-gopher"
package main
import (
"fmt"
"github.com/prologic/go-gopher"
)
func main() {
res, _ := gopher.Get("gopher://gopher.floodgap.com/")
bytes, _ := res.Dir.ToText()
fmt.Println(string(bytes))
}
package main
import (
"log"
"github.com/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:
gopherproxy gopherproxy is Gopher to HTTP proxy that uses go-gopher for all of its core functionality.
gopherclient gopherclient is a cross-platform QT/QML GUI Gopher Client using the gopherproxy library as its backend.
MIT