Git Product home page Git Product logo

afero-objstor's Introduction

Afero Object Storage Driver

CircleCI codecov GoDoc

Overview

A filesystem backend for the afero filesystem abstraction which is designed to work with go-cloud supported object storage systems. Additionally, it provides an extended interface beyond that of afero which offers deadline sensitivity provided by golang contexts.

Notes on Distributed System Use

This library is likely to be used in a cloud-native context with multiple workers all using the same backend object storage bucket. This library does not make promises regarding file locking, consistency, or multiple-writer situations. This would best be solved with locks currently managed outside of this library.

Features

Currently Supported

type DeadlineFs interface {
	Name() string
	
	Create(name string) (File, error)
	CreateEx(ctx context.Context, name string) (DeadlineFile, error)
	
	Open(name string) (File, error)
	OpenEx(ctx context.Context, name string) (DeadlineFile, error)
}

type DeadlineFile interface {
	io.Reader
	ReadEx(ctx context.Context, p []byte) (count int, err error)
	io.ReaderAt
	ReadAtEx(ctx context.Context, p []byte, off int64) (count int, err error)
	
	io.Writer
	WriteEx(ctx context.Context, p []byte) (count int, err error)
	io.WriterAt
	WriteAtEx(ctx context.Context, p []byte, off int64) (count int, err error)
	WriteString(s string) (ret int, err error)
	WriteStringEx(ctx context.Context, s string) (int, error)
	
	Sync() error
	SyncEx(ctx context.Context) error
}

Currently Unsupported

type DeadlineFs interface {
	Mkdir(name string, perm os.FileMode) error
	MkdirEx(ctx context.Context, name string, perm os.FileMode) error
	MkdirAll(path string, perm os.FileMode) error
	MkdirAllEx(ctx context.Context, path string, perm os.FileMode) error
	
	OpenFile(name string, flag int, perm os.FileMode) (File, error)
	OpenFileEx(ctx context.Context, name string, flag int, perm os.FileMode) (DeadlineFile, error)
	
	Remove(name string) error
	RemoveEx(ctx context.Context, name string) error
	RemoveAll(path string) error
	RemoveAllEx(ctx context.Context, path string) error
	
	Rename(oldname, newname string) error
	RenameEx(ctx context.Context, oldname, newname string) error
	
	Stat(name string) (os.FileInfo, error)
	StatEx(ctx context.Context, name string) (os.FileInfo, error)
	
	Chmod(name string, mode os.FileMode) error
	ChmodEx(ctx context.Context, name string, mode os.FileMode) error
	Chtimes(name string, atime time.Time, mtime time.Time) error
	ChtimesEx(ctx context.Context, name string, atime time.Time, mtime time.Time) error
}

type DeadlineFile interface {
	io.Seeker
	Name() string
	
	io.Closer
	CloseEx(ctx context.Context) error

	Readdir(count int) ([]os.FileInfo, error)
	ReaddirEx(ctx context.Context, count int) ([]os.FileInfo, error)
	Readdirnames(n int) ([]string, error)
	ReaddirnamesEx(ctx context.Context, count int) ([]string, error)
	
	Stat() (os.FileInfo, error)
	StatEx(ctx context.Context) (os.FileInfo, error)
	
	Truncate(size int64) error
	TruncateEx(ctx context.Context, size int64) error
}

afero-objstor's People

Contributors

mrwinstead avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.