lib

package
v0.0.0-...-6cf90a3 Latest Latest
Warning

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

Go to latest
Published: Jun 21, 2014 License: MIT Imports: 12 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetCodeURL

func GetCodeURL(config *oauth.Config)

GetCodeURL jumps prints the url to get the users auth code and exits

Types

type DriveDir

type DriveDir struct {
	Dir      *drive.File
	Modified time.Time
	Created  time.Time
	Root     bool
}

DriveDir represents a directory in google drive

func (DriveDir) Attr

func (DriveDir) Attr() fuse.Attr

Attr returns the file attributes

func (*DriveDir) Create

func (d *DriveDir) Create(req *fuse.CreateRequest, res *fuse.CreateResponse, intr fs.Intr) (fs.Node, fs.Handle, fuse.Error)

Create creates an empty file inside of d

func (*DriveDir) Fsync

func (d *DriveDir) Fsync(req *fuse.FsyncRequest, intr fs.Intr) fuse.Error

FSync is a place holder and does nothing but satisfyes the FSyncer interface

func (*DriveDir) Lookup

func (d *DriveDir) Lookup(name string, intr fs.Intr) (fs.Node, fuse.Error)

Lookup scans the current directory for matching files or directories

func (*DriveDir) Mkdir

func (d *DriveDir) Mkdir(req *fuse.MkdirRequest, intr fs.Intr) (fs.Node, fuse.Error)

Mkdir registers a new directory

func (*DriveDir) ReadDir

func (d *DriveDir) ReadDir(intr fs.Intr) ([]fuse.Dirent, fuse.Error)

ReadDir return a slice of directory entries

func (*DriveDir) Remove

func (d *DriveDir) Remove(req *fuse.RemoveRequest, intr fs.Intr) fuse.Error

Remove deletes a fild or folder from google drive

func (*DriveDir) Rename

func (d *DriveDir) Rename(req *fuse.RenameRequest, node fs.Node, intr fs.Intr) fuse.Error

Rename a file in d

type DriveFile

type DriveFile struct {
	File     *drive.File
	TmpFile  *os.File
	Modified time.Time
	Created  time.Time
	Root     bool
	*sync.Mutex
}

DriveFile represents a file in google drive

func (DriveFile) Attr

func (d DriveFile) Attr() fuse.Attr

Attr returns the file attributes

func (*DriveFile) Flush

func (d *DriveFile) Flush(req *fuse.FlushRequest, intr fs.Intr) fuse.Error

Flush a file tmp to google drive

func (*DriveFile) Lock

func (d *DriveFile) Lock()

Lock locks a *DriveFile's mutex

func (*DriveFile) Open

func (d *DriveFile) Open(req *fuse.OpenRequest, resp *fuse.OpenResponse, intr fs.Intr) (fs.Handle, fuse.Error)

Open a file or directory

func (DriveFile) ReadAll

func (d DriveFile) ReadAll(intr fs.Intr) ([]byte, fuse.Error)

ReadAll reads an entire file from google drive and returns the resulting bytes

func (*DriveFile) Setattr

func (d *DriveFile) Setattr(req *fuse.SetattrRequest, resp *fuse.SetattrResponse, intr fs.Intr) fuse.Error

Setattr sets file attributs

func (*DriveFile) Unlock

func (d *DriveFile) Unlock()

Unlock unlocks a *DriveFile's mutex

func (*DriveFile) Write

func (d *DriveFile) Write(req *fuse.WriteRequest, resp *fuse.WriteResponse, intr fs.Intr) fuse.Error

Write writes bytes to a tmp file, which are then synced by FSync

type Root

type Root struct{}

Root represents the root of the filesystem

func (Root) Root

func (r Root) Root() (fs.Node, fuse.Error)

Root is called ot get the root directory node of this filesystem

type Server

type Server struct {
	Config *oauth.Config
	// contains filtered or unexported fields
}

DriveFs is a struct which holds the FUSE filesystem

func NewServer

func NewServer(config *oauth.Config, code string) (*Server, error)

initialize and return a new DriveFS

func (*Server) Mount

func (s *Server) Mount(mountPoint string) (err error)

Mount attmpts to mount the filesystem

func (*Server) Serve

func (s *Server) Serve(refreshRate int)

Serve attempts to serve the filesystem

func (*Server) Unmount

func (s *Server) Unmount(mountPoint string, timeout int) (err error)

Unmount attempts to unmount the filesystem

Jump to

Keyboard shortcuts

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