Documentation ¶
Index ¶
- Constants
- Variables
- func ExportRsaPrivateKeyToPem(key *rsa.PrivateKey, passphrase string) string
- func GetHttpClient() *http.Client
- func IsErrReplicating(err error) bool
- func ListAll(store ObjectStorage, prefix, marker string, followLink bool) (<-chan Object, error)
- func ListAllWithDelimiter(store ObjectStorage, prefix, start, end string, followLink bool) (<-chan Object, error)
- func MarshalObject(o Object) map[string]interface{}
- func ParseRsaPrivateKeyFromPath(path, passphrase string) (*rsa.PrivateKey, error)
- func ParseRsaPrivateKeyFromPem(enc []byte, passphrase []byte) (*rsa.PrivateKey, error)
- func Register(name string, register Creator)
- type COS
- func (c *COS) AbortUpload(key string, uploadID string)
- func (c *COS) CompleteUpload(key string, uploadID string, parts []*Part) error
- func (c *COS) Copy(dst, src string) error
- func (c *COS) Create() error
- func (c *COS) CreateMultipartUpload(key string) (*MultipartUpload, error)
- func (c *COS) Delete(key string) error
- func (c *COS) Get(key string, off, limit int64) (io.ReadCloser, error)
- func (c *COS) Head(key string) (Object, error)
- func (c *COS) Limits() Limits
- func (c *COS) List(prefix, marker, delimiter string, limit int64, followLink bool) ([]Object, error)
- func (c *COS) ListAll(prefix, marker string, followLink bool) (<-chan Object, error)
- func (c *COS) ListUploads(marker string) ([]*PendingPart, string, error)
- func (c *COS) Put(key string, in io.Reader) error
- func (c *COS) SetStorageClass(sc string)
- func (c *COS) String() string
- func (c *COS) UploadPart(key string, uploadID string, num int, body []byte) (*Part, error)
- func (c *COS) UploadPartCopy(key string, uploadID string, num int, srcKey string, off, size int64) (*Part, error)
- type Contents
- type Creator
- type DataItem
- type DefaultObjectStorage
- func (s DefaultObjectStorage) AbortUpload(key string, uploadID string)
- func (s DefaultObjectStorage) CompleteUpload(key string, uploadID string, parts []*Part) error
- func (s DefaultObjectStorage) Copy(dst, src string) error
- func (s DefaultObjectStorage) Create() error
- func (s DefaultObjectStorage) CreateMultipartUpload(key string) (*MultipartUpload, error)
- func (s DefaultObjectStorage) Head(key string) (Object, error)
- func (s DefaultObjectStorage) Limits() Limits
- func (s DefaultObjectStorage) List(prefix, marker, delimiter string, limit int64, followLink bool) ([]Object, error)
- func (s DefaultObjectStorage) ListAll(prefix, marker string, followLink bool) (<-chan Object, error)
- func (s DefaultObjectStorage) ListUploads(marker string) ([]*PendingPart, string, error)
- func (s DefaultObjectStorage) UploadPart(key string, uploadID string, num int, body []byte) (*Part, error)
- func (s DefaultObjectStorage) UploadPartCopy(key string, uploadID string, num int, srcKey string, off, size int64) (*Part, error)
- type Encryptor
- type File
- type FileSystem
- type Limits
- type ListBucketResult
- type MtimeChanger
- type MultipartUpload
- type Object
- type ObjectStorage
- func CreateStorage(name, endpoint, accessKey, secretKey, token string) (ObjectStorage, error)
- func NewEncrypted(o ObjectStorage, enc Encryptor) ObjectStorage
- func NewSharded(name, endpoint, ak, sk, token string, shards int) (ObjectStorage, error)
- func WithPrefix(os ObjectStorage, prefix string) ObjectStorage
- type Part
- type PendingPart
- type RestfulStorage
- func (s *RestfulStorage) Copy(dst, src string) error
- func (s *RestfulStorage) Delete(key string) error
- func (s *RestfulStorage) Get(key string, off, limit int64) (io.ReadCloser, error)
- func (s *RestfulStorage) Head(key string) (Object, error)
- func (s *RestfulStorage) List(prefix, marker, delimiter string, limit int64, followLink bool) ([]Object, error)
- func (u *RestfulStorage) Put(key string, body io.Reader) error
- func (s *RestfulStorage) String() string
- type SectionReaderCloser
- type SupportStorageClass
- type SupportSymlink
Constants ¶
View Source
const ( AES256GCM_RSA = "aes256gcm-rsa" CHACHA20_RSA = "chacha20-rsa" )
Variables ¶
View Source
var HEADER_NAMES = []string{"Content-MD5", "Content-Type", "Date"}
View Source
var OVHCompileRegexp = `^s3\.(\w*)(\.\w*)?\.cloud\.ovh\.net$`
View Source
var ReqIDCache reqIDCache
View Source
var TryCFR bool // try copy_file_range
View Source
var UserAgent = "JuiceFS"
Functions ¶
func ExportRsaPrivateKeyToPem ¶
func ExportRsaPrivateKeyToPem(key *rsa.PrivateKey, passphrase string) string
func GetHttpClient ¶
func IsErrReplicating ¶
func ListAll ¶
func ListAll(store ObjectStorage, prefix, marker string, followLink bool) (<-chan Object, error)
ListAll on all the keys that starts at marker from object storage.
func ListAllWithDelimiter ¶
func ListAllWithDelimiter(store ObjectStorage, prefix, start, end string, followLink bool) (<-chan Object, error)
func MarshalObject ¶
func ParseRsaPrivateKeyFromPath ¶
func ParseRsaPrivateKeyFromPath(path, passphrase string) (*rsa.PrivateKey, error)
func ParseRsaPrivateKeyFromPem ¶
func ParseRsaPrivateKeyFromPem(enc []byte, passphrase []byte) (*rsa.PrivateKey, error)
Types ¶
type COS ¶
type COS struct {
// contains filtered or unexported fields
}
func (*COS) AbortUpload ¶
func (*COS) CompleteUpload ¶
func (*COS) CreateMultipartUpload ¶
func (c *COS) CreateMultipartUpload(key string) (*MultipartUpload, error)
func (*COS) ListUploads ¶
func (c *COS) ListUploads(marker string) ([]*PendingPart, string, error)
func (*COS) SetStorageClass ¶
func (*COS) UploadPart ¶
type Creator ¶
type Creator func(bucket, accessKey, secretKey, token string) (ObjectStorage, error)
type DefaultObjectStorage ¶
type DefaultObjectStorage struct{}
func (DefaultObjectStorage) AbortUpload ¶
func (s DefaultObjectStorage) AbortUpload(key string, uploadID string)
func (DefaultObjectStorage) CompleteUpload ¶
func (s DefaultObjectStorage) CompleteUpload(key string, uploadID string, parts []*Part) error
func (DefaultObjectStorage) Copy ¶
func (s DefaultObjectStorage) Copy(dst, src string) error
func (DefaultObjectStorage) Create ¶
func (s DefaultObjectStorage) Create() error
func (DefaultObjectStorage) CreateMultipartUpload ¶
func (s DefaultObjectStorage) CreateMultipartUpload(key string) (*MultipartUpload, error)
func (DefaultObjectStorage) Limits ¶
func (s DefaultObjectStorage) Limits() Limits
func (DefaultObjectStorage) ListAll ¶
func (s DefaultObjectStorage) ListAll(prefix, marker string, followLink bool) (<-chan Object, error)
func (DefaultObjectStorage) ListUploads ¶
func (s DefaultObjectStorage) ListUploads(marker string) ([]*PendingPart, string, error)
func (DefaultObjectStorage) UploadPart ¶
func (DefaultObjectStorage) UploadPartCopy ¶
type Encryptor ¶
type Encryptor interface { Encrypt(plaintext []byte) ([]byte, error) Decrypt(ciphertext []byte) ([]byte, error) }
func NewDataEncryptor ¶
func NewRSAEncryptor ¶
func NewRSAEncryptor(privKey *rsa.PrivateKey) Encryptor
type FileSystem ¶
type ListBucketResult ¶ added in v0.1.4
type ListBucketResult struct { Contents []*Contents IsTruncated bool Prefix string Marker string MaxKeys string NextMarker string CommonPrefixes []string }
ListObjectsOutput presents output for ListObjects.
type MultipartUpload ¶
type Object ¶
type Object interface { Key() string Size() int64 Mtime() time.Time IsDir() bool IsSymlink() bool StorageClass() string }
func UnmarshalObject ¶
type ObjectStorage ¶
type ObjectStorage interface { // Description of the object storage. String() string // Limits of the object storage. Limits() Limits // Create the bucket if not existed. Create() error // Get the data for the given object specified by key. Get(key string, off, limit int64) (io.ReadCloser, error) // Put data read from a reader to an object specified by key. Put(key string, in io.Reader) error // Copy an object from src to dst. Copy(dst, src string) error // Delete a object. Delete(key string) error // Head returns some information about the object or an error if not found. Head(key string) (Object, error) // List returns a list of objects. List(prefix, marker, delimiter string, limit int64, followLink bool) ([]Object, error) // ListAll returns all the objects as an channel. ListAll(prefix, marker string, followLink bool) (<-chan Object, error) // CreateMultipartUpload starts to upload a large object part by part. CreateMultipartUpload(key string) (*MultipartUpload, error) // UploadPart upload a part of an object. UploadPart(key string, uploadID string, num int, body []byte) (*Part, error) // UploadPartCopy Uploads a part by copying data from an existing object as data source. UploadPartCopy(key string, uploadID string, num int, srcKey string, off, size int64) (*Part, error) // AbortUpload abort a multipart upload. AbortUpload(key string, uploadID string) // CompleteUpload finish an multipart upload. CompleteUpload(key string, uploadID string, parts []*Part) error // ListUploads lists existing multipart uploads. ListUploads(marker string) ([]*PendingPart, string, error) }
ObjectStorage is the interface for object storage. all of these API should be idempotent.
func CreateStorage ¶
func CreateStorage(name, endpoint, accessKey, secretKey, token string) (ObjectStorage, error)
func NewEncrypted ¶
func NewEncrypted(o ObjectStorage, enc Encryptor) ObjectStorage
NewEncrypted returns a encrypted object storage
func NewSharded ¶
func NewSharded(name, endpoint, ak, sk, token string, shards int) (ObjectStorage, error)
func WithPrefix ¶
func WithPrefix(os ObjectStorage, prefix string) ObjectStorage
WithPrefix return an object storage that add a prefix to keys.
type RestfulStorage ¶
type RestfulStorage struct { DefaultObjectStorage // contains filtered or unexported fields }
func (*RestfulStorage) Copy ¶
func (s *RestfulStorage) Copy(dst, src string) error
func (*RestfulStorage) Delete ¶
func (s *RestfulStorage) Delete(key string) error
func (*RestfulStorage) Get ¶
func (s *RestfulStorage) Get(key string, off, limit int64) (io.ReadCloser, error)
func (*RestfulStorage) String ¶
func (s *RestfulStorage) String() string
type SectionReaderCloser ¶
type SectionReaderCloser struct { *io.SectionReader io.Closer }
type SupportStorageClass ¶
type SupportStorageClass interface {
SetStorageClass(sc string)
}
Source Files ¶
- azure.go
- b2.go
- bos.go
- checksum.go
- cos.go
- encrypt.go
- eos.go
- etcd.go
- file.go
- file_unix.go
- gs.go
- hdfs.go
- hdfs_kerberos.go
- ibmcos.go
- interface.go
- jss.go
- ks3.go
- mem.go
- minio.go
- object_storage.go
- obs.go
- oos.go
- oss.go
- prefix.go
- qingstor.go
- qiniu.go
- redis.go
- restful.go
- s3.go
- scs.go
- scw.go
- sftp.go
- sharding.go
- space.go
- speedy.go
- sql.go
- sql_mysql.go
- sql_pg.go
- sql_sqlite.go
- swift.go
- tikv.go
- tos.go
- ufile.go
- upyun.go
- wasabi.go
- webdav.go
Click to show internal directories.
Click to hide internal directories.