internal

package
v0.0.0-...-b389751 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jul 6, 2023 License: Apache-2.0 Imports: 60 Imported by: 0

Documentation

Overview

System permissions-related code.

Index

Constants

View Source
const ADL1_REQUEST_ID = "X-Ms-Request-Id"
View Source
const ADL2_CLIENT_REQUEST_ID = "X-Ms-Client-Request-Id"
View Source
const ADL2_REQUEST_ID = "X-Ms-Request-Id"
View Source
const AzureBlobMetaDataHeaderPrefix = "x-ms-meta-"
View Source
const AzureDirBlobMetadataKey = "hdi_isfolder"
View Source
const AzuriteEndpoint = "http://127.0.0.1:8080/devstoreaccount1/"
View Source
const BUF_SIZE = 5 * 1024 * 1024
View Source
const CGROUP_FOLDER_PREFIX = "/sys/fs/cgroup/memory"
View Source
const CGROUP_PATH = "/proc/self/cgroup"
View Source
const INIT_ERR_BLOB = "mount.err"
View Source
const MAX_READAHEAD = uint32(400 * 1024 * 1024)
View Source
const MEM_LIMIT_FILE_SUFFIX = "/memory.limit_in_bytes"
View Source
const MEM_USAGE_FILE_SUFFIX = "/memory.usage_in_bytes"
View Source
const READAHEAD_CHUNK = uint32(20 * 1024 * 1024)

Variables

View Source
var SmallActionsGate = Ticket{Total: 100}.Init()
View Source
var TIME_MAX = time.Unix(1<<63-62135596801, 999999999)
View Source
var VersionHash string
View Source
var VersionNumber string

Functions

func ConvertBytesToIEC

func ConvertBytesToIEC(size int64) string

The following functions are useful to debug byte sizes

func Dup

func Dup(value []byte) []byte

func GetTgid

func GetTgid(pid uint32) (tgid *int32, err error)

GetTgid returns the tgid for the given pid.

func IsADLv1Endpoint

func IsADLv1Endpoint(endpoint string) bool

func IsADLv2Endpoint

func IsADLv2Endpoint(endpoint string) bool

func MassageMountFlags

func MassageMountFlags(args []string) (ret []string)

func MaxInt

func MaxInt(a, b int) int

func MaxInt64

func MaxInt64(a, b int64) int64

func MaxUInt32

func MaxUInt32(a, b uint32) uint32

func MaxUInt64

func MaxUInt64(a, b uint64) uint64

func MinInt

func MinInt(a, b int) int

func MinInt64

func MinInt64(a, b int64) int64

func MinUInt32

func MinUInt32(a, b uint32) uint32

func MinUInt64

func MinUInt64(a, b uint64) uint64

func MyUserAndGroup

func MyUserAndGroup() (int, int)

MyUserAndGroup returns the UID and GID of this process.

func NewApp

func NewApp() (app *cli.App)

func NilInt64

func NilInt64(v *int64) int64

func NilMetadata

func NilMetadata(m map[string]*string) map[string]string

func NilStr

func NilStr(v *string) string

func NilUint32

func NilUint32(v *uint32) uint32

func NilUint64

func NilUint64(v *uint64) uint64

func PBool

func PBool(v bool) *bool

func PInt32

func PInt32(v int32) *int32

func PInt64

func PInt64(v int64) *int64

func PMetadata

func PMetadata(m map[string]string) map[string]*string

func PString

func PString(v string) *string

func PTime

func PTime(v time.Time) *time.Time

func PUInt32

func PUInt32(v uint32) *uint32

func PUInt64

func PUInt64(v uint64) *uint64

func PopulateFlags

func PopulateFlags(c *cli.Context) (ret *FlagStorage)

PopulateFlags adds the flags accepted by run to the supplied flag set, returning the variables into which the flags will parse.

func SignV2

func SignV2(req *request.Request)

Sign requests with signature version 2.

Will sign the requests with the service config's Credentials object Signing is skipped if the credentials is the credentials.AnonymousCredentials object.

func TryUnmount

func TryUnmount(mountPoint string) (err error)

Types

type ADL2Error

type ADL2Error struct {
	adl2.DataLakeStorageError
}

func (ADL2Error) Error

func (e ADL2Error) Error() string

type ADLv1

type ADLv1 struct {
	// contains filtered or unexported fields
}

func NewADLv1

func NewADLv1(bucket string, flags *FlagStorage, config *ADLv1Config) (*ADLv1, error)

func (*ADLv1) Bucket

func (b *ADLv1) Bucket() string

func (*ADLv1) Capabilities

func (b *ADLv1) Capabilities() *Capabilities

func (*ADLv1) CopyBlob

func (b *ADLv1) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

func (*ADLv1) Delegate

func (b *ADLv1) Delegate() interface{}

func (*ADLv1) DeleteBlob

func (b *ADLv1) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*ADLv1) DeleteBlobs

