github.com/StarfishStorage/goofys@v0.23.2-0.20200415030923-535558486b34/example/test_api.go (about)

     1  package main
     2  
     3  import (
     4  	goofys "github.com/kahing/goofys/api"
     5  	common "github.com/kahing/goofys/api/common"
     6  
     7  	"fmt"
     8  	"context"
     9  )
    10  
    11  func main() {
    12  	config := common.FlagStorage{
    13  		MountPoint: "/tmp/s3",
    14  		DirMode:    0755,
    15  		FileMode:   0644,
    16  	}
    17  
    18  	_, mp, err := goofys.Mount(context.Background(), "goofys", &config)
    19  	if err != nil {
    20  		panic(fmt.Sprintf("Unable to mount %v: %v", config.MountPoint, err))
    21  	} else {
    22  		mp.Join(context.Background())
    23  	}
    24  }