Safe Haskell | None |
---|---|
Language | Haskell2010 |
- data ConnectInfo = ConnectInfo {}
- awsCI :: ConnectInfo
- awsWithRegionCI :: Region -> Bool -> ConnectInfo
- minioPlayCI :: ConnectInfo
- minioCI :: Text -> Int -> Bool -> ConnectInfo
- data Minio a
- runMinio :: ConnectInfo -> Minio a -> ResourceT IO (Either MinioErr a)
- runResourceT :: MonadBaseControl IO m => ResourceT m a -> m a
- def :: Default a => a
- data MinioErr
- data MErrV
- data ServiceErr
- type Bucket = Text
- type Object = Text
- data BucketInfo = BucketInfo {}
- data ObjectInfo = ObjectInfo {}
- data UploadInfo = UploadInfo {
- uiKey :: Object
- uiUploadId :: UploadId
- uiInitTime :: UTCTime
- uiSize :: Int64
- data ObjectPartInfo = ObjectPartInfo {
- opiNumber :: PartNumber
- opiETag :: ETag
- opiSize :: Int64
- opiModTime :: UTCTime
- type UploadId = Text
- data ObjectData m
- data CopyPartSource = CopyPartSource {}
- listBuckets :: Minio [BucketInfo]
- getLocation :: Bucket -> Minio Region
- makeBucket :: Bucket -> Maybe Region -> Minio ()
- removeBucket :: Bucket -> Minio ()
- listObjects :: Bucket -> Maybe Text -> Bool -> Producer Minio ObjectInfo
- listIncompleteUploads :: Bucket -> Maybe Text -> Bool -> Producer Minio UploadInfo
- fGetObject :: Bucket -> Object -> FilePath -> Minio ()
- fPutObject :: Bucket -> Object -> FilePath -> Minio ()
- putObject :: Bucket -> Object -> Producer Minio ByteString -> Maybe Int64 -> Minio ()
- copyObject :: Bucket -> Object -> CopyPartSource -> Minio ()
- removeObject :: Bucket -> Object -> Minio ()
- getObject :: Bucket -> Object -> Minio (ResumableSource Minio ByteString)
- statObject :: Bucket -> Object -> Minio ObjectInfo
Documentation
data ConnectInfo Source #
Connection Info data type. To create a ConnectInfo
value, use one
of the provided smart constructors or override fields of the
Default instance.
ConnectInfo | |
|
Eq ConnectInfo Source # | |
Show ConnectInfo Source # | |
Default ConnectInfo Source # | Connects to a Minio server located at |
awsCI :: ConnectInfo Source #
Default AWS ConnectInfo. Connects to "us-east-1". Credentials should be supplied before use, for e.g.:
awsCI { connectAccessKey = "my-access-key" , connectSecretKey = "my-secret-key" }
awsWithRegionCI :: Region -> Bool -> ConnectInfo Source #
AWS ConnectInfo with a specified region. It can optionally disable the automatic discovery of a bucket's region via the Boolean argument.
awsWithRegionCI "us-west-1" False { connectAccessKey = "my-access-key" , connectSecretKey = "my-secret-key" }
This restricts all operations to the "us-west-1" region and does not perform any bucket location requests.
minioPlayCI :: ConnectInfo Source #
Minio Play Server ConnectInfo. Credentials are already filled in.
minioCI :: Text -> Int -> Bool -> ConnectInfo Source #
ConnectInfo for Minio server. Takes hostname, port and a Boolean to enable TLS.
minioCI "minio.example.com" 9000 True { connectAccessKey = "my-access-key" , connectSecretKey = "my-secret-key" }
This connects to a Minio server at the given hostname and port over HTTPS.
runMinio :: ConnectInfo -> Minio a -> ResourceT IO (Either MinioErr a) Source #
Run the Minio action and return the result or an error.
runResourceT :: MonadBaseControl IO m => ResourceT m a -> m a #
Unwrap a ResourceT
transformer, and call all registered release actions.
Note that there is some reference counting involved due to resourceForkIO
.
If multiple threads are sharing the same collection of resources, only the
last call to runResourceT
will deallocate the resources.
Since 0.3.0
Error handling
Data types representing various errors that may occur while working with an object storage service.
Errors thrown by the library
Various validation errors
data ServiceErr Source #
Errors returned by S3 compatible service
Data Types
Data types representing various object store concepts.
data BucketInfo Source #
BucketInfo returned for list buckets call
data ObjectInfo Source #
Represents information about an object.
data UploadInfo Source #
Represents information about a multipart upload.
UploadInfo | |
|
data ObjectPartInfo Source #
Represents information about an object part in an ongoing multipart upload.
ObjectPartInfo | |
|
data ObjectData m Source #
A data-type to represent the source data for an object. A file-path or a producer-conduit may be provided.
For files, a size may be provided - this is useful in cases when the file size cannot be automatically determined or if only some prefix of the file is desired.
For streams also, a size may be provided. This is useful to limit
the input - if it is not provided, upload will continue until the
stream ends or the object reaches maxObjectsize
size.
data CopyPartSource Source #
CopyPartSource | |
|
Bucket Operations
listBuckets :: Minio [BucketInfo] Source #
Lists buckets.
makeBucket :: Bucket -> Maybe Region -> Minio () Source #
Creates a new bucket in the object store. The Region can be optionally specified. If not specified, it will use the region configured in ConnectInfo, which is by default, the US Standard Region.
removeBucket :: Bucket -> Minio () Source #
listObjects :: Bucket -> Maybe Text -> Bool -> Producer Minio ObjectInfo Source #
List objects in a bucket matching the given prefix. If recurse is set to True objects matching prefix are recursively listed.
listIncompleteUploads :: Bucket -> Maybe Text -> Bool -> Producer Minio UploadInfo Source #
List incomplete uploads in a bucket matching the given prefix. If recurse is set to True incomplete uploads for the given prefix are recursively listed.
Object Operations
fGetObject :: Bucket -> Object -> FilePath -> Minio () Source #
Fetch the object and write it to the given file safely. The object is first written to a temporary file in the same directory and then moved to the given path.
fPutObject :: Bucket -> Object -> FilePath -> Minio () Source #
Upload the given file to the given object.
putObject :: Bucket -> Object -> Producer Minio ByteString -> Maybe Int64 -> Minio () Source #
Put an object from a conduit source. The size can be provided if known; this helps the library select optimal part sizes to perform a multipart upload. If not specified, it is assumed that the object can be potentially 5TiB and selects multipart sizes appropriately.
copyObject :: Bucket -> Object -> CopyPartSource -> Minio () Source #
Perform a server-side copy operation to create an object with the given bucket and object name from the source specification in CopyPartSource. This function performs a multipart copy operation if the new object is to be greater than 5GiB in size.
getObject :: Bucket -> Object -> Minio (ResumableSource Minio ByteString) Source #
Get an object from the object store as a resumable source (conduit).
statObject :: Bucket -> Object -> Minio ObjectInfo Source #
Get an object's metadata from the object store.