Documentation ¶
Index ¶
- func NewPrefixEnvCredentials(prefix string) *credentials.Credentials
- type FileInfo
- type FileSystem
- type FileSystemType
- type LocalFileSystem
- func (l *LocalFileSystem) Delete(filePath string) error
- func (l *LocalFileSystem) Init() error
- func (l *LocalFileSystem) Join(elem ...string) string
- func (l *LocalFileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
- func (l *LocalFileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
- func (l *LocalFileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
- func (l *LocalFileSystem) Split(path string) []string
- func (l *LocalFileSystem) Stat(filePath string) (FileInfo, error)
- type MinioFileSystem
- func (s *MinioFileSystem) Delete(filePath string) error
- func (s *MinioFileSystem) Init() error
- func (s *MinioFileSystem) Join(elem ...string) string
- func (s *MinioFileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
- func (s *MinioFileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
- func (s *MinioFileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
- func (s *MinioFileSystem) Split(path string) []string
- func (s *MinioFileSystem) Stat(filePath string) (FileInfo, error)
- type PrefixEnvProvider
- type S3FileSystem
- func (s *S3FileSystem) Delete(filePath string) error
- func (s *S3FileSystem) Init() error
- func (s S3FileSystem) Join(elem ...string) string
- func (s *S3FileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
- func (s *S3FileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
- func (s *S3FileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
- func (s S3FileSystem) Split(path string) []string
- func (s *S3FileSystem) Stat(filePath string) (FileInfo, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewPrefixEnvCredentials ¶ added in v0.1.0
func NewPrefixEnvCredentials(prefix string) *credentials.Credentials
NewEnvCredentials returns a pointer to a new Credentials object wrapping the environment variable provider.
Types ¶
type FileSystem ¶
type FileSystem interface { ListFiles(pathGlob string) ([]FileInfo, error) Stat(filePath string) (FileInfo, error) OpenReader(filePath string, startAt int64) (io.ReadCloser, error) OpenWriter(filePath string) (io.WriteCloser, error) Delete(filePath string) error Join(elem ...string) string Split(path string) []string Init() error }
FileSystem provides the file backend for MapReduce jobs. Input data is read from a file system. Intermediate and output data is written to a file system. This is abstracted to allow remote filesystems like S3 to be supported.
func InferFilesystem ¶
func InferFilesystem(location string) FileSystem
InferFilesystem initializes a filesystem by inferring its type from a file address. For example, locations starting with "s3://" will resolve to an S3 filesystem.
func InitFilesystem ¶
func InitFilesystem(fsType FileSystemType) (FileSystem, error)
InitFilesystem intializes a filesystem of the given type
type FileSystemType ¶
type FileSystemType int
FileSystemType is an identifier for supported FileSystems
const ( Local FileSystemType = iota S3 MINIO )
Identifiers for supported FileSystemTypes
func FilesystemType ¶ added in v0.1.0
func FilesystemType(fs FileSystem) FileSystemType
type LocalFileSystem ¶
type LocalFileSystem struct{}
LocalFileSystem wraps "os" to provide access to the local filesystem.
func (*LocalFileSystem) Delete ¶
func (l *LocalFileSystem) Delete(filePath string) error
Delete deletes the file at filePath.
func (*LocalFileSystem) Init ¶
func (l *LocalFileSystem) Init() error
Init initializes the filesystem.
func (*LocalFileSystem) Join ¶
func (l *LocalFileSystem) Join(elem ...string) string
Join joins file path elements
func (*LocalFileSystem) ListFiles ¶
func (l *LocalFileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
ListFiles lists files that match pathGlob.
func (*LocalFileSystem) OpenReader ¶
func (l *LocalFileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
OpenReader opens a reader to the file at filePath. The reader is initially seeked to "startAt" bytes into the file.
func (*LocalFileSystem) OpenWriter ¶
func (l *LocalFileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
OpenWriter opens a writer to the file at filePath.
func (*LocalFileSystem) Split ¶ added in v0.1.2
func (l *LocalFileSystem) Split(path string) []string
Join joins file path elements
type MinioFileSystem ¶ added in v0.1.0
type MinioFileSystem struct {
// contains filtered or unexported fields
}
S3FileSystem abstracts AWS S3 as a filesystem
func (*MinioFileSystem) Delete ¶ added in v0.1.0
func (s *MinioFileSystem) Delete(filePath string) error
Delete deletes the file at filePath.
func (*MinioFileSystem) Init ¶ added in v0.1.0
func (s *MinioFileSystem) Init() error
Init initializes the filesystem.
func (*MinioFileSystem) Join ¶ added in v0.1.0
func (s *MinioFileSystem) Join(elem ...string) string
Join joins file path elements
func (*MinioFileSystem) ListFiles ¶ added in v0.1.0
func (s *MinioFileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
ListFiles lists files that match pathGlob.
func (*MinioFileSystem) OpenReader ¶ added in v0.1.0
func (s *MinioFileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
OpenReader opens a reader to the file at filePath. The reader is initially seeked to "startAt" bytes into the file.
func (*MinioFileSystem) OpenWriter ¶ added in v0.1.0
func (s *MinioFileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
OpenWriter opens a writer to the file at filePath.
func (*MinioFileSystem) Split ¶ added in v0.1.2
func (s *MinioFileSystem) Split(path string) []string
Join joins file path elements
type PrefixEnvProvider ¶ added in v0.1.0
type PrefixEnvProvider struct {
// contains filtered or unexported fields
}
A EnvProvider retrieves credentials from the environment variables of the running process. Environment credentials never expire.
Environment variables used:
* Access Key ID: [PREFIX]+AWS_ACCESS_KEY_ID or [PREFIX]+AWS_ACCESS_KEY
* Secret Access Key: [PREFIX]+AWS_SECRET_ACCESS_KEY or [PREFIX]+AWS_SECRET_KEY
func (*PrefixEnvProvider) IsExpired ¶ added in v0.1.0
func (e *PrefixEnvProvider) IsExpired() bool
IsExpired returns if the credentials have been retrieved.
func (*PrefixEnvProvider) Retrieve ¶ added in v0.1.0
func (e *PrefixEnvProvider) Retrieve() (credentials.Value, error)
Retrieve retrieves the keys from the environment.
type S3FileSystem ¶
type S3FileSystem struct {
// contains filtered or unexported fields
}
S3FileSystem abstracts AWS S3 as a filesystem
func (*S3FileSystem) Delete ¶
func (s *S3FileSystem) Delete(filePath string) error
Delete deletes the file at filePath.
func (S3FileSystem) Join ¶
func (s S3FileSystem) Join(elem ...string) string
Join joins file path elements
func (*S3FileSystem) ListFiles ¶
func (s *S3FileSystem) ListFiles(pathGlob string) ([]FileInfo, error)
ListFiles lists files that match pathGlob.
func (*S3FileSystem) OpenReader ¶
func (s *S3FileSystem) OpenReader(filePath string, startAt int64) (io.ReadCloser, error)
OpenReader opens a reader to the file at filePath. The reader is initially seeked to "startAt" bytes into the file.
func (*S3FileSystem) OpenWriter ¶
func (s *S3FileSystem) OpenWriter(filePath string) (io.WriteCloser, error)
OpenWriter opens a writer to the file at filePath.
func (S3FileSystem) Split ¶ added in v0.1.2
func (s S3FileSystem) Split(path string) []string
Join joins file path elements