func (b *ADLv1) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*ADLv1) GetBlob

func (b *ADLv1) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

func (*ADLv1) HeadBlob

func (b *ADLv1) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

func (*ADLv1) Init

func (b *ADLv1) Init(key string) error

func (*ADLv1) ListBlobs

func (b *ADLv1) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*ADLv1) MakeBucket

func (b *ADLv1) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*ADLv1) MultipartBlobAbort

func (b *ADLv1) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*ADLv1) MultipartBlobAdd

func (b *ADLv1) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*ADLv1) MultipartBlobBegin

func (b *ADLv1) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*ADLv1) MultipartBlobCommit

func (b *ADLv1) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*ADLv1) MultipartExpire

func (b *ADLv1) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*ADLv1) PutBlob

func (b *ADLv1) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

func (*ADLv1) RemoveBucket

func (b *ADLv1) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*ADLv1) RenameBlob

func (b *ADLv1) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

type ADLv1Err

type ADLv1Err struct {
	RemoteException struct {
		Exception     string
		Message       string
		JavaClassName string
	}
	// contains filtered or unexported fields
}

func (ADLv1Err) Error

func (err ADLv1Err) Error() string

type ADLv1MultipartBlobCommitInput

type ADLv1MultipartBlobCommitInput struct {
	Size uint64
}

type ADLv2

type ADLv2 struct {
	// contains filtered or unexported fields
}

func NewADLv2

func NewADLv2(bucket string, flags *FlagStorage, config *ADLv2Config) (*ADLv2, error)

func (*ADLv2) Bucket

func (b *ADLv2) Bucket() string

func (*ADLv2) Capabilities

func (b *ADLv2) Capabilities() *Capabilities

func (*ADLv2) CopyBlob

func (b *ADLv2) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

func (*ADLv2) Delegate

func (b *ADLv2) Delegate() interface{}

func (*ADLv2) DeleteBlob

func (b *ADLv2) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*ADLv2) DeleteBlobs

func (b *ADLv2) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*ADLv2) GetBlob

func (b *ADLv2) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

func (*ADLv2) HeadBlob

func (b *ADLv2) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

func (*ADLv2) Init

func (b *ADLv2) Init(key string) (err error)

func (*ADLv2) ListBlobs

func (b *ADLv2) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*ADLv2) MakeBucket

func (b *ADLv2) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*ADLv2) MultipartBlobAbort

func (b *ADLv2) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*ADLv2) MultipartBlobAdd

func (b *ADLv2) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*ADLv2) MultipartBlobBegin

func (b *ADLv2) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

adlv2 doesn't have atomic multipart upload, instead we will hold a lease, replace the object, then release the lease

func (*ADLv2) MultipartBlobCommit

func (b *ADLv2) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*ADLv2) MultipartExpire

func (b *ADLv2) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*ADLv2) PutBlob

func (b *ADLv2) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

func (*ADLv2) RemoveBucket

func (b *ADLv2) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*ADLv2) RenameBlob

func (b *ADLv2) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

type ADLv2MultipartBlobCommitInput

type ADLv2MultipartBlobCommitInput struct {
	Size           uint64
	ContentType    string
	RenewLeaseStop chan bool
}

type AZBlob

type AZBlob struct {
	// contains filtered or unexported fields
}

func NewAZBlob

func NewAZBlob(container string, config *AZBlobConfig) (*AZBlob, error)

func (*AZBlob) Bucket

func (b *AZBlob) Bucket() string

func (*AZBlob) Capabilities

func (b *AZBlob) Capabilities() *Capabilities

func (*AZBlob) CopyBlob

func (b *AZBlob) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

func (*AZBlob) Delegate

func (b *AZBlob) Delegate() interface{}

func (*AZBlob) DeleteBlob

func (b *AZBlob) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*AZBlob) DeleteBlobs

func (b *AZBlob) DeleteBlobs(param *DeleteBlobsInput) (ret *DeleteBlobsOutput, deleteError error)

func (*AZBlob) GetBlob

func (b *AZBlob) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

func (*AZBlob) HeadBlob

func (b *AZBlob) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

func (*AZBlob) Init

func (b *AZBlob) Init(key string) error

func (*AZBlob) ListBlobs

func (b *AZBlob) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*AZBlob) MakeBucket

func (b *AZBlob) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*AZBlob) MultipartBlobAbort

func (b *AZBlob) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*AZBlob) MultipartBlobAdd

func (b *AZBlob) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*AZBlob) MultipartBlobBegin

func (b *AZBlob) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*AZBlob) MultipartBlobCommit

func (b *AZBlob) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*AZBlob) MultipartExpire

func (b *AZBlob) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*AZBlob) PutBlob

func (b *AZBlob) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

func (*AZBlob) RemoveBucket

func (b *AZBlob) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*AZBlob) RenameBlob

func (b *AZBlob) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

