internal

package
v0.24.0 Latest Latest
Warning

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

Go to latest
Published: Apr 4, 2020 License: Apache-2.0 Imports: 52 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

Functions

func Dup added in v0.0.14

func Dup(value []byte) []byte

func GetTgid added in v0.22.0

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

GetTgid returns the tgid for the given pid.

func IsADLv1Endpoint added in v0.21.0

func IsADLv1Endpoint(endpoint string) bool

func IsADLv2Endpoint added in v0.21.0

func IsADLv2Endpoint(endpoint string) bool

func MassageMountFlags added in v0.0.3

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

func MaxInt added in v0.0.4

func MaxInt(a, b int) int

func MaxInt64 added in v0.21.0

func MaxInt64(a, b int64) int64

func MaxUInt32 added in v0.0.11

func MaxUInt32(a, b uint32) uint32

func MaxUInt64 added in v0.0.4

func MaxUInt64(a, b uint64) uint64

func MinInt added in v0.0.4

func MinInt(a, b int) int

func MinInt64 added in v0.21.0

func MinInt64(a, b int64) int64

func MinUInt32 added in v0.0.11

func MinUInt32(a, b uint32) uint32

func MinUInt64 added in v0.0.4

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 PBool added in v0.21.0

func PBool(v bool) *bool

func PInt32 added in v0.21.0

func PInt32(v int32) *int32

func PInt64 added in v0.21.0

func PInt64(v int64) *int64

func PString added in v0.21.0

func PString(v string) *string

func PTime added in v0.21.0

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

func PUInt32 added in v0.21.0

func PUInt32(v uint32) *uint32

func PUInt64 added in v0.21.0

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 added in v0.0.4

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 added in v0.0.18

func TryUnmount(mountPoint string) (err error)

Types

type ADL2Error added in v0.21.0

type ADL2Error struct {
	adl2.DataLakeStorageError
}

func (ADL2Error) Error added in v0.21.0

func (e ADL2Error) Error() string

type ADLv1 added in v0.21.0

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

func NewADLv1 added in v0.21.0

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

func (*ADLv1) Bucket added in v0.21.0

func (b *ADLv1) Bucket() string

func (*ADLv1) Capabilities added in v0.21.0

func (b *ADLv1) Capabilities() *Capabilities

func (*ADLv1) CopyBlob added in v0.21.0

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

func (*ADLv1) Delegate added in v0.23.0

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

func (*ADLv1) DeleteBlob added in v0.21.0

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

func (*ADLv1) DeleteBlobs added in v0.21.0

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

func (*ADLv1) GetBlob added in v0.21.0

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

func (*ADLv1) HeadBlob added in v0.21.0

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

func (*ADLv1) Init added in v0.21.0

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

func (*ADLv1) ListBlobs added in v0.21.0

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

func (*ADLv1) MakeBucket added in v0.21.0

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

func (*ADLv1) MultipartBlobAbort added in v0.21.0

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

func (*ADLv1) MultipartBlobAdd added in v0.21.0

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

func (*ADLv1) MultipartBlobBegin added in v0.21.0

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

func (*ADLv1) MultipartBlobCommit added in v0.21.0

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

func (*ADLv1) MultipartExpire added in v0.21.0

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

func (*ADLv1) PutBlob added in v0.21.0

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

func (*ADLv1) RemoveBucket added in v0.21.0

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

func (*ADLv1) RenameBlob added in v0.21.0

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

type ADLv1Err added in v0.21.0

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

func (ADLv1Err) Error added in v0.21.0

func (err ADLv1Err) Error() string

type ADLv1MultipartBlobCommitInput added in v0.21.0

type ADLv1MultipartBlobCommitInput struct {
	Size uint64
}

type ADLv2 added in v0.21.0

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

func NewADLv2 added in v0.21.0

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

func (*ADLv2) Bucket added in v0.21.0

func (b *ADLv2) Bucket() string

func (*ADLv2) Capabilities added in v0.21.0

func (b *ADLv2) Capabilities() *Capabilities

func (*ADLv2) CopyBlob added in v0.21.0

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

func (*ADLv2) Delegate added in v0.23.0

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

func (*ADLv2) DeleteBlob added in v0.21.0

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

func (*ADLv2) DeleteBlobs added in v0.21.0

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

func (*ADLv2) GetBlob added in v0.21.0

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

func (*ADLv2) HeadBlob added in v0.21.0

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

func (*ADLv2) Init added in v0.21.0

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

func (*ADLv2) ListBlobs added in v0.21.0

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

func (*ADLv2) MakeBucket added in v0.21.0

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

func (*ADLv2) MultipartBlobAbort added in v0.21.0

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

func (*ADLv2) MultipartBlobAdd added in v0.21.0

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

