github.com/adrianjagielak/goofys@v0.24.1-0.20230810095418-94919a5d2254/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  }