type BlobItemOutput

type BlobItemOutput struct {
	Key          *string
	ETag         *string
	LastModified *time.Time
	Size         uint64
	StorageClass *string
}

func (BlobItemOutput) String

func (b BlobItemOutput) String() string

type BlobPrefixOutput

type BlobPrefixOutput struct {
	Prefix *string
}

func (BlobPrefixOutput) String

func (b BlobPrefixOutput) String() string

type BucketSpec

type BucketSpec struct {
	Scheme string
	Bucket string
	Prefix string
}

func ParseBucketSpec

func ParseBucketSpec(bucket string) (spec BucketSpec, err error)

type Buffer

type Buffer struct {
	// contains filtered or unexported fields
}

func (*Buffer) Close

func (b *Buffer) Close() (err error)

func (Buffer) Init

func (b Buffer) Init(buf *MBuf, r ReaderProvider) *Buffer

func (*Buffer) ReInit

func (b *Buffer) ReInit(r ReaderProvider)

func (*Buffer) Read

func (b *Buffer) Read(p []byte) (n int, err error)

type BufferPool

type BufferPool struct {
	// contains filtered or unexported fields
}

func NewBufferPool

func NewBufferPool(maxSizeGlobal uint64) *BufferPool

for testing

func (*BufferPool) Free

func (pool *BufferPool) Free(buf []byte)

func (BufferPool) Init

func (pool BufferPool) Init() *BufferPool

func (*BufferPool) MaybeGC

func (pool *BufferPool) MaybeGC()

func (*BufferPool) RequestBuffer

func (pool *BufferPool) RequestBuffer() (buf []byte)

func (*BufferPool) RequestMultiple

func (pool *BufferPool) RequestMultiple(size uint64, block bool) (buffers [][]byte)

type Capabilities

type Capabilities struct {
	// set this to true to disable parallel upload
	NoParallelMultipart bool
	MaxMultipartSize    uint64
	// indicates that the blob store has native support for directories
	DirBlob bool
	Name    string
}

type CopyBlobInput

type CopyBlobInput struct {
	Source      string
	Destination string

	Size         *uint64
	ETag         *string            // if non-nil, do conditional copy
	Metadata     map[string]*string // if nil, copy from Source
	StorageClass *string            // if nil, copy from Source
}

func (CopyBlobInput) String

func (b CopyBlobInput) String() string

type CopyBlobOutput

type CopyBlobOutput struct {
	RequestId string
}

type Delegator

type Delegator interface {
	Delegate() interface{}
}

type DeleteBlobInput

type DeleteBlobInput struct {
	Key string
}

type DeleteBlobOutput

type DeleteBlobOutput struct {
	RequestId string
}

type DeleteBlobsInput

type DeleteBlobsInput struct {
	Items []string
}

type DeleteBlobsOutput

type DeleteBlobsOutput struct {
	RequestId string
}

type DirHandle

type DirHandle struct {
	Marker *string
	// contains filtered or unexported fields
}

func NewDirHandle

func NewDirHandle(inode *Inode) (dh *DirHandle)

func (*DirHandle) CloseDir

func (dh *DirHandle) CloseDir() error

func (*DirHandle) ReadDir

func (dh *DirHandle) ReadDir(offset fuseops.DirOffset) (en *DirHandleEntry, err error)

LOCKS_REQUIRED(dh.mu) LOCKS_EXCLUDED(dh.inode.mu) LOCKS_EXCLUDED(dh.inode.fs)

type DirHandleEntry

type DirHandleEntry struct {
	Name   string
	Inode  fuseops.InodeID
	Type   fuseutil.DirentType
	Offset fuseops.DirOffset
}

type DirInodeData

type DirInodeData struct {
	DirTime time.Time

	Children []*Inode
	// contains filtered or unexported fields
}

type FileHandle

type FileHandle struct {

	// User space PID. All threads created by a process will have the same TGID,
	// but different PIDs[1].
	// This value can be nil if we fail to get TGID from PID[2].
	// [1] : https://godoc.org/github.com/shirou/gopsutil/process#Process.Tgid
	// [2] : https://github.com/shirou/gopsutil#process-class
	Tgid *int32
	// contains filtered or unexported fields
}

func NewFileHandle

func NewFileHandle(inode *Inode, opMetadata fuseops.OpContext) *FileHandle

NewFileHandle returns a new file handle for the given `inode` triggered by fuse operation with the given `opMetadata`

func (*FileHandle) FlushFile

func (fh *FileHandle) FlushFile() (err error)

func (*FileHandle) ReadFile

func (fh *FileHandle) ReadFile(offset int64, buf []byte) (bytesRead int, err error)

func (*FileHandle) Release

func (fh *FileHandle) Release()

func (*FileHandle) WriteFile

func (fh *FileHandle) WriteFile(offset int64, data []byte) (err error)

type GCS3

