Documentation ¶
Index ¶
- func InodeHash(o ObjectKey) uint64
- func NewCache(maxEntries int) *cache
- func NewFileSystem(config *Config) *pathfs.PathNodeFs
- type Cipher
- type Config
- type Directory
- type Extent
- type File
- type FileSystem
- func (f *FileSystem) Access(name string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Chmod(name string, mode uint32, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Chown(name string, uid uint32, gid uint32, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Create(name string, flags uint32, mode uint32, context *fuse.Context) (nodefs.File, fuse.Status)
- func (f *FileSystem) GetAttr(name string, context *fuse.Context) (*fuse.Attr, fuse.Status)
- func (f *FileSystem) Mkdir(name string, mode uint32, context *fuse.Context) fuse.Status
- func (f *FileSystem) OnMount(nodeFs *pathfs.PathNodeFs)
- func (f *FileSystem) OnUnmount()
- func (f *FileSystem) Open(name string, flags uint32, context *fuse.Context) (file nodefs.File, code fuse.Status)
- func (f *FileSystem) OpenDir(name string, context *fuse.Context) (stream []fuse.DirEntry, code fuse.Status)
- func (f *FileSystem) Readlink(name string, context *fuse.Context) (string, fuse.Status)
- func (f *FileSystem) Rename(oldName string, newName string, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Rmdir(name string, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) String() string
- func (f *FileSystem) Symlink(value string, linkName string, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Truncate(name string, size uint64, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Unlink(name string, context *fuse.Context) (code fuse.Status)
- func (f *FileSystem) Utimens(name string, Atime *time.Time, Mtime *time.Time, context *fuse.Context) (code fuse.Status)
- type Logger
- type Meta
- type Node
- type ObjectKey
- type OpenedFile
- func (f *OpenedFile) Allocate(off uint64, size uint64, mode uint32) (code fuse.Status)
- func (f *OpenedFile) Chmod(perms uint32) fuse.Status
- func (f *OpenedFile) Chown(uid uint32, gid uint32) fuse.Status
- func (f *OpenedFile) Flush() fuse.Status
- func (f *OpenedFile) Fsync(flags int) (code fuse.Status)
- func (f *OpenedFile) GetAttr(out *fuse.Attr) fuse.Status
- func (f *OpenedFile) Read(dest []byte, off int64) (fuse.ReadResult, fuse.Status)
- func (f *OpenedFile) Release()
- func (f *OpenedFile) String() string
- func (f *OpenedFile) Truncate(size uint64) fuse.Status
- func (f *OpenedFile) Utimens(atime *time.Time, mtime *time.Time) fuse.Status
- func (f *OpenedFile) Write(data []byte, off int64) (written uint32, code fuse.Status)
- type ReadResult
- type S3Session
- func (s *S3Session) Download(key ObjectKey) ([]byte, error)
- func (s *S3Session) DownloadWithCache(key ObjectKey) ([]byte, error)
- func (s *S3Session) IsExist(key ObjectKey) bool
- func (s *S3Session) Upload(key ObjectKey, value io.ReadSeeker) error
- func (s *S3Session) UploadWithCache(key ObjectKey, value io.ReadSeeker) error
- type Session
- func (s *Session) CreateDirectory(key, parent ObjectKey, mode uint32, context *fuse.Context) *Directory
- func (s *Session) CreateExtent(size int64) *Extent
- func (s *Session) CreateFile(key, parent ObjectKey, mode uint32, context *fuse.Context) *File
- func (s *Session) CreateSymLink(key, parent ObjectKey, linkTo string, context *fuse.Context) *SymLink
- func (s *Session) KeyGen(object []byte) ObjectKey
- func (s *Session) NewDirectory(key ObjectKey) (*Directory, error)
- func (s *Session) NewFile(key ObjectKey) (*File, error)
- func (s *Session) NewNode(key ObjectKey) (*Node, error)
- func (s *Session) NewSymLink(key ObjectKey) (*SymLink, error)
- func (s *Session) NewTypedNode(key ObjectKey) (interface{}, error)
- func (s *Session) PathWalk(relPath string) (key ObjectKey, err error)
- func (s *Session) RootKey() ObjectKey
- type SymLink
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewFileSystem ¶
func NewFileSystem(config *Config) *pathfs.PathNodeFs
Types ¶
type Cipher ¶
type Cipher struct {
// contains filtered or unexported fields
}
func (*Cipher) StreamReader ¶
func (*Cipher) StreamWriter ¶
type Config ¶
type Config struct { Bucket string `yaml:"bucket"` Region string `yaml:"region"` AccessKey string `yaml:"access_key"` SecretKey string `yaml:"secret_key"` Password string `yaml:"password"` Logging string `yaml:"logging"` LogOutputPath string `yaml:"log_output_path"` CacheSize int `yaml:"cache_size"` ExtentSize int64 `yaml:"extent_size"` Encryption bool `yaml:"encryption"` Compression bool `yaml:"compression"` }
type Directory ¶
type Extent ¶
type Extent struct { Key ObjectKey `json:"key"` // contains filtered or unexported fields }
func (*Extent) CurrentKey ¶
type File ¶
type FileSystem ¶
type FileSystem struct { pathfs.FileSystem Sess *Session // contains filtered or unexported fields }
func (*FileSystem) OnMount ¶
func (f *FileSystem) OnMount(nodeFs *pathfs.PathNodeFs)
func (*FileSystem) OnUnmount ¶
func (f *FileSystem) OnUnmount()
func (*FileSystem) String ¶
func (f *FileSystem) String() string
type Meta ¶
type Meta struct { Size int64 `json:"size"` Mode uint32 `json:"mode"` UID uint32 `json:"uid"` GID uint32 `json:"gid"` Atime time.Time `json:"atime"` Ctime time.Time `json:"ctime"` Mtime time.Time `json:"mtime"` }
Meta is common struct for directory, file and symlink
type ObjectKey ¶
type ObjectKey = string
ObjectKey is v4 UUID assgned to newly created object
func NewObjectKey ¶
func NewObjectKey() ObjectKey
type OpenedFile ¶
nodefs.File interface
func NewOpenedFile ¶
func NewOpenedFile(file *File) *OpenedFile
func (*OpenedFile) Flush ¶
func (f *OpenedFile) Flush() fuse.Status
func (*OpenedFile) Read ¶
func (f *OpenedFile) Read(dest []byte, off int64) (fuse.ReadResult, fuse.Status)
func (*OpenedFile) Release ¶
func (f *OpenedFile) Release()
func (*OpenedFile) String ¶
func (f *OpenedFile) String() string
type ReadResult ¶
type ReadResult struct {
// contains filtered or unexported fields
}
func (*ReadResult) Done ¶
func (r *ReadResult) Done()
func (*ReadResult) Size ¶
func (r *ReadResult) Size() int
type S3Session ¶
type S3Session struct {
// contains filtered or unexported fields
}
func (*S3Session) DownloadWithCache ¶
func (*S3Session) UploadWithCache ¶
func (s *S3Session) UploadWithCache(key ObjectKey, value io.ReadSeeker) error
type Session ¶
type Session struct {
// contains filtered or unexported fields
}
func NewSession ¶
func (*Session) CreateDirectory ¶
func (*Session) CreateExtent ¶
func (*Session) CreateFile ¶
func (*Session) CreateSymLink ¶
func (*Session) NewTypedNode ¶
NewNode returns Directory, File or Symlink
Click to show internal directories.
Click to hide internal directories.