internal

package
v1.0.4 Latest Latest
Warning

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

Go to latest
Published: May 12, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type ClientBase

type ClientBase interface {
	List(ctx context.Context, key string) ([]string, error)
	GetObject(ctx context.Context, key string) (*Object, error)
	IsDirectory(ctx context.Context, key string) (bool, error)
	GetDirectoryInfo(ctx context.Context, key string) (*DirectoryInfo, error)
	CreateObject(ctx context.Context, key string) (*Object, error)
	DeleteObject(ctx context.Context, key string) error
	Close()
}

type DirectoryInfo

type DirectoryInfo struct {
	SumContentByte int64
	LastModified   int64 // 最終更新日
}

type Node

type Node struct {
	fs.Inode

	Client ClientBase

	IsDirectory   bool
	DirectoryInfo *DirectoryInfo
	// contains filtered or unexported fields
}

func (*Node) Create

func (r *Node) Create(ctx context.Context, name string, flags uint32, mode uint32, out *fuse.EntryOut) (node *fs.Inode, fh fs.FileHandle, fuseFlags uint32, errno syscall.Errno)

func (*Node) Getattr

func (r *Node) Getattr(ctx context.Context, fh fs.FileHandle, out *fuse.AttrOut) syscall.Errno

func (*Node) Lookup

func (r *Node) Lookup(ctx context.Context, name string, out *fuse.EntryOut) (*fs.Inode, syscall.Errno)

func (*Node) Readdir

func (r *Node) Readdir(ctx context.Context) (fs.DirStream, syscall.Errno)
func (r *Node) Unlink(ctx context.Context, name string) syscall.Errno

type Object

type Object struct {
	Body              io.Reader
	ContentLengthByte int64
	LastModified      int64 // 最終更新日
}

type S3Client

type S3Client struct {
	Client     *s3v2.Client
	BucketName string
}

func (*S3Client) Close

func (receiver *S3Client) Close()

func (*S3Client) CreateObject

func (receiver *S3Client) CreateObject(ctx context.Context, key string) (*Object, error)

func (*S3Client) DeleteObject

func (receiver *S3Client) DeleteObject(ctx context.Context, key string) error

func (*S3Client) GetDirectoryInfo

func (receiver *S3Client) GetDirectoryInfo(ctx context.Context, key string) (*DirectoryInfo, error)

func (*S3Client) GetObject

func (receiver *S3Client) GetObject(ctx context.Context, key string) (*Object, error)

func (*S3Client) IsDirectory

func (receiver *S3Client) IsDirectory(ctx context.Context, key string) (bool, error)

func (*S3Client) List

func (receiver *S3Client) List(ctx context.Context, key string) ([]string, error)

Jump to

Keyboard shortcuts

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