cloud

package
v0.1.7 Latest Latest
Warning

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

Go to latest
Published: Mar 25, 2019 License: MIT Imports: 4 Imported by: 0

README

cloud

this is a simple go wrapper on TensorFlow cloud read/write functions.

installation

install Go API for TensorFlow https://www.tensorflow.org/install/lang_go

$ go get github.com/sdeoras/comp/...

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Enumerator

type Enumerator interface {
	io.Closer
	// Enumerate lists files that match path.
	// Example input: gs://my-bucket/path/to/files/*.jpg
	Enumerate(path string) ([]string, error)
}

FileEnumerator lists matching files from cloud path.

type FileManager

type FileManager interface {
	io.Closer
	// Enumerate lists files that match path.
	// Example input: gs://my-bucket/path/to/files/*.jpg
	Enumerate(path string) ([]string, error)
	// Read reads file contents and returns buffer
	// Example input: gs://my-bucket/path/to/files/earth.jpg
	Read(file string) ([]byte, error)
	// Write writes buffer to file path.
	Write(file string, buffer []byte) error
}

FileManager manages file io to cloud

type Op

type Op struct {
	// It embeds common op
	common.Op
}

Op is the operator for TF interface.

func NewOperator

func NewOperator(options *tf.SessionOptions) (*Op, error)

NewOperator provides an instance of new operator for cloud file I/O

func (*Op) Enumerate

func (op *Op) Enumerate(path string) ([]string, error)

func (*Op) Read

func (op *Op) Read(file string) ([]byte, error)

func (*Op) Write

func (op *Op) Write(file string, buf []byte) error

type ReadWriter

type ReadWriter interface {
	io.Closer
	// Read reads file contents and returns buffer
	// Example input: gs://my-bucket/path/to/files/earth.jpg
	Read(file string) ([]byte, error)
	// Write writes buffer to file path.
	Write(file string, buffer []byte) error
}

ReadWriter reads and write files to cloud storage paths.

type Reader

type Reader interface {
	io.Closer
	// Read reads file contents and returns buffer
	// Example input: gs://my-bucket/path/to/files/earth.jpg
	Read(file string) ([]byte, error)
}

Reader manages file reading from cloud path.

type Writer

type Writer interface {
	io.Closer
	// Write writes buffer to file path.
	Write(file string, buffer []byte) error
}

Writer manages writing byte buffer to cloud path.

Jump to

Keyboard shortcuts

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