add support for serving Google Cloud Storage over SFTP/SCP

Each user can be mapped with a Google Cloud Storage bucket or a bucket
virtual folder
This commit is contained in:
Nicola Murino
2020-01-31 19:04:00 +01:00
parent 45a13f5f4e
commit 3491717c26
33 changed files with 1632 additions and 165 deletions

28
vfs/fileinfo_unix.go Normal file
View File

@@ -0,0 +1,28 @@
// +build !windows
package vfs
import "syscall"
import "os"
var (
defaultUID, defaultGID int
)
func init() {
defaultUID = os.Getuid()
defaultGID = os.Getuid()
if defaultUID < 0 {
defaultUID = 65534
}
if defaultGID < 0 {
defaultGID = 65534
}
}
func (fi FileInfo) getFileInfoSys() interface{} {
return &syscall.Stat_t{
Uid: uint32(defaultUID),
Gid: uint32(defaultGID)}
}