func main() { flag.Parse() sfs := new(nopfs.NopSrv) sfs.Debuglevel = *debug sfs.Root = ubnt.Dir sfs.Start(sfs) err := sfs.StartNetListener("tcp", *addr) if err != nil { log.Fatalf("%s", err) } }
func main() { flag.Parse() root := nopfs.NewDir() root.Append("README.txt", nopfs.NewFile([]byte(readme_top))) host := nopfs.NewAnyDir() root.Append("host", host) host.Static("README.txt", nopfs.NewFile([]byte(readme_host))) host.Static("clear", &nopfs.Ctl{Writer: nopfs.AnyDirCtlReset}) host.Append("icmp", icmp.Dir) host.Append("dns", dns.Dir) sfs := new(nopfs.NopSrv) sfs.Debuglevel = *debug sfs.Root = root sfs.Start(sfs) err := sfs.StartNetListener("tcp", *addr) if err != nil { log.Fatalf("%s", err) } }