usmanhalalit / gost Goto Github PK
View Code? Open in Web Editor NEWFilesystem Abstraction Layer for Go, supports S3, Local filesystem & your own
License: MIT License
Filesystem Abstraction Layer for Go, supports S3, Local filesystem & your own
License: MIT License
is this production ready?
Hello,
Thanks for your work.
What would have been even greater is to keep the compatibility with the existing File/Filesystem interfaces to provide an abstraction layer that can be used with existing libraries (webdav.FileSystem and webdav.File for example).
An other point : using minio-go instead of aws sdk would enable use of s3 compatible services.
Best regards.
I can't access local directories created by the library, it seems as though the directories are given the permission 644 instead of 777.
great work by the way!
var Directory gost.Directory = initDirectory()
func initDirectory() gost.Directory {
if dir, err := local.New(local.Config{
BasePath: "/path/to/public",
}); err != nil {
log.Fatal(err.Error())
} else {
return dir
}
return nil
}
func MakeTestFile() {
newFile := Directory.File("test/test/test.txt")
if !newFile.Exists() {
log.Println("File does not exist")
if err := newFile.Directory().Create(); err != nil {
log.Fatal(err.Error())
}
}
if n, err := newFile.Write([]byte("Test txt")); err != nil {
log.Fatal(err.Error())
} else if n == 0 {
log.Println("Null bytes writed")
}
}
When I try to create a folder in a subdirectory higher than one level, I get the error on newFile.Directory().Create()
:
File does not exist
Fatal: mkdir /path/to/public/uploads/test/test: no such file or directory
Because there is no test
folder in the uploads
folder. What can I do in such a situation? If I create folders using os
, I cannot use S3 in production
Your S3 interface currently implements a global service that's used for the file system, which is not ideal when working with multiple buckets in different regions as the creation of subsequent filesystems will error as it will reuse the service created in the original file system.
I propose that the SetService function be removed as well as the global service in s3/s3.go
how can i connect to this S3 api? if it's not available, can u do the api for it?
e.g. would like to use it as a s3 alternative using my server's local filesystem instead of s3 so need to connection from external app to use this one.
how can i get this done? pls help. will buy u a coffee if it's already done
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.