type GCS3 struct {
	*S3Backend
}

GCS variant of S3

func NewGCS3

func NewGCS3(bucket string, flags *FlagStorage, config *S3Config) (*GCS3, error)

func (*GCS3) Delegate

func (s *GCS3) Delegate() interface{}

func (*GCS3) DeleteBlobs

func (s *GCS3) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*GCS3) MultipartBlobAdd

func (s *GCS3) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*GCS3) MultipartBlobBegin

func (s *GCS3) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*GCS3) MultipartBlobCommit

func (s *GCS3) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

type GCS3MultipartBlobCommitInput

type GCS3MultipartBlobCommitInput struct {
	Size uint64
	ETag *string
	Prev *MultipartBlobAddInput
}

type GCSBackend

type GCSBackend struct {
	// contains filtered or unexported fields
}

func NewGCS

func NewGCS(bucket string, config *common.GCSConfig) (*GCSBackend, error)

NewGCS initializes a GCS Backend. It creates an authenticated client or unauthenticated client based on existing credentials in the environment.

func (*GCSBackend) Bucket

func (g *GCSBackend) Bucket() string

Bucket returns the GCSBackend's bucket name.

func (*GCSBackend) Capabilities

func (g *GCSBackend) Capabilities() *Capabilities

func (*GCSBackend) CopyBlob

func (g *GCSBackend) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

CopyBlob copies a source object to another destination object under the same bucket.

func (*GCSBackend) Delegate

func (g *GCSBackend) Delegate() interface{}

func (*GCSBackend) DeleteBlob

func (g *GCSBackend) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*GCSBackend) DeleteBlobs

func (g *GCSBackend) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

DeleteBlobs deletes multiple GCS blobs.

func (*GCSBackend) GetBlob

func (g *GCSBackend) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

GetBlob returns a file reader for a GCS object.

func (*GCSBackend) HeadBlob

func (g *GCSBackend) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

HeadBlob gets the file object metadata.

func (*GCSBackend) Init

func (g *GCSBackend) Init(key string) error

Init checks user's access to bucket.

func (*GCSBackend) ListBlobs

func (g *GCSBackend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*GCSBackend) MakeBucket

func (g *GCSBackend) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*GCSBackend) MultipartBlobAbort

func (g *GCSBackend) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*GCSBackend) MultipartBlobAdd

func (g *GCSBackend) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

MultipartBlobAdd adds part of blob to the upload request. Under GCS backend, we'll write that blob part into the gcsWriter. TODO(deka): This is a temporary implementation to allow most tests to run. We might change this implementation in the future.

func (*GCSBackend) MultipartBlobBegin

func (g *GCSBackend) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

MultipartBlobBegin begins a multi part blob request. Under GCS backend, we'll initialize the gcsWriter object and the context for the multipart blob request here.

func (*GCSBackend) MultipartBlobCommit

func (g *GCSBackend) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*GCSBackend) MultipartExpire

func (g *GCSBackend) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*GCSBackend) PutBlob

func (g *GCSBackend) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

PutBlob writes a file to GCS.

func (*GCSBackend) RemoveBucket

func (g *GCSBackend) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*GCSBackend) RenameBlob

func (g *GCSBackend) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

RenameBlob is not supported for GCS backend. So Goofys will do a CopyBlob followed by DeleteBlob for renames.

type GCSMultipartBlobCommitInput

type GCSMultipartBlobCommitInput struct {
	// contains filtered or unexported fields
}

type GetBlobInput

type GetBlobInput struct {
	Key     string
	Start   uint64
	Count   uint64
	IfMatch *string
}

func (GetBlobInput) String

func (b GetBlobInput) String() string

type GetBlobOutput

type GetBlobOutput struct {
	HeadBlobOutput

	Body io.ReadCloser

	RequestId string
}

type Goofys

type Goofys struct {
	fuseutil.NotImplementedFileSystem
	// contains filtered or unexported fields
}

func NewGoofys

func NewGoofys(ctx context.Context, bucket string, flags *FlagStorage) *Goofys

func (*Goofys) CreateFile

func (fs *Goofys) CreateFile(
	ctx context.Context,
	op *fuseops.CreateFileOp) (err error)

func (*Goofys) FlushFile

func (fs *Goofys) FlushFile(
	ctx context.Context,
	op *fuseops.FlushFileOp) (err error)

func (*Goofys) ForgetInode

func (fs *Goofys) ForgetInode(
	ctx context.Context,
	op *fuseops.ForgetInodeOp) (err error)

func (*Goofys) GetInodeAttributes

func (fs *Goofys) GetInodeAttributes(
	ctx context.Context,
	op *fuseops.GetInodeAttributesOp) (err error)

func (*Goofys) GetXattr

func (fs *Goofys) GetXattr(ctx context.Context,
	op *fuseops.GetXattrOp) (err error)

func (*Goofys) ListXattr

