gcsdriver

package module
v0.0.0-...-27652f6 Latest Latest
Warning

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

Go to latest
Published: Jan 23, 2017 License: MIT Imports: 14 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

gcs-driver

Google Storage driver for https://github.com/goftp/server

Based on https://github.com/goftp/qiniu-driver

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewGoogleStorageDriverFactory

func NewGoogleStorageDriverFactory(bucket, serviceAccountPath string, bucketPerUser bool) server.DriverFactory

Types

type FileInfo

type FileInfo struct {
	User   string
	Object storage.Object
	// contains filtered or unexported fields
}

func (*FileInfo) Group

func (f *FileInfo) Group() string

func (*FileInfo) IsDir

func (f *FileInfo) IsDir() bool

func (*FileInfo) ModTime

func (f *FileInfo) ModTime() time.Time

func (*FileInfo) Mode

func (f *FileInfo) Mode() os.FileMode

func (*FileInfo) Name

func (f *FileInfo) Name() string

func (*FileInfo) Owner

func (f *FileInfo) Owner() string

func (*FileInfo) Size

func (f *FileInfo) Size() int64

func (*FileInfo) Sys

func (f *FileInfo) Sys() interface{}

type GoogleStorageDriver

type GoogleStorageDriver struct {
	// contains filtered or unexported fields
}

Can use a specific bucket, or one per user

func (*GoogleStorageDriver) ChangeDir

func (driver *GoogleStorageDriver) ChangeDir(path string) error

Implementation of goftp's ChangeDir method for Google Storage

func (*GoogleStorageDriver) DeleteDir

func (driver *GoogleStorageDriver) DeleteDir(key string) error

Implementation of goftp's DeleteDir method for Google Storage

func (*GoogleStorageDriver) DeleteFile

func (driver *GoogleStorageDriver) DeleteFile(key string) error

Implementation of goftp's DeleteFile method for Google Storage

func (*GoogleStorageDriver) GetFile

func (driver *GoogleStorageDriver) GetFile(objectName string, offset int64) (int64, io.ReadCloser, error)

Implementation of goftp's GetFile method for Google Storage

func (*GoogleStorageDriver) Init

func (driver *GoogleStorageDriver) Init(conn *server.Conn)

Store a pointer to the connection to keep access to values like the logged in user

func (*GoogleStorageDriver) ListDir

func (driver *GoogleStorageDriver) ListDir(prefix string, callback func(server.FileInfo) error) error

Implementation of goftp's ListDir method for Google Storage

func (*GoogleStorageDriver) MakeDir

func (driver *GoogleStorageDriver) MakeDir(path string) error

Implementation of goftp's MakeDir method for Google Storage

func (*GoogleStorageDriver) PutFile

func (driver *GoogleStorageDriver) PutFile(objectName string, data io.Reader, appendData bool) (int64, error)

Implementation of goftp's PutFile method for Google Storage

func (*GoogleStorageDriver) Rename

func (driver *GoogleStorageDriver) Rename(keySrc, keyDest string) error

Implementation of goftp's Rename method for Google Storage

func (*GoogleStorageDriver) Stat

func (driver *GoogleStorageDriver) Stat(key string) (server.FileInfo, error)

Implementation of goftp's Stat method for Google Storage

type GoogleStorageDriverFactory

type GoogleStorageDriverFactory struct {
	Bucket             string
	ServiceAccountPath string
	BucketPerUser      bool
}

func (*GoogleStorageDriverFactory) NewDriver

func (factory *GoogleStorageDriverFactory) NewDriver() (server.Driver, error)

Jump to

Keyboard shortcuts

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