Documentation
¶
Index ¶
- type LocalStorage
- func (s *LocalStorage) Delete(ctx context.Context, path string) error
- func (s *LocalStorage) Exists(ctx context.Context, path string) (bool, error)
- func (s *LocalStorage) Local() bool
- func (s *LocalStorage) PrivateUrl(ctx context.Context, path string) (string, error)
- func (s *LocalStorage) PublicUrl(ctx context.Context, path string) (string, error)
- func (s *LocalStorage) Read(ctx context.Context, path string) (string, error)
- func (s *LocalStorage) ReadStream(ctx context.Context, path string) (io.Reader, error)
- func (s *LocalStorage) SignPostUrl(ctx context.Context, path string) (url string, params map[string]string, err error)
- func (s *LocalStorage) SignPutUrl(ctx context.Context, path string) (string, error)
- func (s *LocalStorage) Size(ctx context.Context, path string) (int64, error)
- func (s *LocalStorage) Write(ctx context.Context, path string, contents string, contentType ...string) error
- func (s *LocalStorage) WriteStream(ctx context.Context, path string, stream io.Reader, contentType ...string) error
- type S3Storage
- func (s *S3Storage) Delete(ctx context.Context, path string) error
- func (s *S3Storage) Exists(ctx context.Context, path string) (bool, error)
- func (s *S3Storage) Local() bool
- func (s *S3Storage) PrivateUrl(ctx context.Context, path string) (string, error)
- func (s *S3Storage) PublicUrl(ctx context.Context, path string) (string, error)
- func (s *S3Storage) Read(ctx context.Context, path string) (string, error)
- func (s *S3Storage) ReadStream(ctx context.Context, path string) (io.Reader, error)
- func (s *S3Storage) SignPostUrl(ctx context.Context, path string) (url string, params map[string]string, err error)
- func (s *S3Storage) SignPutUrl(ctx context.Context, path string) (url string, err error)
- func (s *S3Storage) Size(ctx context.Context, path string) (int64, error)
- func (s *S3Storage) Write(ctx context.Context, path string, contents string, contentType ...string) error
- func (s *S3Storage) WriteStream(ctx context.Context, path string, stream io.Reader, contentType ...string) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type LocalStorage ¶
type LocalStorage struct {
Root string
Domain string
Path string
Sign func(path string) (string, error)
}
func NewLocalStorage ¶
func (*LocalStorage) Local ¶ added in v2.0.2
func (s *LocalStorage) Local() bool
func (*LocalStorage) PrivateUrl ¶
func (*LocalStorage) ReadStream ¶
func (*LocalStorage) SignPostUrl ¶
func (*LocalStorage) SignPutUrl ¶
func (*LocalStorage) WriteStream ¶
type S3Storage ¶
type S3Storage struct {
Endpoint string
Region string
AccessKey string
SecretKey string
Domain string
Bucket string
SSL bool
Immutable bool
// contains filtered or unexported fields
}
func (*S3Storage) PrivateUrl ¶
func (*S3Storage) ReadStream ¶
func (*S3Storage) SignPostUrl ¶
func (*S3Storage) SignPutUrl ¶
Click to show internal directories.
Click to hide internal directories.