func (*ADLv2) MultipartBlobBegin added in v0.21.0

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 added in v0.21.0

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

func (*ADLv2) MultipartExpire added in v0.21.0

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

func (*ADLv2) PutBlob added in v0.21.0

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

func (*ADLv2) RemoveBucket added in v0.21.0

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

func (*ADLv2) RenameBlob added in v0.21.0

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

type ADLv2MultipartBlobCommitInput added in v0.21.0

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

type AZBlob added in v0.21.0

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

func NewAZBlob added in v0.21.0

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

func (*AZBlob) Bucket added in v0.21.0

func (b *AZBlob) Bucket() string

func (*AZBlob) Capabilities added in v0.21.0

func (b *AZBlob) Capabilities() *Capabilities

func (*AZBlob) CopyBlob added in v0.21.0

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

func (*AZBlob) Delegate added in v0.23.0

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

func (*AZBlob) DeleteBlob added in v0.21.0

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

func (*AZBlob) DeleteBlobs added in v0.21.0

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

func (*AZBlob) GetBlob added in v0.21.0

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

func (*AZBlob) HeadBlob added in v0.21.0

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

func (*AZBlob) Init added in v0.21.0

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

func (*AZBlob) ListBlobs added in v0.21.0

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

func (*AZBlob) MakeBucket added in v0.21.0

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

func (*AZBlob) MultipartBlobAbort added in v0.21.0

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

func (*AZBlob) MultipartBlobAdd added in v0.21.0

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

func (*AZBlob) MultipartBlobBegin added in v0.21.0

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

func (*AZBlob) MultipartBlobCommit added in v0.21.0

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

func (*AZBlob) MultipartExpire added in v0.21.0

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

func (*AZBlob) PutBlob added in v0.21.0

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

func (*AZBlob) RemoveBucket added in v0.21.0

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

func (*AZBlob) RenameBlob added in v0.21.0

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

type BlobItemOutput added in v0.21.0

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

func (BlobItemOutput) String added in v0.21.0

func (b BlobItemOutput) String() string

type BlobPrefixOutput added in v0.21.0

type BlobPrefixOutput struct {
	Prefix *string
}

func (BlobPrefixOutput) String added in v0.21.0

func (b BlobPrefixOutput) String() string

type BucketSpec added in v0.21.0

type BucketSpec struct {
	Scheme string
	Bucket string
	Prefix string
}

func ParseBucketSpec added in v0.21.0

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

type Buffer added in v0.0.4

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

func (*Buffer) Close added in v0.0.4

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

func (Buffer) Init added in v0.0.4

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

func (*Buffer) ReInit added in v0.23.0

func (b *Buffer) ReInit(r ReaderProvider)

func (*Buffer) Read added in v0.0.4

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 added in v0.0.7

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

func (BufferPool) Init added in v0.0.4

func (pool BufferPool) Init() *BufferPool

func (*BufferPool) MaybeGC added in v0.0.6

func (pool *BufferPool) MaybeGC()

func (*BufferPool) RequestBuffer added in v0.0.7

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

func (*BufferPool) RequestMultiple added in v0.0.7

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

type Capabilities added in v0.21.0

type Capabilities struct {
	NoParallelMultipart bool
	MaxMultipartSize    uint64
	// indicates that the blob store has native support for directories
	DirBlob bool
	Name    string
}

type CopyBlobInput added in v0.21.0

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
}

type CopyBlobOutput added in v0.21.0

type CopyBlobOutput struct {
	RequestId string
}

type Delegator added in v0.23.0

type Delegator interface {
	Delegate() interface{}
}

type DeleteBlobInput added in v0.21.0

type DeleteBlobInput struct {
	Key string
}

type DeleteBlobOutput added in v0.21.0

type DeleteBlobOutput struct {
	RequestId string
}

type DeleteBlobsInput added in v0.21.0

type DeleteBlobsInput struct {
	Items []string
}

type DeleteBlobsOutput added in v0.21.0

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 added in v0.0.14

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

type DirInodeData added in v0.0.17

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.OpMetadata) *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 added in v0.0.4

func (fh *FileHandle) Release()

func (*FileHandle) WriteFile

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

type GCS3 added in v0.21.0

type GCS3 struct {
	*S3Backend
}

GCS variant of S3

func NewGCS3 added in v0.21.0

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

func (*GCS3) Delegate added in v0.23.0

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

func (*GCS3) DeleteBlobs added in v0.21.0

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

func (*GCS3) MultipartBlobAdd added in v0.21.0

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

func (*GCS3) MultipartBlobBegin added in v0.21.0

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

func (*GCS3) MultipartBlobCommit added in v0.21.0

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

type GCSMultipartBlobCommitInput added in v0.21.0

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

type GetBlobInput added in v0.21.0

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

