fuse

package
v0.0.0-...-5b6cbe3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 20, 2019 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Cmd = &cobra.Command{
	Use:           "fuse [OPTIONS]",
	Short:         "Mount a storage container as a normal filesystem",
	SilenceUsage:  true,
	SilenceErrors: true,

	RunE: func(cmd *cobra.Command, args []string) error {

		source := viper.GetViper()
		source.SetConfigFile(viper.GetString("manifest"))
		if err := source.ReadInConfig(); err != nil {
			return err
		}

		man, err := manifest.New(source)
		if err != nil {
			return err
		}

		conn, err := fuse.Mount(
			viper.GetString("mountpoint"),
			fuse.FSName("tromosfs"),
			fuse.Subtype("tromosfs"),
			fuse.AsyncRead(),
		)
		if err != nil {
			return err
		}
		defer func() {
			Check(conn.Close())
			Check(fuse.Unmount(viper.GetString("mountpoint")))
		}()

		client, err := middleware.NewClient(middleware.Config{Manifest: man})
		if err != nil {
			return err
		}
		defer client.Close()
		return tromosfs.Mount(tromosfs.FilesystemConfig{
			Conn:   conn,
			Client: client,
		})
	},
}

Functions

func Check

func Check(err error)

Types

This section is empty.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL