Comments (2)
Small edit for clarification: I have seen afero.NewBasePathFs
but I am not sure if it is a good direction
from afero-s3.
diff --git a/fs/s3/s3.go b/fs/s3/s3.go
index b4756f8..ae2e413 100644
--- a/fs/s3/s3.go
+++ b/fs/s3/s3.go
@@ -18,6 +18,7 @@ func LoadFs(access *confpar.Access) (afero.Fs, error) {
bucket := access.Params["bucket"]
keyID := access.Params["access_key_id"]
secretAccessKey := access.Params["secret_access_key"]
+ basePath := access.Params["base_path"]
conf := aws.Config{
Region: aws.String(region),
@@ -42,6 +43,9 @@ func LoadFs(access *confpar.Access) (afero.Fs, error) {
s3Fs := s3.NewFs(bucket, sess)
// s3Fs = stripprefix.NewStripPrefixFs(s3Fs, 1)
-
- return s3Fs, nil
+ if basePath != "" {
+ return afero.NewBasePathFs(s3Fs, basePath), nil
+ } else {
+ return s3Fs, nil
+ }
}
from afero-s3.
Related Issues (15)
- No error thrown with bad connection HOT 2
- Directory stat is broken on windows
- cd and other command not working HOT 3
- Default ACL when writing files HOT 2
- Action Required: Fix Renovate Configuration
- All files uploaded to S3 with Content-Type binary/octet-stream HOT 3
- Would be good to be able to set a Cache-Control header HOT 1
- Dependency Dashboard
- bug: File.Readdir appends trailing slash even if there is already one present HOT 2
- AWS Go SDK v2? HOT 1
- Guard against Windows file paths (backslash delimited)
- Open should return afero.ErrFileNotFound, but doesn't
- Fix stat for bucket root
- Server-Side Encryption
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from afero-s3.