type GetBlobOutput added in v0.21.0

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 added in v0.0.14

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

func (*Goofys) ListXattr added in v0.0.14

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 added in v0.21.0

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

func (*Goofys) MountAll added in v0.21.0

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 added in v0.0.14

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 added in v0.0.14

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

func (*Goofys) SigUsr1 added in v0.0.18

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 added in v0.21.0

func (fs *Goofys) Unmount(mountPoint string)

func (*Goofys) WriteFile

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

type HeadBlobInput added in v0.21.0

type HeadBlobInput struct {
	Key string
}

type HeadBlobOutput added in v0.21.0

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.OpMetadata) (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 added in v0.0.14

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

func (*Inode) InflateAttributes added in v0.0.17

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

func (*Inode) ListXattr added in v0.0.14

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

func (*Inode) LookUp

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

func (*Inode) LookUpInodeDir added in v0.0.17

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

func (*Inode) LookUpInodeMaybeDir added in v0.0.17

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

returned inode has nil Id

func (*Inode) LookUpInodeNotDir added in v0.0.17

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.OpMetadata) (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 added in v0.0.14

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 added in v0.21.0

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 added in v0.21.0

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

func (*Inode) SetXattr added in v0.0.14

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

func (*Inode) ToDir added in v0.0.17

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

type InodeAttributes added in v0.0.17

type InodeAttributes struct {
	Size  uint64
	Mtime time.Time
}

func (InodeAttributes) Equal added in v0.24.0

func (i InodeAttributes) Equal(other InodeAttributes) bool

type ListBlobsInput added in v0.21.0

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

type ListBlobsOutput added in v0.21.0

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

	RequestId string
}

type MBuf added in v0.0.4

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

func (*MBuf) Close added in v0.21.0

func (mb *MBuf) Close() error

func (*MBuf) Free added in v0.0.4

func (mb *MBuf) Free()

func (*MBuf) Full added in v0.0.7

func (mb *MBuf) Full() bool

func (MBuf) Init added in v0.0.4

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

func (*MBuf) Len added in v0.19.0

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

func (*MBuf) Read added in v0.0.4

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

func (*MBuf) Reset added in v0.23.0

func (mb *MBuf) Reset()

func (*MBuf) Seek added in v0.0.7

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

seek only seeks the reader

func (*MBuf) Write added in v0.0.7

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

func (*MBuf) WriteFrom added in v0.0.4

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

type MakeBucketInput added in v0.21.0

type MakeBucketInput struct {
}

type MakeBucketOutput added in v0.21.0

type MakeBucketOutput struct {
	RequestId string
}

type Mount added in v0.21.0

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

type MultipartBlobAbortOutput added in v0.21.0

type MultipartBlobAbortOutput struct {
	RequestId string
}

type MultipartBlobAddInput added in v0.21.0

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
}

type MultipartBlobAddOutput added in v0.21.0

type MultipartBlobAddOutput struct {
	RequestId string
}

type MultipartBlobBeginInput added in v0.21.0

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

type MultipartBlobCommitInput added in v0.21.0

type MultipartBlobCommitInput struct {
	Key *string

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

type MultipartBlobCommitOutput added in v0.21.0

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

	RequestId string
}

type MultipartExpireInput added in v0.21.0

type MultipartExpireInput struct {
}

type MultipartExpireOutput added in v0.21.0

type MultipartExpireOutput struct {
	RequestId string
}

type PutBlobInput added in v0.21.0

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

	Body io.ReadSeeker
	Size *uint64
}

type PutBlobOutput added in v0.21.0

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

	RequestId string
}

type ReadSeekerCloser added in v0.21.0

type ReadSeekerCloser struct {
	io.ReadSeeker
}

func (*ReadSeekerCloser) Close added in v0.21.0

func (r *ReadSeekerCloser) Close() error

type ReaderProvider added in v0.0.4

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

type RemoveBucketInput added in v0.21.0

type RemoveBucketInput struct {
}

type RemoveBucketOutput added in v0.21.0

type RemoveBucketOutput struct {
	RequestId string
}

type RenameBlobInput added in v0.21.0

type RenameBlobInput struct {
	Source      string
	Destination string
}

type RenameBlobOutput added in v0.21.0

type RenameBlobOutput struct {
	RequestId string
}

type S3Backend added in v0.20.0

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

func NewS3 added in v0.21.0

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

func (*S3Backend) Bucket added in v0.21.0

func (s *S3Backend) Bucket() string

func (*S3Backend) Capabilities added in v0.21.0

func (s *S3Backend) Capabilities() *Capabilities

func (*S3Backend) CopyBlob added in v0.21.0

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

func (*S3Backend) Delegate added in v0.23.0

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

func (*S3Backend) DeleteBlob added in v0.21.0

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

