Documentation ¶
Index ¶
Constants ¶
View Source
const MaxContentLength = 10 * 1024 * 1024
MaxContentLength is 10MiB.
View Source
const PresignGetExpires time.Duration = 1 * duration.PerHour
PresignGetExpires is how long the presign GET request remains valid.
Variables ¶
View Source
var DependencySet = wire.NewSet( NewImagesCloudStorageServiceHTTPClient, wire.Struct(new(ImagesCloudStorageService), "*"), )
Functions ¶
This section is empty.
Types ¶
type HeaderField ¶
type ImagesCloudStorageService ¶
type ImagesCloudStorageService struct { HTTPClient ImagesCloudStorageServiceHTTPClient Storage ImagesCloudStorageServiceStorage }
func (*ImagesCloudStorageService) MakeDirector ¶
func (*ImagesCloudStorageService) PresignPutRequest ¶
func (p *ImagesCloudStorageService) PresignPutRequest(ctx context.Context, r *PresignUploadRequest) (*PresignUploadResponse, error)
type ImagesCloudStorageServiceHTTPClient ¶
func NewImagesCloudStorageServiceHTTPClient ¶
func NewImagesCloudStorageServiceHTTPClient() ImagesCloudStorageServiceHTTPClient
type ImagesCloudStorageServiceStorage ¶
type ImagesCloudStorageServiceStorage interface { PresignPutObject(ctx context.Context, name string, header http.Header) (*http.Request, error) PresignHeadObject(ctx context.Context, name string, expire time.Duration) (*url.URL, error) MakeDirector(extractKey func(r *http.Request) string, expire time.Duration) func(r *http.Request) }
type PresignUploadRequest ¶
type PresignUploadRequest struct { Key string `json:"key"` Headers map[string]interface{} `json:"headers"` }
func (*PresignUploadRequest) ContentLength ¶
func (r *PresignUploadRequest) ContentLength() (contentLength int)
func (*PresignUploadRequest) HTTPHeader ¶
func (r *PresignUploadRequest) HTTPHeader() http.Header
func (*PresignUploadRequest) Sanitize ¶
func (r *PresignUploadRequest) Sanitize()
type PresignUploadResponse ¶
type PresignUploadResponse struct { Key string `json:"key"` URL string `json:"url"` Method string `json:"method"` Headers []HeaderField `json:"headers"` }
func NewPresignUploadResponse ¶
func NewPresignUploadResponse(r *http.Request, key string) PresignUploadResponse
Click to show internal directories.
Click to hide internal directories.