storage

package
v0.1.3 Latest Latest
Warning

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

Go to latest
Published: Nov 3, 2017 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Driver

type Driver interface {
	Write(buf []byte, hash string, prefix string) error
	NewReader(hash string, prefix string) (io.ReadCloser, error)
}

Driver is the interface for saving images

type FileDriver

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

FileDriver struct

func NewFileDriver

func NewFileDriver(base string) *FileDriver

NewFileDriver constructs new FileDriver with base path

func (*FileDriver) NewReader

func (fs *FileDriver) NewReader(hash string, prefix string) (io.ReadCloser, error)

NewReader produces a file descriptor

func (*FileDriver) Write

func (fs *FileDriver) Write(buf []byte, hash string, prefix string) error

Write in filesystem a bytearray

type GoogleStorageDriver

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

GoogleStorageDriver struct

func NewGoogleStorageDriver

func NewGoogleStorageDriver(project string, bucket string, credentials string) (*GoogleStorageDriver, error)

NewGoogleStorageDriver constructs new GoogleStorageDriver

func (*GoogleStorageDriver) NewReader

func (gsw *GoogleStorageDriver) NewReader(hash string, prefix string) (io.ReadCloser, error)

NewReader produces a handler for file in google storage

func (*GoogleStorageDriver) Write

func (gsw *GoogleStorageDriver) Write(buf []byte, hash string, prefix string) error

Write in Google storage a bytearray

Jump to

Keyboard shortcuts

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