Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type FileGetter ¶ added in v1.6.2
type FileGetter interface {
GetFileReader(name string) (io.ReadCloser, error)
}
FileGetter defines the interface of a getter for files
type FilePostRequestGenerator ¶ added in v1.6.2
type FilePostRequestGenerator interface { GeneratePostFileRequest( name string, contentType string, length int64, ) (*PostFileRequest, error) }
FilePostRequestGenerator defines the interface of a generator for post file request
type FilePutter ¶ added in v1.6.2
type FilePutter interface { PutFileReader( name string, src io.Reader, length int64, contentType string, ) error }
FilePutter defines the interface of a putter for files
type FileRangeNotAcceptedError ¶ added in v1.6.2
type FileRangeNotAcceptedError struct {
Range FileRange
}
FileRangeNotAcceptedError defines the range not accepted error
func (FileRangeNotAcceptedError) Error ¶ added in v1.6.2
func (e FileRangeNotAcceptedError) Error() string
type FileRangedGetResult ¶ added in v1.6.2
type FileRangedGetResult struct { ReadCloser io.ReadCloser AcceptedRange FileRange TotalSize int64 }
FileRangedGetResult models the result of getting a ranged file
type FileRangedGetter ¶ added in v1.6.2
type FileRangedGetter interface { GetRangedFileReader( name string, fileRange FileRange, ) (*FileRangedGetResult, error) }
FileRangedGetter defines the interface of a getter for files supportting getting file within a byte range
type PostFileRequest ¶
type PostFileRequest struct { Action string `json:"action"` ExtraFields map[string]interface{} `json:"extra-fields,omitempty"` }
PostFileRequest models the POST request for upload asset file
type SignatureParser ¶
type SignatureParser interface {
ParseSignature(signed string, name string, expiredAt time.Time) (valid bool, err error)
}
SignatureParser parses a signed signature string
type Store ¶
type Store interface { FileGetter FilePutter FilePostRequestGenerator }
Store specify the interfaces of an asset store
func NewCloudStore ¶
func NewCloudStore( appName string, host string, authToken string, publicURLPrefix string, privateURLPrefix string, public bool, ) (Store, error)
NewCloudStore creates a new cloud asset store
func NewFileStore ¶
NewFileStore creates a new fileStore
type URLSigner ¶
type URLSigner interface { // SignedURL returns a url with access to the named file. If asset // store is private, the returned URL is a signed one, allowing access // to asset for a short period. SignedURL(name string) (string, error) IsSignatureRequired() bool }
URLSigner signs a signature and returns a URL accessible to that asset.
type URLSignerStore ¶ added in v1.6.0
URLSignerStore is an interface that is a union of Store and URLSigner.