Matt Baer 8429778966 | 2 роки тому | |
---|---|---|
.github | 2 роки тому | |
examples | 2 роки тому | |
testdata | 3 роки тому | |
.drone.yml | 2 роки тому | |
.gitignore | 2 роки тому | |
LICENSE | 7 роки тому | |
Makefile | 5 роки тому | |
README.md | 2 роки тому | |
_config.yml | 5 роки тому | |
go.mod | 2 роки тому | |
go.sum | 2 роки тому | |
gopher.go | 2 роки тому | |
gopher_test.go | 2 роки тому |
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 code.as/writefreely/go-gopher
import "code.as/writefreely/go-gopher"
package main
import (
"fmt"
"code.as/writefreely/go-gopher"
)
func main() {
res, _ := gopher.Get("gopher://gopher.floodgap.com/")
bytes, _ := res.Dir.ToText()
fmt.Println(string(bytes))
}
package main
import (
"log"
"code.as/writefreely/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