P9
Idiomatic Go 9P2000.L client and server, extracted from gVisor for general use
Install / Use
/learn @hugelgupf/P9README
p9
p9 is a Golang 9P2000.L client and server originally written for gVisor. p9 supports Windows, BSD, and Linux on most Go-available architectures.
Server Example
For how to start a server given a p9.Attacher implementation, see
cmd/p9ufs.
For how to implement a p9.Attacher and p9.File, see as an example
staticfs, a simple static file system.
Boilerplate templates for p9.File implementations are in
templatefs.
A test suite for server-side p9.Attacher and p9.File implementations is
being built at fsimpl/test.
Client Example
import (
"log"
"net"
"github.com/hugelgupf/p9/p9"
)
func main() {
conn, err := net.Dial("tcp", "localhost:8000")
if err != nil {
log.Fatal(err)
}
// conn can be any net.Conn.
client, err := p9.NewClient(conn)
if err != nil {
log.Fatal(err)
}
// root will be a p9.File and supports all those operations.
root, err := client.Attach("/")
if err != nil {
log.Fatal(err)
}
// For example:
_, _, attrs, err := root.GetAttr(p9.AttrMaskAll)
if err != nil {
log.Fatal(err)
}
log.Printf("Attrs of /: %v", attrs)
}
Related Skills
node-connect
341.6kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
xurl
341.6kA CLI tool for making authenticated requests to the X (Twitter) API. Use this skill when you need to post tweets, reply, quote, search, read posts, manage followers, send DMs, upload media, or interact with any X API v2 endpoint.
frontend-design
84.6kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
341.6kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