func (fs *Goofys) ListXattr(ctx context.Context,
	op *fuseops.ListXattrOp) (err error)

func (*Goofys) LookUpInode

func (fs *Goofys) LookUpInode(
	ctx context.Context,
	op *fuseops.LookUpInodeOp) (err error)

func (*Goofys) MkDir

func (fs *Goofys) MkDir(
	ctx context.Context,
	op *fuseops.MkDirOp) (err error)

func (*Goofys) Mount

func (fs *Goofys) Mount(mount *Mount)

func (*Goofys) MountAll

func (fs *Goofys) MountAll(mounts []*Mount)

func (*Goofys) OpenDir

func (fs *Goofys) OpenDir(
	ctx context.Context,
	op *fuseops.OpenDirOp) (err error)

func (*Goofys) OpenFile

func (fs *Goofys) OpenFile(
	ctx context.Context,
	op *fuseops.OpenFileOp) (err error)

func (*Goofys) ReadDir

func (fs *Goofys) ReadDir(
	ctx context.Context,
	op *fuseops.ReadDirOp) (err error)

func (*Goofys) ReadFile

func (fs *Goofys) ReadFile(
	ctx context.Context,
	op *fuseops.ReadFileOp) (err error)

func (*Goofys) ReleaseDirHandle

func (fs *Goofys) ReleaseDirHandle(
	ctx context.Context,
	op *fuseops.ReleaseDirHandleOp) (err error)

func (*Goofys) ReleaseFileHandle

func (fs *Goofys) ReleaseFileHandle(
	ctx context.Context,
	op *fuseops.ReleaseFileHandleOp) (err error)

func (*Goofys) RemoveXattr

func (fs *Goofys) RemoveXattr(ctx context.Context,
	op *fuseops.RemoveXattrOp) (err error)

func (*Goofys) Rename

func (fs *Goofys) Rename(
	ctx context.Context,
	op *fuseops.RenameOp) (err error)

rename("from", "to") causes the kernel to send lookup of "from" and "to" prior to sending rename to us

func (*Goofys) RmDir

func (fs *Goofys) RmDir(
	ctx context.Context,
	op *fuseops.RmDirOp) (err error)

func (*Goofys) SetInodeAttributes

func (fs *Goofys) SetInodeAttributes(
	ctx context.Context,
	op *fuseops.SetInodeAttributesOp) (err error)

func (*Goofys) SetXattr

func (fs *Goofys) SetXattr(ctx context.Context,
	op *fuseops.SetXattrOp) (err error)

func (*Goofys) SigUsr1

func (fs *Goofys) SigUsr1()

func (*Goofys) StatFS

func (fs *Goofys) StatFS(
	ctx context.Context,
	op *fuseops.StatFSOp) (err error)

func (*Goofys) SyncFile

func (fs *Goofys) SyncFile(
	ctx context.Context,
	op *fuseops.SyncFileOp) (err error)
func (fs *Goofys) Unlink(
	ctx context.Context,
	op *fuseops.UnlinkOp) (err error)

func (*Goofys) Unmount

func (fs *Goofys) Unmount(mountPoint string)

func (*Goofys) WriteFile

func (fs *Goofys) WriteFile(
	ctx context.Context,
	op *fuseops.WriteFileOp) (err error)

type HeadBlobInput

type HeadBlobInput struct {
	Key string
}

type HeadBlobOutput

type HeadBlobOutput struct {
	BlobItemOutput

	ContentType *string
	Metadata    map[string]*string
	IsDirBlob   bool

	RequestId string
}

type Inode

type Inode struct {
	Id   fuseops.InodeID
	Name *string

	Attributes InodeAttributes
	KnownSize  *uint64
	// It is generally safe to read `AttrTime` without locking because if some other
	// operation is modifying `AttrTime`, in most cases the reader is okay with working with
	// stale data. But Time is a struct and modifying it is not atomic. However
	// in practice (until the year 2157) we should be okay because
	// - Almost all uses of AttrTime will be about comparisions (AttrTime < x, AttrTime > x)
	// - Time object will have Time::monotonic bit set (until the year 2157) => the time
	//   comparision just compares Time::ext field
	// Ref: https://github.com/golang/go/blob/e42ae65a8507/src/time/time.go#L12:L56
	AttrTime time.Time

	// We are not very consistent about enforcing locks for `Parent` because, the
	// parent field very very rarely changes and it is generally fine to operate on
	// stale parent informaiton
	Parent *Inode

	Invalid     bool
	ImplicitDir bool
	// contains filtered or unexported fields
}

func NewInode

func NewInode(fs *Goofys, parent *Inode, name *string) (inode *Inode)

func (*Inode) Create

func (parent *Inode) Create(
	name string, metadata fuseops.OpContext) (inode *Inode, fh *FileHandle)

func (*Inode) DeRef

func (inode *Inode) DeRef(n uint64) (stale bool)

func (*Inode) FullName

