This is a demo/toy program to test the implementation and performance of
the net/styx package, which itself is a
work in progress. If you are having trouble getting things to work, ensure
you have checked out the latest version of the aqwari.net/net/styx
package.
go build
Start jsonfs on port 5640:
./jsonfs -a localhost:5640 example.json
Using plan9port's 9pfuse utility, mount the fs:
9pfuse localhost:5640 /mnt/jsonfs
If you have a recent (2.6+) linux kernel, you can
mount using the kernel's v9fs implementation.
Unfortunately you'll need root access to do so
without modifying /etc/fstab:
sudo modprobe 9p
sudo mount -t 9p -o \
tcp,name=`whoami`,uname=`whoami`,port=5640 \
127.0.0.1 /mnt/jsonfs
Try looking around
$ ls /mnt/jsonfs
apiVersion data
$ cat /mnt/jsonfs/apiVersion
2.0
You should see output from jsonfs, such as
accepted connection from 127.0.0.1:36602
β 65535 Tversion msize=8192 version="9P2000"
β 65535 Rversion msize=8192 version="9P2000"
β 000 Tattach fid=1 afid=NOFID uname="droyo" aname=""
β 000 Rattach qid="type=128 ver=0 path=1"
β 000 Twalk fid=1 newfid=2 "apiVersion"
β 000 Rwalk wqid="type=0 ver=0 path=2"
β 000 Topen fid=2 mode=0
β 000 Ropen qid="type=0 ver=0 path=2" iounit=0
β 000 Tread fid=2 offset=0 count=8168
β 000 Rread count=3
β 000 Tread fid=2 offset=3 count=8168
β 000 Rread count=0
When using example.json, the tree hierarchy should look something like this:
$ tree /mnt/jsonfs
/mnt/jsonfs
βββ apiVersion
βββ data
βββ items
βΒ Β βββ 0
βΒ Β βββ accessControl
βΒ Β βΒ Β βββ comment
βΒ Β βΒ Β βββ commentVote
βΒ Β βΒ Β βββ embed
βΒ Β βΒ Β βββ list
βΒ Β βΒ Β βββ rate
βΒ Β βΒ Β βββ syndicate
βΒ Β βΒ Β βββ videoRespond
βΒ Β βββ aspectRatio
βΒ Β βββ category
βΒ Β βββ commentCount
βΒ Β βββ content
βΒ Β βΒ Β βββ 1
βΒ Β βΒ Β βββ 5
βΒ Β βΒ Β βββ 6
βΒ Β βββ description
βΒ Β βββ duration
βΒ Β βββ favoriteCount
βΒ Β βββ id
βΒ Β βββ player
βΒ Β βΒ Β βββ default
βΒ Β βββ rating
βΒ Β βββ ratingCount
βΒ Β βββ status
βΒ Β βΒ Β βββ reason
βΒ Β βΒ Β βββ value
βΒ Β βββ tags
βΒ Β βΒ Β βββ 0
βΒ Β βΒ Β βββ 1
βΒ Β βΒ Β βββ 2
βΒ Β βββ thumbnail
βΒ Β βΒ Β βββ default
βΒ Β βΒ Β βββ hqDefault
βΒ Β βββ title
βΒ Β βββ updated
βΒ Β βββ uploaded
βΒ Β βββ uploader
βΒ Β βββ viewCount
βββ itemsPerPage
βββ startIndex
βββ totalItems
βββ updated