Skip to content

Latest commit

 

History

History
31 lines (25 loc) · 636 Bytes

README.md

File metadata and controls

31 lines (25 loc) · 636 Bytes

upspinfsys

fs.FS implementation for Upspin.

Go Reference

package main

import (
    "log"
    "net/http"
    
    "github.com/rschio/upspinfsys"
    "upspin.io/client"
    "upspin.io/config"
    "upspin.io/transports"
)

func main() {
    cfg, err := config.FromFile("config")
    if err != nil {
        log.Fatal(err)
    }
    transports.Init(cfg)
    c := client.New(cfg)
    
    fsys := upspinfsys.UpspinFS(c)
    http.Handle("/", http.FileServer(http.FS(fsys)))
    http.ListenAndServe(":8080", nil)
}