func (inode *Inode) FullName() *string

func (*Inode) GetAttributes

func (inode *Inode) GetAttributes() (*fuseops.InodeAttributes, error)

func (*Inode) GetXattr

func (inode *Inode) GetXattr(name string) ([]byte, error)

func (*Inode) InflateAttributes

func (inode *Inode) InflateAttributes() (attr fuseops.InodeAttributes)

func (*Inode) ListXattr

func (inode *Inode) ListXattr() ([]string, error)

func (*Inode) LookUp

func (parent *Inode) LookUp(name string) (inode *Inode, err error)

func (*Inode) LookUpInodeDir

func (parent *Inode) LookUpInodeDir(name string, c chan ListBlobsOutput, errc chan error)

func (*Inode) LookUpInodeMaybeDir

func (parent *Inode) LookUpInodeMaybeDir(name string, fullName string) (inode *Inode, err error)

returned inode has nil Id

func (*Inode) LookUpInodeNotDir

func (parent *Inode) LookUpInodeNotDir(name string, c chan HeadBlobOutput, errc chan error)

func (*Inode) MkDir

func (parent *Inode) MkDir(
	name string) (inode *Inode, err error)

func (*Inode) OpenDir

func (inode *Inode) OpenDir() (dh *DirHandle)

func (*Inode) OpenFile

func (inode *Inode) OpenFile(metadata fuseops.OpContext) (fh *FileHandle, err error)

func (*Inode) Ref

func (inode *Inode) Ref()

LOCKS_REQUIRED(fs.mu) XXX why did I put lock required? This used to return a resurrect bool which no long does anything, need to look into that to see if that was legacy

func (*Inode) RemoveXattr

func (inode *Inode) RemoveXattr(name string) error

func (*Inode) Rename

func (parent *Inode) Rename(from string, newParent *Inode, to string) (err error)

semantic of rename: rename("any", "not_exists") = ok rename("file1", "file2") = ok rename("empty_dir1", "empty_dir2") = ok rename("nonempty_dir1", "empty_dir2") = ok rename("nonempty_dir1", "nonempty_dir2") = ENOTEMPTY rename("file", "dir") = EISDIR rename("dir", "file") = ENOTDIR

func (*Inode) ResetForUnmount

func (inode *Inode) ResetForUnmount()

ResetForUnmount resets the Inode as part of unmounting a storage backend mounted at the given inode. ACQUIRES_LOCK(inode.mu)

func (*Inode) RmDir

func (parent *Inode) RmDir(name string) (err error)

func (*Inode) SetFromBlobItem

func (inode *Inode) SetFromBlobItem(item *BlobItemOutput)

func (*Inode) SetXattr

func (inode *Inode) SetXattr(name string, value []byte, flags uint32) error

func (*Inode) ToDir

func (inode *Inode) ToDir()
func (parent *Inode) Unlink(name string) (err error)

type InodeAttributes

type InodeAttributes struct {
	Size  uint64
	Mtime time.Time
}

func (InodeAttributes) Equal

func (i InodeAttributes) Equal(other InodeAttributes) bool

type ListBlobsInput

type ListBlobsInput struct {
	Prefix            *string
	Delimiter         *string
	MaxKeys           *uint32
	StartAfter        *string // XXX: not supported by Azure
	ContinuationToken *string
}

func (ListBlobsInput) String

func (l ListBlobsInput) String() string

type ListBlobsOutput

type ListBlobsOutput struct {
	Prefixes              []BlobPrefixOutput
	Items                 []BlobItemOutput
	NextContinuationToken *string
	IsTruncated           bool

	RequestId string
}

type MBuf

type MBuf struct {
	// contains filtered or unexported fields
}

func (*MBuf) Close

func (mb *MBuf) Close() error

func (*MBuf) Free

func (mb *MBuf) Free()

func (*MBuf) Full

func (mb *MBuf) Full() bool

func (MBuf) Init

func (mb MBuf) Init(h *BufferPool, size uint64, block bool) *MBuf

func (*MBuf) Len

func (mb *MBuf) Len() (length int)

func (*MBuf) Read

func (mb *MBuf) Read(p []byte) (n int, err error)

func (*MBuf) Reset

func (mb *MBuf) Reset()

func (*MBuf) Seek

func (mb *MBuf) Seek(offset int64, whence int) (int64, error)

seek only seeks the reader

func (*MBuf) Write

func (mb *MBuf) Write(p []byte) (n int, err error)

func (*MBuf) WriteFrom

func (mb *MBuf) WriteFrom(r io.Reader) (n int, err error)

type MakeBucketInput

type MakeBucketInput struct {
}

type MakeBucketOutput

type MakeBucketOutput struct {
	RequestId string
}

type Mount

type Mount struct {
	// contains filtered or unexported fields
}

type MultipartBlobAbortOutput

type MultipartBlobAbortOutput struct {
	RequestId string
}

