https://github.com/mitchellh/go-finger
Finger protocol library
https://github.com/mitchellh/go-finger
Last synced: 9 months ago
JSON representation
Finger protocol library
- Host: GitHub
- URL: https://github.com/mitchellh/go-finger
- Owner: mitchellh
- License: mit
- Created: 2017-07-09T00:13:53.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2017-07-09T00:15:01.000Z (almost 9 years ago)
- Last Synced: 2025-04-10T05:59:25.499Z (about 1 year ago)
- Language: Go
- Size: 10.7 KB
- Stars: 55
- Watchers: 4
- Forks: 2
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- License: LICENSE.md
Awesome Lists containing this project
README
# go-finger
go-finger is a [finger](https://en.wikipedia.org/wiki/Finger_protocol)
library written in Go. This contains both a client and server implementation.
The [finger protocol](https://tools.ietf.org/html/rfc1288) is an extremely
simple TCP protocol. It can be implemented without a library cleanly in only
a few dozen lines of code but a library helps ensure correctness and handles
RFC-compliant request parsing automatically.
## Example
```go
import "github.com/mitchellh/go-finger"
```
### Server
```go
go finger.Serve(finger.HandlerFunc(func(ctx context.Context, w io.Writer, q *finger.Query) {
w.Write([]byte(fmt.Sprintf("Hello %q", q.Username)))
}))
```
You can also set more detailed configurations by creating a `Server`
structure directly. The top-level `Serve` function sets reasonable defaults.