Documentation
¶
Index ¶
- func Open(cfg Config) (fs.Repository, error)
- func Register(manager *filesystem.Manager)
- type Config
- type S3
- func (d *S3) Close() error
- func (d *S3) Copy(ctx context.Context, src, dst string) error
- func (d *S3) Delete(ctx context.Context, key string) error
- func (d *S3) DeleteDirectory(ctx context.Context, dir string) error
- func (d *S3) Exists(ctx context.Context, key string) (bool, error)
- func (d *S3) GetVisibility(ctx context.Context, key string) (string, error)
- func (d *S3) List(ctx context.Context, prefix string, recursive bool) ([]filesystem.FileInfo, error)
- func (d *S3) MakeDirectory(context.Context, string) error
- func (d *S3) Move(ctx context.Context, src, dst string) error
- func (d *S3) Open(ctx context.Context, key string) (io.ReadCloser, filesystem.FileInfo, error)
- func (d *S3) Path(key string) string
- func (d *S3) ReadAll(ctx context.Context, key string) ([]byte, error)
- func (d *S3) SetVisibility(ctx context.Context, key, visibility string) error
- func (d *S3) Stat(ctx context.Context, key string) (filesystem.FileInfo, error)
- func (d *S3) TemporaryURL(ctx context.Context, key string, expiry time.Time) (string, error)
- func (d *S3) URL(key string) (string, error)
- func (d *S3) Write(ctx context.Context, key string, reader io.Reader, opts filesystem.PutOptions) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type Config ¶
type Config struct {
Driver string `json:"driver"`
Visibility string `json:"visibility"`
Root string `json:"root,omitempty"`
Bucket string `json:"bucket,omitempty"`
Endpoint string `json:"endpoint,omitempty"`
Region string `json:"region,omitempty"`
Prefix string `json:"prefix,omitempty"`
URL string `json:"url,omitempty"`
PathStyle bool `json:"path_style,omitempty"`
ACL string `json:"acl,omitempty"`
AccessKey string `json:"-"`
SecretKey string `json:"-"`
}
Config中的位置随文件保存,密钥只在请求中从保密配置读取。
type S3 ¶
type S3 struct {
// contains filtered or unexported fields
}
S3 适配AWS、七牛和COS的兼容接口;签名、重试和流式传输由SDK处理。
func (*S3) GetVisibility ¶
func (*S3) Open ¶
func (d *S3) Open(ctx context.Context, key string) (io.ReadCloser, filesystem.FileInfo, error)
func (*S3) SetVisibility ¶
func (*S3) TemporaryURL ¶
Click to show internal directories.
Click to hide internal directories.