type MultipartBlobAddInput

type MultipartBlobAddInput struct {
	Commit     *MultipartBlobCommitInput
	PartNumber uint32

	Body io.ReadSeeker

	Size   uint64 // GCS wants to know part size
	Last   bool   // GCS needs to know if this part is the last one
	Offset uint64 // ADLv2 needs to know offset
}

func (MultipartBlobAddInput) String

func (b MultipartBlobAddInput) String() string

type MultipartBlobAddOutput

type MultipartBlobAddOutput struct {
	RequestId string
}

type MultipartBlobBeginInput

type MultipartBlobBeginInput struct {
	Key         string
	Metadata    map[string]*string
	ContentType *string
}

func (MultipartBlobBeginInput) String

func (b MultipartBlobBeginInput) String() string

type MultipartBlobCommitInput

type MultipartBlobCommitInput struct {
	Key *string

	Metadata map[string]*string
	UploadId *string
	Parts    []*string
	NumParts uint32
	// contains filtered or unexported fields
}

type MultipartBlobCommitOutput

type MultipartBlobCommitOutput struct {
	ETag         *string
	LastModified *time.Time
	StorageClass *string

	RequestId string
}

type MultipartExpireInput

type MultipartExpireInput struct {
}

type MultipartExpireOutput

type MultipartExpireOutput struct {
	RequestId string
}

type PutBlobInput

type PutBlobInput struct {
	Key         string
	Metadata    map[string]*string
	ContentType *string
	DirBlob     bool

	Body io.ReadSeeker
	Size *uint64
}

func (PutBlobInput) String

func (b PutBlobInput) String() string

type PutBlobOutput

type PutBlobOutput struct {
	ETag         *string
	LastModified *time.Time
	StorageClass *string

	RequestId string
}

type ReadSeekerCloser

type ReadSeekerCloser struct {
	io.ReadSeeker
}

func (*ReadSeekerCloser) Close

func (r *ReadSeekerCloser) Close() error

type ReaderProvider

type ReaderProvider func() (io.ReadCloser, error)

type RemoveBucketInput

type RemoveBucketInput struct {
}

type RemoveBucketOutput

type RemoveBucketOutput struct {
	RequestId string
}

type RenameBlobInput

type RenameBlobInput struct {
	Source      string
	Destination string
}

type RenameBlobOutput

type RenameBlobOutput struct {
	RequestId string
}

type S3Backend

type S3Backend struct {
	*s3.S3
	// contains filtered or unexported fields
}

func NewS3

func NewS3(bucket string, flags *FlagStorage, config *S3Config) (*S3Backend, error)

func (*S3Backend) Bucket

func (s *S3Backend) Bucket() string

func (*S3Backend) Capabilities

func (s *S3Backend) Capabilities() *Capabilities

func (*S3Backend) CopyBlob

func (s *S3Backend) CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)

func (*S3Backend) Delegate

func (s *S3Backend) Delegate() interface{}

func (*S3Backend) DeleteBlob

func (s *S3Backend) DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)

func (*S3Backend) DeleteBlobs

func (s *S3Backend) DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)

func (*S3Backend) GetBlob

func (s *S3Backend) GetBlob(param *GetBlobInput) (*GetBlobOutput, error)

func (*S3Backend) HeadBlob

func (s *S3Backend) HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)

func (*S3Backend) Init

func (s *S3Backend) Init(key string) error

func (*S3Backend) ListBlobs

func (s *S3Backend) ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)

func (*S3Backend) ListObjectsV2

func (s *S3Backend) ListObjectsV2(params *s3.ListObjectsV2Input) (*s3.ListObjectsV2Output, string, error)

func (*S3Backend) MakeBucket

func (s *S3Backend) MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)

func (*S3Backend) MultipartBlobAbort

func (s *S3Backend) MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)

func (*S3Backend) MultipartBlobAdd

func (s *S3Backend) MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)

func (*S3Backend) MultipartBlobBegin

func (s *S3Backend) MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)

func (*S3Backend) MultipartBlobCommit

func (s *S3Backend) MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)

func (*S3Backend) MultipartExpire

func (s *S3Backend) MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)

func (*S3Backend) PutBlob

func (s *S3Backend) PutBlob(param *PutBlobInput) (*PutBlobOutput, error)

func (*S3Backend) RemoveBucket

func (s *S3Backend) RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)

func (*S3Backend) RenameBlob

func (s *S3Backend) RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)

type S3ReadBuffer

type S3ReadBuffer struct {
	// contains filtered or unexported fields
}

func (S3ReadBuffer) Init

func (b S3ReadBuffer) Init(fh *FileHandle, offset uint64, size uint32) *S3ReadBuffer

func (*S3ReadBuffer) Read

func (b *S3ReadBuffer) Read(offset uint64, p []byte) (n int, err error)

type StorageBackend

