Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
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 { GetFileReader(name string) (io.ReadCloser, error) PutFileReader(name string, src io.Reader, length int64, contentType string) error GeneratePostFileRequest(name string) (*PostFileRequest, error) }
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.
Click to show internal directories.
Click to hide internal directories.