Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
Minio Dart
Manage
Activity
Members
Labels
Plan
Issues
0
Issue boards
Milestones
Wiki
Code
Merge requests
0
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Operate
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
images
Minio Dart
Commits
1f9594da
Commit
1f9594da
authored
5 years ago
by
xuty
Browse files
Options
Downloads
Patches
Plain Diff
finish presignedGetObject
parent
01ade349
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
example/minio_example.dart
+1
-1
1 addition, 1 deletion
example/minio_example.dart
lib/src/minio.dart
+28
-1
28 additions, 1 deletion
lib/src/minio.dart
with
29 additions
and
2 deletions
example/minio_example.dart
+
1
−
1
View file @
1f9594da
...
@@ -30,7 +30,7 @@ void main() async {
...
@@ -30,7 +30,7 @@ void main() async {
print
(
'--- etag:'
);
print
(
'--- etag:'
);
print
(
etag
);
print
(
etag
);
final
url
=
await
minio
.
presigned
Url
(
'GET'
,
bucket
,
object
,
expires:
1000
);
final
url
=
await
minio
.
presigned
GetObject
(
bucket
,
object
,
expires:
1000
);
print
(
'--- presigned url:'
);
print
(
'--- presigned url:'
);
print
(
url
);
print
(
url
);
...
...
This diff is collapsed.
Click to expand it.
lib/src/minio.dart
+
28
−
1
View file @
1f9594da
...
@@ -614,13 +614,40 @@ class Minio {
...
@@ -614,13 +614,40 @@ class Minio {
return
resp
.
body
;
return
resp
.
body
;
}
}
/// Generate a presigned URL for GET
///
/// - [bucketName]: name of the bucket
/// - [objectName]: name of the object
/// - [expires]: expiry in seconds (optional, default 7 days)
/// - [respHeaders]: response headers to override (optional)
/// - [requestDate]: A date object, the url will be issued at (optional)
Future
<
String
>
presignedGetObject
(
String
bucket
,
String
object
,
{
int
expires
,
Map
<
String
,
String
>
respHeaders
,
DateTime
requestDate
,
})
{
MinioInvalidBucketNameError
.
check
(
bucket
);
MinioInvalidObjectNameError
.
check
(
object
);
return
presignedUrl
(
'GET'
,
bucket
,
object
,
expires:
expires
,
reqParams:
respHeaders
,
requestDate:
requestDate
,
);
}
/// Generate a generic presigned URL which can be
/// Generate a generic presigned URL which can be
/// used for HTTP methods GET, PUT, HEAD and DELETE
/// used for HTTP methods GET, PUT, HEAD and DELETE
///
///
/// - [method]: name of the HTTP method
/// - [method]: name of the HTTP method
/// - [bucketName]: name of the bucket
/// - [bucketName]: name of the bucket
/// - [objectName]: name of the object
/// - [objectName]: name of the object
/// - [expir
y
]: expiry in seconds (optional, default 7 days)
/// - [expir
es
]: expiry in seconds (optional, default 7 days)
/// - [reqParams]: request parameters (optional)
/// - [reqParams]: request parameters (optional)
/// - [requestDate]: A date object, the url will be issued at (optional)
/// - [requestDate]: A date object, the url will be issued at (optional)
Future
<
String
>
presignedUrl
(
Future
<
String
>
presignedUrl
(
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment