Documentation ¶
Overview ¶
Package s3 provides an endpoint for connecting to Amazon S3 or an S3-compatible storage
Index ¶
- Constants
- Variables
- func CopyObjectMultipart(ctx context.Context, client *minio.Core, srcObject minio.ObjectInfo, ...) error
- type Client
- func (c *Client) ComputeChecksum(node *tree.Node) error
- func (c *Client) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (c *Client) DeleteNode(ctx context.Context, path string) (err error)
- func (c *Client) GetEndpointInfo() model.EndpointInfo
- func (c *Client) GetReaderOn(path string) (out io.ReadCloser, err error)
- func (c *Client) GetWriterOn(cancel context.Context, path string, targetSize int64) (out io.WriteCloser, writeDone chan bool, writeErr chan error, err error)
- func (c *Client) LoadNode(ctx context.Context, path string, extendedStats ...bool) (node *tree.Node, err error)
- func (c *Client) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (c *Client) SetPlainSizeComputer(computer func(nodeUUID string) (int64, error))
- func (c *Client) SetServerRequiresNormalization()
- func (c *Client) SkipRecomputeEtagByCopy()
- func (c *Client) Stat(path string) (i os.FileInfo, err error)
- func (c *Client) UpdateNodeUuid(ctx context.Context, node *tree.Node) (*tree.Node, error)
- func (c *Client) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
- func (c *Client) Watch(recursivePath string) (*model.WatchObject, error)
- type MockableMinio
- type MultiBucketClient
- func (m *MultiBucketClient) ComputeChecksum(node *tree.Node) (err error)
- func (m *MultiBucketClient) CreateNode(ctx context.Context, node *tree.Node, updateIfExists bool) (err error)
- func (m *MultiBucketClient) DeleteNode(ctx context.Context, path string) (err error)
- func (m *MultiBucketClient) GetEndpointInfo() model.EndpointInfo
- func (m *MultiBucketClient) GetReaderOn(path string) (out io.ReadCloser, err error)
- func (m *MultiBucketClient) GetWriterOn(cancel context.Context, path string, targetSize int64) (out io.WriteCloser, writeDone chan bool, writeErr chan error, err error)
- func (m *MultiBucketClient) LoadNode(ctx context.Context, p string, extendedStats ...bool) (node *tree.Node, err error)
- func (m *MultiBucketClient) MoveNode(ctx context.Context, oldPath string, newPath string) (err error)
- func (m *MultiBucketClient) SetPlainSizeComputer(computer func(nodeUUID string) (int64, error))
- func (m *MultiBucketClient) SetServerRequiresNormalization()
- func (m *MultiBucketClient) UpdateNodeUuid(ctx context.Context, node *tree.Node) (n *tree.Node, err error)
- func (m *MultiBucketClient) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
- func (m *MultiBucketClient) Watch(recursivePath string) (*model.WatchObject, error)
- type S3FileInfo
Constants ¶
View Source
const MaxCopyObjectSize = 1024 * 1024 * 1024 * 5
Max CopyObjectSize is 5GB => if greater, we have to switch to multipart
Variables ¶
View Source
var ( UserAgentAppName = "pydio.sync.client.s3" UserAgentVersion = "1.0" )
Functions ¶
Types ¶
type Client ¶
type Client struct { Mc MockableMinio Bucket string RootPath string Host string ServerRequiresNormalization bool // contains filtered or unexported fields }
Client wraps a Minio Client to speak with an S3-compatible backend
func (*Client) CreateNode ¶
func (*Client) DeleteNode ¶
func (*Client) GetEndpointInfo ¶
func (c *Client) GetEndpointInfo() model.EndpointInfo
func (*Client) GetReaderOn ¶
func (c *Client) GetReaderOn(path string) (out io.ReadCloser, err error)
func (*Client) GetWriterOn ¶
func (*Client) SetPlainSizeComputer ¶
func (*Client) SetServerRequiresNormalization ¶
func (c *Client) SetServerRequiresNormalization()
func (*Client) SkipRecomputeEtagByCopy ¶
func (c *Client) SkipRecomputeEtagByCopy()
func (*Client) UpdateNodeUuid ¶
UpdateNodeUuid makes this endpoint an UuidReceiver
type MockableMinio ¶
type MockableMinio interface { StatObject(bucket string, path string, opts minio.StatObjectOptions) (minio.ObjectInfo, error) RemoveObject(bucket string, path string) error PutObject(bucket string, path string, reader io.Reader, size int64, opts minio.PutObjectOptions) (n int64, err error) GetObject(bucket string, path string, opts minio.GetObjectOptions) (object *minio.Object, err error) ListObjectsV2(bucketName, objectPrefix string, recursive bool, doneCh <-chan struct{}) <-chan minio.ObjectInfo CopyObject(dest minio.DestinationInfo, source minio.SourceInfo) error ListenBucketNotification(bucketName, prefix, suffix string, events []string, doneCh <-chan struct{}) <-chan minio.NotificationInfo ListBuckets() ([]minio.BucketInfo, error) ListBucketsWithContext(ctx context.Context) ([]minio.BucketInfo, error) BucketExists(string) (bool, error) }
type MultiBucketClient ¶
type MultiBucketClient struct {
// contains filtered or unexported fields
}
func NewMultiBucketClient ¶
func (*MultiBucketClient) ComputeChecksum ¶
func (m *MultiBucketClient) ComputeChecksum(node *tree.Node) (err error)
func (*MultiBucketClient) CreateNode ¶
func (*MultiBucketClient) DeleteNode ¶
func (m *MultiBucketClient) DeleteNode(ctx context.Context, path string) (err error)
func (*MultiBucketClient) GetEndpointInfo ¶
func (m *MultiBucketClient) GetEndpointInfo() model.EndpointInfo
func (*MultiBucketClient) GetReaderOn ¶
func (m *MultiBucketClient) GetReaderOn(path string) (out io.ReadCloser, err error)
func (*MultiBucketClient) GetWriterOn ¶
func (m *MultiBucketClient) GetWriterOn(cancel context.Context, path string, targetSize int64) (out io.WriteCloser, writeDone chan bool, writeErr chan error, err error)
func (*MultiBucketClient) SetPlainSizeComputer ¶
func (m *MultiBucketClient) SetPlainSizeComputer(computer func(nodeUUID string) (int64, error))
func (*MultiBucketClient) SetServerRequiresNormalization ¶
func (m *MultiBucketClient) SetServerRequiresNormalization()
func (*MultiBucketClient) UpdateNodeUuid ¶
func (*MultiBucketClient) Walk ¶
func (m *MultiBucketClient) Walk(walknFc model.WalkNodesFunc, root string, recursive bool) (err error)
func (*MultiBucketClient) Watch ¶
func (m *MultiBucketClient) Watch(recursivePath string) (*model.WatchObject, error)
type S3FileInfo ¶
type S3FileInfo struct { Object minio.ObjectInfo // contains filtered or unexported fields }
func NewS3FileInfo ¶
func NewS3FileInfo(object minio.ObjectInfo) *S3FileInfo
func NewS3FolderInfo ¶
func NewS3FolderInfo(object minio.ObjectInfo) *S3FileInfo
func (*S3FileInfo) Size ¶
func (s *S3FileInfo) Size() int64
length in bytes for regular files; system-dependent for others
func (*S3FileInfo) Sys ¶
func (s *S3FileInfo) Sys() interface{}
underlying data source (can return nil)
Click to show internal directories.
Click to hide internal directories.