pathio

package
v1.0.1 Latest Latest
Warning

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

Go to latest
Published: Feb 20, 2015 License: Apache-2.0 Imports: 8 Imported by: 0

README

pathio

-- import "github.com/Clever/pathio"

Package pathio is a package that allows writing to and reading from different types of paths transparently. It supports two types of paths:

1. Local file paths
2. S3 File Paths (s3://bucket/key)

Note that using s3 paths requires setting three environment variables

1. AWS_SECRET_ACCESS_KEY
2. AWS_ACCESS_KEY_ID
3. AWS_REGION

Usage

func Reader
func Reader(path string) (io.Reader, error)

Reader returns an io.Reader for the specified path. The path can either be a local file path or an S3 path.

func Write
func Write(path string, input []byte) error

Write writes a byte array to the specified path. The path can be either a local file path of an S3 path.

func WriteReader
func WriteReader(path string, input io.Reader, length int64) error

WriteReader writes all the data read from the specified io.Reader to the output path. The path can either a local file path or an S3 path.

Documentation

Overview

Package pathio is a package that allows writing to and reading from different types of paths transparently. It supports two types of paths:

  1. Local file paths
  2. S3 File Paths (s3://bucket/key)

Note that using s3 paths requires setting three environment variables

  1. AWS_SECRET_ACCESS_KEY
  2. AWS_ACCESS_KEY_ID
  3. AWS_REGION

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Reader

func Reader(path string) (io.Reader, error)

Reader returns an io.Reader for the specified path. The path can either be a local file path or an S3 path.

func Write

func Write(path string, input []byte) error

Write writes a byte array to the specified path. The path can be either a local file path of an S3 path.

func WriteReader

func WriteReader(path string, input io.Reader, length int64) error

WriteReader writes all the data read from the specified io.Reader to the output path. The path can either a local file path or an S3 path.

Types

This section is empty.

Jump to

Keyboard shortcuts

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