corfs

package
v0.2.2 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2022 License: MIT Imports: 20 Imported by: 0 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.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FilesystemType

func FilesystemType(fs api.FileSystem) api.FileSystemType

func InferFilesystem

func InferFilesystem(location string) api.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 api.FileSystemType) (api.FileSystem, error)

InitFilesystem intializes a filesystem of the given type

func NewPrefixEnvCredentials

func NewPrefixEnvCredentials(prefix string) *credentials.Credentials

NewEnvCredentials returns a pointer to a new Credentials object wrapping the environment variable provider.

Types

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) ([]api.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

func (l *LocalFileSystem) Split(path string) []string

Join joins file path elements

func (*LocalFileSystem) Stat

func (l *LocalFileSystem) Stat(filePath string) (api.FileInfo, error)

Stat returns information about the file at filePath.

type MinioFileSystem

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

S3FileSystem abstracts AWS S3 as a filesystem

func (*MinioFileSystem) Delete

func (s *MinioFileSystem) Delete(filePath string) error

Delete deletes the file at filePath.

func (*MinioFileSystem) Init

func (s *MinioFileSystem) Init() error

Init initializes the filesystem.

func (*MinioFileSystem) Join

func (s *MinioFileSystem) Join(elem ...string) string

Join joins file path elements

func (*MinioFileSystem) ListFiles

func (s *MinioFileSystem) ListFiles(pathGlob string) ([]api.FileInfo, error)

ListFiles lists files that match pathGlob.

func (*MinioFileSystem) OpenReader

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

func (s *MinioFileSystem) OpenWriter(filePath string) (io.WriteCloser, error)

OpenWriter opens a writer to the file at filePath.

func (*MinioFileSystem) Split

func (s *MinioFileSystem) Split(path string) []string

Join joins file path elements

func (*MinioFileSystem) Stat

func (s *MinioFileSystem) Stat(filePath string) (api.FileInfo, error)

Stat returns information about the file at filePath.

type PrefixEnvProvider

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

func (e *PrefixEnvProvider) IsExpired() bool

IsExpired returns if the credentials have been retrieved.

func (*PrefixEnvProvider) Retrieve

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) Init

func (s *S3FileSystem) Init() error

Init initializes the filesystem.

func (S3FileSystem) Join

func (s S3FileSystem) Join(elem ...string) string

Join joins file path elements

func (*S3FileSystem) ListFiles

func (s *S3FileSystem) ListFiles(pathGlob string) ([]api.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

func (s S3FileSystem) Split(path string) []string

Join joins file path elements

func (*S3FileSystem) Stat

func (s *S3FileSystem) Stat(filePath string) (api.FileInfo, error)

Stat returns information about the file at filePath.

Jump to

Keyboard shortcuts

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