AWS Helpers for image uploading and friends.
AWS Helpers for image uploading and friends.
Supported buckets. We only have one for now.
Supported buckets. We only have one for now.
(bucket-config conf bucket)
Inputs: [conf :- AWSConfig bucket :- Bucket] Returns: BucketConf
Returns a BucketConf from the supplied AWS config.
Inputs: [conf :- AWSConfig bucket :- Bucket] Returns: BucketConf Returns a BucketConf from the supplied AWS config.
(cloudfront-url conf doc bucket-key image-name)
Inputs: [conf :- AWSConfig doc :- {s/Any s/Any} bucket-key :- Bucket image-name :- ImageName] Returns: (s/maybe CloudFrontURL)
Returns a cloudfront URL for the supplied image suitable for splicing into HTML. Example args a user-doc, :photos, and :main-photo.
Inputs: [conf :- AWSConfig doc :- {s/Any s/Any} bucket-key :- Bucket image-name :- ImageName] Returns: (s/maybe CloudFrontURL) Returns a cloudfront URL for the supplied image suitable for splicing into HTML. Example args a user-doc, :photos, and :main-photo.
Map of content-type to image extension.
Map of content-type to image extension.
Map of IE-style, annoying prefixes over to proper image types.
Map of IE-style, annoying prefixes over to proper image types.
(current-manager cred)
Inputs: [cred :- Credentials] Returns: TransferManager
Returns the current active TransferManager.
Inputs: [cred :- Credentials] Returns: TransferManager Returns the current active TransferManager.
(generate-key image-name content-type)
Inputs: [image-name :- ImageName content-type :- ImageContent] Returns: AWSKey
Inputs: [image-name :- ImageName content-type :- ImageContent] Returns: AWSKey
Schema for images that come in via the temporary store, from ring's multipart-params middleware.
Schema for images that come in via the temporary store, from ring's multipart-params middleware.
(massage-content-type t)
Inputs: [t :- (s/either ImageContent CrazyInput)] Returns: ImageContent
Fixes up some of the crazier input types that IE responds to.
Inputs: [t :- (s/either ImageContent CrazyInput)] Returns: ImageContent Fixes up some of the crazier input types that IE responds to.
(to-stream tempfile)
Inputs: [tempfile :- (:tempfile Image)] Returns: InputStream
Inputs: [tempfile :- (:tempfile Image)] Returns: InputStream
(trim-channel chan url)
Inputs: [chan :- Channel url :- AWSKey] Returns: Channel
Modifies a file upload channel to only return success or failure events.
NOTE: Down the road, we could use the other channel elements (bytes transferred so far) to build a client-side upload progress bar.
Inputs: [chan :- Channel url :- AWSKey] Returns: Channel Modifies a file upload channel to only return success or failure events. NOTE: Down the road, we could use the other channel elements (bytes transferred so far) to build a client-side upload progress bar.
(upload! conf man bucket key filename)
(upload! conf man bucket key input params)
Inputs: ([conf :- AWSConfig man :- TransferManager bucket :- Bucket key :- AWSKey filename :- String] [conf :- AWSConfig man :- TransferManager bucket :- Bucket key :- AWSKey input :- InputStream params :- {s/Any s/Any}]) Returns: {s/Any s/Any}
Triggers an upload via the TransferManager to s3. Returns a clojure map that represents an AWS Transfer instance. The map goes from method name (in keyword form) -> function with input types as described here: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/transfer/Transfer.html
Inputs: ([conf :- AWSConfig man :- TransferManager bucket :- Bucket key :- AWSKey filename :- String] [conf :- AWSConfig man :- TransferManager bucket :- Bucket key :- AWSKey input :- InputStream params :- {s/Any s/Any}]) Returns: {s/Any s/Any} Triggers an upload via the TransferManager to s3. Returns a clojure map that represents an AWS Transfer instance. The map goes from method name (in keyword form) -> function with input types as described here: http://docs.aws.amazon.com/AWSJavaSDK/latest/javadoc/com/amazonaws/services/s3/transfer/Transfer.html
(upload-image aws-config bucket image-name {:keys [tempfile content-type size]})
Inputs: [aws-config :- AWSConfig bucket :- Bucket image-name :- ImageName {:keys [tempfile content-type size]} :- Image] Returns: Channel
Takes an image that'd show up directly from the upload dialogue and starts an asynchronous upload to S3. Returns a channel that reports the success status and the new url on a successful upload.
Uploaded images are cached, by default, for 10 years (see the cache-control header in here)
Inputs: [aws-config :- AWSConfig bucket :- Bucket image-name :- ImageName {:keys [tempfile content-type size]} :- Image] Returns: Channel Takes an image that'd show up directly from the upload dialogue and starts an asynchronous upload to S3. Returns a channel that reports the success status and the new url on a successful upload. Uploaded images are cached, by default, for 10 years (see the cache-control header in here)
cljdoc is a website building & hosting documentation for Clojure/Script libraries
× close