vendor/github.com/spf13/afero/README.md
changeset 260 445e01aede7e
parent 256 6d9efbef00a9
equal deleted inserted replaced
259:db4911b0c721 260:445e01aede7e
     1 ![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png)
     1 ![afero logo-sm](https://cloud.githubusercontent.com/assets/173412/11490338/d50e16dc-97a5-11e5-8b12-019a300d0fcb.png)
     2 
     2 
     3 A FileSystem Abstraction System for Go
     3 A FileSystem Abstraction System for Go
     4 
     4 
     5 [![Build Status](https://travis-ci.org/spf13/afero.svg)](https://travis-ci.org/spf13/afero) [![Build status](https://ci.appveyor.com/api/projects/status/github/spf13/afero?branch=master&svg=true)](https://ci.appveyor.com/project/spf13/afero) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
     5 [![Test](https://github.com/spf13/afero/actions/workflows/test.yml/badge.svg)](https://github.com/spf13/afero/actions/workflows/test.yml) [![GoDoc](https://godoc.org/github.com/spf13/afero?status.svg)](https://godoc.org/github.com/spf13/afero) [![Join the chat at https://gitter.im/spf13/afero](https://badges.gitter.im/Dev%20Chat.svg)](https://gitter.im/spf13/afero?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge)
     6 
     6 
     7 # Overview
     7 # Overview
     8 
     8 
     9 Afero is a filesystem framework providing a simple, uniform and universal API
     9 Afero is a filesystem framework providing a simple, uniform and universal API
    10 interacting with any filesystem, as an abstraction layer providing interfaces,
    10 interacting with any filesystem, as an abstraction layer providing interfaces,
    77 Throughout your application use any function and method like you normally
    77 Throughout your application use any function and method like you normally
    78 would.
    78 would.
    79 
    79 
    80 So if my application before had:
    80 So if my application before had:
    81 ```go
    81 ```go
    82 os.Open('/tmp/foo')
    82 os.Open("/tmp/foo")
    83 ```
    83 ```
    84 We would replace it with:
    84 We would replace it with:
    85 ```go
    85 ```go
    86 AppFs.Open('/tmp/foo')
    86 AppFs.Open("/tmp/foo")
    87 ```
    87 ```
    88 
    88 
    89 `AppFs` being the variable we defined above.
    89 `AppFs` being the variable we defined above.
    90 
    90 
    91 
    91 
   257 ### SftpFs
   257 ### SftpFs
   258 
   258 
   259 Afero has experimental support for secure file transfer protocol (sftp). Which can
   259 Afero has experimental support for secure file transfer protocol (sftp). Which can
   260 be used to perform file operations over a encrypted channel.
   260 be used to perform file operations over a encrypted channel.
   261 
   261 
       
   262 ### GCSFs
       
   263 
       
   264 Afero has experimental support for Google Cloud Storage (GCS). You can either set the
       
   265 `GOOGLE_APPLICATION_CREDENTIALS_JSON` env variable to your JSON credentials or use `opts` in
       
   266 `NewGcsFS` to configure access to your GCS bucket.
       
   267 
       
   268 Some known limitations of the existing implementation:
       
   269 * No Chmod support - The GCS ACL could probably be mapped to *nix style permissions but that would add another level of complexity and is ignored in this version.
       
   270 * No Chtimes support - Could be simulated with attributes (gcs a/m-times are set implicitly) but that's is left for another version.
       
   271 * Not thread safe - Also assumes all file operations are done through the same instance of the GcsFs. File operations between different GcsFs instances are not guaranteed to be consistent.
       
   272 
       
   273 
   262 ## Filtering Backends
   274 ## Filtering Backends
   263 
   275 
   264 ### BasePathFs
   276 ### BasePathFs
   265 
   277 
   266 The BasePathFs restricts all operations to a given path within an Fs.
   278 The BasePathFs restricts all operations to a given path within an Fs.