func (*S3Backend) DeleteBlobs added in v0.21.0

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

func (*S3Backend) GetBlob added in v0.21.0

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

func (*S3Backend) HeadBlob added in v0.21.0

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

func (*S3Backend) Init added in v0.21.0

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

func (*S3Backend) ListBlobs added in v0.21.0

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

func (*S3Backend) ListObjectsV2 added in v0.20.0

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

func (*S3Backend) MakeBucket added in v0.21.0

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

func (*S3Backend) MultipartBlobAbort added in v0.21.0

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

func (*S3Backend) MultipartBlobAdd added in v0.21.0

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

func (*S3Backend) MultipartBlobBegin added in v0.21.0

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

func (*S3Backend) MultipartBlobCommit added in v0.21.0

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

func (*S3Backend) MultipartExpire added in v0.21.0

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

func (*S3Backend) PutBlob added in v0.21.0

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

func (*S3Backend) RemoveBucket added in v0.21.0

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

func (*S3Backend) RenameBlob added in v0.21.0

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

type S3ReadBuffer added in v0.0.4

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

func (S3ReadBuffer) Init added in v0.0.4

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

func (*S3ReadBuffer) Read added in v0.0.4

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

type StorageBackend added in v0.21.0

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 added in v0.21.0

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

type StorageBackendInitError added in v0.21.0

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

func (StorageBackendInitError) Bucket added in v0.21.0

func (s StorageBackendInitError) Bucket() string

func (StorageBackendInitError) Capabilities added in v0.21.0

func (e StorageBackendInitError) Capabilities() *Capabilities

func (StorageBackendInitError) CopyBlob added in v0.21.0

func (StorageBackendInitError) Delegate added in v0.23.0

func (e StorageBackendInitError) Delegate() interface{}

func (StorageBackendInitError) DeleteBlob added in v0.21.0

func (StorageBackendInitError) DeleteBlobs added in v0.21.0

func (StorageBackendInitError) GetBlob added in v0.21.0

func (StorageBackendInitError) HeadBlob added in v0.21.0

func (StorageBackendInitError) Init added in v0.21.0

func (e StorageBackendInitError) Init(key string) error

func (StorageBackendInitError) ListBlobs added in v0.21.0

func (StorageBackendInitError) MakeBucket added in v0.21.0

func (StorageBackendInitError) MultipartBlobAbort added in v0.21.0

func (StorageBackendInitError) MultipartBlobAdd added in v0.21.0

func (StorageBackendInitError) MultipartBlobBegin added in v0.21.0

func (StorageBackendInitError) MultipartBlobCommit added in v0.21.0

func (StorageBackendInitError) MultipartExpire added in v0.21.0

func (StorageBackendInitError) PutBlob added in v0.21.0

func (StorageBackendInitError) RemoveBucket added in v0.21.0

func (StorageBackendInitError) RenameBlob added in v0.21.0

type StorageBackendInitWrapper added in v0.21.0

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

func (*StorageBackendInitWrapper) Bucket added in v0.21.0

func (s *StorageBackendInitWrapper) Bucket() string

func (*StorageBackendInitWrapper) Capabilities added in v0.21.0

func (s *StorageBackendInitWrapper) Capabilities() *Capabilities

func (*StorageBackendInitWrapper) CopyBlob added in v0.21.0

func (*StorageBackendInitWrapper) DeleteBlob added in v0.21.0

func (*StorageBackendInitWrapper) DeleteBlobs added in v0.21.0

func (*StorageBackendInitWrapper) GetBlob added in v0.21.0

func (*StorageBackendInitWrapper) HeadBlob added in v0.21.0

func (*StorageBackendInitWrapper) Init added in v0.21.0

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

func (*StorageBackendInitWrapper) ListBlobs added in v0.21.0

func (*StorageBackendInitWrapper) MakeBucket added in v0.21.0

func (*StorageBackendInitWrapper) MultipartBlobAbort added in v0.21.0

func (*StorageBackendInitWrapper) MultipartBlobAdd added in v0.21.0

func (*StorageBackendInitWrapper) MultipartBlobBegin added in v0.21.0

func (*StorageBackendInitWrapper) MultipartBlobCommit added in v0.21.0

func (*StorageBackendInitWrapper) MultipartExpire added in v0.21.0

func (*StorageBackendInitWrapper) PutBlob added in v0.21.0

func (*StorageBackendInitWrapper) RemoveBucket added in v0.21.0

func (*StorageBackendInitWrapper) RenameBlob added in v0.21.0

type Ticket added in v0.0.7

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

func (Ticket) Init added in v0.0.7

func (ticket Ticket) Init() *Ticket

func (*Ticket) Return added in v0.0.7

func (ticket *Ticket) Return(howmany uint32)

func (*Ticket) Take added in v0.0.7

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