Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up

Idiomatic Go 9P2000.L client and server, extracted from gVisor for general use

License

NotificationsYou must be signed in to change notification settings

hugelgupf/p9

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

CircleCIGo Report CardGoDoc

p9 is a Golang 9P2000.L client and server originally written for gVisor. p9supports Windows, BSD, and Linux on most Go-available architectures.

Server Example

For how to start a server given ap9.Attacher implementation, seecmd/p9ufs.

For how to implement ap9.Attacher andp9.File, see as an examplestaticfs, a simple static file system.Boilerplate templates forp9.File implementations are intemplatefs.

A test suite for server-sidep9.Attacher andp9.File implementations isbeing built atfsimpl/test.

Client Example

import ("log""net""github.com/hugelgupf/p9/p9")funcmain() {conn,err:=net.Dial("tcp","localhost:8000")iferr!=nil {log.Fatal(err)  }// conn can be any net.Conn.client,err:=p9.NewClient(conn)iferr!=nil {log.Fatal(err)  }// root will be a p9.File and supports all those operations.root,err:=client.Attach("/")iferr!=nil {log.Fatal(err)  }// For example:_,_,attrs,err:=root.GetAttr(p9.AttrMaskAll)iferr!=nil {log.Fatal(err)  }log.Printf("Attrs of /: %v",attrs)}

About

Idiomatic Go 9P2000.L client and server, extracted from gVisor for general use

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages


[8]ページ先頭

©2009-2025 Movatter.jp