https://github.com/rsdoiel/go-gopher
https://github.com/rsdoiel/go-gopher
Last synced: about 2 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/rsdoiel/go-gopher
- Owner: rsdoiel
- License: other
- Created: 2022-09-23T23:40:17.000Z (over 2 years ago)
- Default Branch: main
- Last Pushed: 2023-09-05T19:06:15.000Z (almost 2 years ago)
- Last Synced: 2025-02-16T07:13:22.013Z (4 months ago)
- Language: Go
- Size: 4.49 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Gopher protocol library for Golang
[](https://ci.mills.io/prologic/go-gopher)
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.## Installation
```#!bash
$ go get git.mills.io/prologic/go-gopher
```## Usage
```#!go
import "git.mills.io/prologic/go-gopher"
```## Example
### Client
```#!go
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))
}
```### Server
```#!go
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
Related projects:
- [gopherproxy](https://git.mills.io/prologic/gopherproxy)
gopherproxy is Gopher to HTTP proxy that uses go-gopher
for all of its core functionality.- [gopherclient](https://git.mills.io/prologic/gopherclient)
gopherclient is a cross-platform QT/QML GUI Gopher Client
using the gopherproxy library as its backend.## License
MIT