type StorageBackend interface {
	Init(key string) error
	Capabilities() *Capabilities
	// typically this would return bucket/prefix
	Bucket() string
	HeadBlob(param *HeadBlobInput) (*HeadBlobOutput, error)
	ListBlobs(param *ListBlobsInput) (*ListBlobsOutput, error)
	DeleteBlob(param *DeleteBlobInput) (*DeleteBlobOutput, error)
	DeleteBlobs(param *DeleteBlobsInput) (*DeleteBlobsOutput, error)
	RenameBlob(param *RenameBlobInput) (*RenameBlobOutput, error)
	CopyBlob(param *CopyBlobInput) (*CopyBlobOutput, error)
	GetBlob(param *GetBlobInput) (*GetBlobOutput, error)
	PutBlob(param *PutBlobInput) (*PutBlobOutput, error)
	MultipartBlobBegin(param *MultipartBlobBeginInput) (*MultipartBlobCommitInput, error)
	MultipartBlobAdd(param *MultipartBlobAddInput) (*MultipartBlobAddOutput, error)
	MultipartBlobAbort(param *MultipartBlobCommitInput) (*MultipartBlobAbortOutput, error)
	MultipartBlobCommit(param *MultipartBlobCommitInput) (*MultipartBlobCommitOutput, error)
	MultipartExpire(param *MultipartExpireInput) (*MultipartExpireOutput, error)
	RemoveBucket(param *RemoveBucketInput) (*RemoveBucketOutput, error)
	MakeBucket(param *MakeBucketInput) (*MakeBucketOutput, error)
	Delegate() interface{}
}

/ Implementations of all the functions here are expected to be / concurrency-safe, except for / / Init() is called exactly once before any other functions are / called. / / Capabilities()/Bucket() are expected to be const

func NewBackend

func NewBackend(bucket string, flags *FlagStorage) (cloud StorageBackend, err error)

type StorageBackendInitError

type StorageBackendInitError struct {
	// contains filtered or unexported fields
}

func (StorageBackendInitError) Bucket

func (s StorageBackendInitError) Bucket() string

func (StorageBackendInitError) Capabilities

func (e StorageBackendInitError) Capabilities() *Capabilities

func (StorageBackendInitError) CopyBlob

func (StorageBackendInitError) Delegate

func (e StorageBackendInitError) Delegate() interface{}

func (StorageBackendInitError) DeleteBlob

func (StorageBackendInitError) DeleteBlobs

func (StorageBackendInitError) GetBlob

func (StorageBackendInitError) HeadBlob

func (StorageBackendInitError) Init

func (e StorageBackendInitError) Init(key string) error

func (StorageBackendInitError) ListBlobs

func (StorageBackendInitError) MakeBucket

func (StorageBackendInitError) MultipartBlobAbort

func (StorageBackendInitError) MultipartBlobAdd

func (StorageBackendInitError) MultipartBlobBegin

func (StorageBackendInitError) MultipartBlobCommit

func (StorageBackendInitError) MultipartExpire

func (StorageBackendInitError) PutBlob

func (StorageBackendInitError) RemoveBucket

func (StorageBackendInitError) RenameBlob

type StorageBackendInitWrapper

type StorageBackendInitWrapper struct {
	StorageBackend
	// contains filtered or unexported fields
}

func (*StorageBackendInitWrapper) Bucket

func (s *StorageBackendInitWrapper) Bucket() string

func (*StorageBackendInitWrapper) Capabilities

func (s *StorageBackendInitWrapper) Capabilities() *Capabilities

func (*StorageBackendInitWrapper) CopyBlob

func (*StorageBackendInitWrapper) DeleteBlob

func (*StorageBackendInitWrapper) DeleteBlobs

func (*StorageBackendInitWrapper) GetBlob

func (*StorageBackendInitWrapper) HeadBlob

func (*StorageBackendInitWrapper) Init

func (s *StorageBackendInitWrapper) Init(key string) error

func (*StorageBackendInitWrapper) ListBlobs

func (*StorageBackendInitWrapper) MakeBucket

func (*StorageBackendInitWrapper) MultipartBlobAbort

func (*StorageBackendInitWrapper) MultipartBlobAdd

func (*StorageBackendInitWrapper) MultipartBlobBegin

func (*StorageBackendInitWrapper) MultipartBlobCommit

func (*StorageBackendInitWrapper) MultipartExpire

func (*StorageBackendInitWrapper) PutBlob

func (*StorageBackendInitWrapper) RemoveBucket

func (*StorageBackendInitWrapper) RenameBlob

type Ticket

type Ticket struct {
	Total uint32
	// contains filtered or unexported fields
}

func (Ticket) Init

func (ticket Ticket) Init() *Ticket

func (*Ticket) Return

func (ticket *Ticket) Return(howmany uint32)

func (*Ticket) Take

func (ticket *Ticket) Take(howmany uint32, block bool) (took bool)

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL