Go to file
Cadey Ratio 2bdce02090 fix tests 2019-06-08 21:02:10 -04:00
examples use within.website 2019-06-08 20:57:17 -04:00
testdata Migrate to Drone CI 2018-12-30 23:29:30 +10:00
.drone.yml Migrate to Drone CI 2018-12-30 23:29:30 +10:00
.gitignore Migrate to Drone CI 2018-12-30 23:29:30 +10:00
LICENSE Added LICENSE 2016-09-14 23:16:43 +10:00
Makefile Migrate to Drone CI 2018-12-30 23:29:30 +10:00
README.md use within.website 2019-06-08 20:57:17 -04:00
go.mod fix tests 2019-06-08 21:02:10 -04:00
go.sum fix tests 2019-06-08 21:02:10 -04:00
gopher.go fix tests 2019-06-08 21:02:10 -04:00
gopher_test.go fix tests 2019-06-08 21:02:10 -04:00

README.md

Gopher protocol library for Golang

Build Status CodeCov Go Report Card GoDoc Sourcegraph

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

$ go get within.website/gopher

Usage

import "within.website/gopher"

Example

Client

package main

import (
	"fmt"

	"within.website/gopher"
)

func main() {
	res, _ := gopher.Get("gopher://gopher.floodgap.com/")
	bytes, _ = res.Dir.ToText()
	fmt.Println(string(bytes))
}

Server

package main

import (
	"log"

	"within.website/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.

License

MIT