Documentation
¶
Index ¶
- func ValidKey(key string) bool
- type LocalBackend
- func (l *LocalBackend) Delete(_ context.Context, key string) error
- func (l *LocalBackend) DeleteMulti(ctx context.Context, keys ...string) error
- func (l *LocalBackend) LoadMeta(key string) (meta, error)
- func (l *LocalBackend) Open(_ context.Context, key string) (io.ReadCloser, Object, error)
- func (l *LocalBackend) Presign(_ context.Context, key string, _ time.Duration) (string, error)
- func (l *LocalBackend) Put(_ context.Context, key, contentType string, r io.Reader) (Object, error)
- func (l *LocalBackend) URL(key string) string
- type Object
- type S3Backend
- func (s *S3Backend) Delete(ctx context.Context, key string) error
- func (s *S3Backend) DeleteMulti(ctx context.Context, keys ...string) error
- func (s *S3Backend) Open(ctx context.Context, key string) (io.ReadCloser, Object, error)
- func (s *S3Backend) Presign(ctx context.Context, key string, ttl time.Duration) (string, error)
- func (s *S3Backend) Put(ctx context.Context, key, contentType string, r io.Reader) (Object, error)
- func (s *S3Backend) URL(key string) string
- type S3Options
- type Store
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type LocalBackend ¶
type LocalBackend struct {
Root string
// contains filtered or unexported fields
}
func NewLocal ¶
func NewLocal(root string) (*LocalBackend, error)
func (*LocalBackend) DeleteMulti ¶
func (l *LocalBackend) DeleteMulti(ctx context.Context, keys ...string) error
func (*LocalBackend) LoadMeta ¶
func (l *LocalBackend) LoadMeta(key string) (meta, error)
func (*LocalBackend) Open ¶
func (l *LocalBackend) Open(_ context.Context, key string) (io.ReadCloser, Object, error)
func (*LocalBackend) URL ¶
func (l *LocalBackend) URL(key string) string
type S3Backend ¶
type S3Backend struct {
Client *s3.Client
Uploader *manager.Uploader
Presigner *s3.PresignClient
Bucket string
Prefix string
PublicBase string
}
func (*S3Backend) DeleteMulti ¶
type Store ¶
type Store interface {
Put(ctx context.Context, key, contentType string, r io.Reader) (Object, error)
Open(ctx context.Context, key string) (io.ReadCloser, Object, error)
Delete(ctx context.Context, key string) error
DeleteMulti(ctx context.Context, keys ...string) error
URL(key string) string
Presign(ctx context.Context, key string, ttl time.Duration) (string, error)
}
Click to show internal directories.
Click to hide internal directories.