aad60c882e
Bumps [github.com/mattermost/mattermost-server/v6](https://github.com/mattermost/mattermost-server) from 6.1.0 to 6.3.0. - [Release notes](https://github.com/mattermost/mattermost-server/releases) - [Changelog](https://github.com/mattermost/mattermost-server/blob/master/CHANGELOG.md) - [Commits](https://github.com/mattermost/mattermost-server/compare/v6.1.0...v6.3.0) --- updated-dependencies: - dependency-name: github.com/mattermost/mattermost-server/v6 dependency-type: direct:production update-type: version-update:semver-minor ... Signed-off-by: dependabot[bot] <support@github.com> Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> |
||
---|---|---|
.. | ||
pkg | ||
.gitignore | ||
.golangci.yml | ||
api-bucket-encryption.go | ||
api-bucket-lifecycle.go | ||
api-bucket-notification.go | ||
api-bucket-policy.go | ||
api-bucket-replication.go | ||
api-bucket-tagging.go | ||
api-bucket-versioning.go | ||
api-compose-object.go | ||
api-copy-object.go | ||
api-datatypes.go | ||
api-error-response.go | ||
api-get-object-acl.go | ||
api-get-object-file.go | ||
api-get-object.go | ||
api-get-options.go | ||
api-list.go | ||
api-object-legal-hold.go | ||
api-object-lock.go | ||
api-object-retention.go | ||
api-object-tagging.go | ||
api-presigned.go | ||
api-put-bucket.go | ||
api-put-object-common.go | ||
api-put-object-file-context.go | ||
api-put-object-multipart.go | ||
api-put-object-streaming.go | ||
api-put-object.go | ||
api-putobject-snowball.go | ||
api-remove.go | ||
api-restore.go | ||
api-s3-datatypes.go | ||
api-select.go | ||
api-stat.go | ||
api.go | ||
bucket-cache.go | ||
CNAME | ||
code_of_conduct.md | ||
constants.go | ||
CONTRIBUTING.md | ||
core.go | ||
functional_tests.go | ||
hook-reader.go | ||
LICENSE | ||
MAINTAINERS.md | ||
Makefile | ||
NOTICE | ||
post-policy.go | ||
README_zh_CN.md | ||
README.md | ||
retry-continous.go | ||
retry.go | ||
s3-endpoints.go | ||
s3-error.go | ||
transport.go | ||
utils.go |
MinIO Go Client SDK for Amazon S3 Compatible Cloud Storage
The MinIO Go Client SDK provides simple APIs to access any Amazon S3 compatible object storage.
This quickstart guide will show you how to install the MinIO client SDK, connect to MinIO, and provide a walkthrough for a simple file uploader. For a complete list of APIs and examples, please take a look at the Go Client API Reference.
This document assumes that you have a working Go development environment.
Download from Github
GO111MODULE=on go get github.com/minio/minio-go/v7
Initialize MinIO Client
MinIO client requires the following four parameters specified to connect to an Amazon S3 compatible object storage.
Parameter | Description |
---|---|
endpoint | URL to object storage service. |
minio.Options | All the options such as credentials, custom transport etc. |
package main
import (
"log"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)
func main() {
:= "play.min.io"
endpoint := "Q3AM3UQ867SPQQA43P2F"
accessKeyID := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
secretAccessKey := true
useSSL
// Initialize minio client object.
, err := minio.New(endpoint, &minio.Options{
minioClient: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Creds: useSSL,
Secure})
if err != nil {
.Fatalln(err)
log}
.Printf("%#v\n", minioClient) // minioClient is now set up
log}
Quick Start Example - File Uploader
This example program connects to an object storage server, creates a bucket and uploads a file to the bucket.
We will use the MinIO server running at https://play.min.io in this example. Feel free to use this service for testing and development. Access credentials shown in this example are open to the public.
FileUploader.go
package main
import (
"context"
"log"
"github.com/minio/minio-go/v7"
"github.com/minio/minio-go/v7/pkg/credentials"
)
func main() {
:= context.Background()
ctx := "play.min.io"
endpoint := "Q3AM3UQ867SPQQA43P2F"
accessKeyID := "zuf+tfteSlswRu7BJ86wekitnifILbZam1KYY3TG"
secretAccessKey := true
useSSL
// Initialize minio client object.
, err := minio.New(endpoint, &minio.Options{
minioClient: credentials.NewStaticV4(accessKeyID, secretAccessKey, ""),
Creds: useSSL,
Secure})
if err != nil {
.Fatalln(err)
log}
// Make a new bucket called mymusic.
:= "mymusic"
bucketName := "us-east-1"
location
= minioClient.MakeBucket(ctx, bucketName, minio.MakeBucketOptions{Region: location})
err if err != nil {
// Check to see if we already own this bucket (which happens if you run this twice)
, errBucketExists := minioClient.BucketExists(ctx, bucketName)
existsif errBucketExists == nil && exists {
.Printf("We already own %s\n", bucketName)
log} else {
.Fatalln(err)
log}
} else {
.Printf("Successfully created %s\n", bucketName)
log}
// Upload the zip file
:= "golden-oldies.zip"
objectName := "/tmp/golden-oldies.zip"
filePath := "application/zip"
contentType
// Upload the zip file with FPutObject
, err := minioClient.FPutObject(ctx, bucketName, objectName, filePath, minio.PutObjectOptions{ContentType: contentType})
infoif err != nil {
.Fatalln(err)
log}
.Printf("Successfully uploaded %s of size %d\n", objectName, info.Size)
log}
Run FileUploader
export GO111MODULE=on
go run file-uploader.go
2016/08/13 17:03:28 Successfully created mymusic
2016/08/13 17:03:40 Successfully uploaded golden-oldies.zip of size 16253413
mc ls play/mymusic/
[2016-05-27 16:02:16 PDT] 17MiB golden-oldies.zip
API Reference
The full API Reference is available here.
API Reference : Bucket Operations
API Reference : Bucket policy Operations
API Reference : Bucket notification Operations
SetBucketNotification
GetBucketNotification
RemoveAllBucketNotification
ListenBucketNotification
(MinIO Extension)ListenNotification
(MinIO Extension)
API Reference : File Object Operations
API Reference : Object Operations
GetObject
PutObject
PutObjectStreaming
StatObject
CopyObject
RemoveObject
RemoveObjects
RemoveIncompleteUpload
SelectObjectContent
API Reference : Presigned Operations
API Reference : Client custom settings
Full Examples
Full Examples : Bucket Operations
- makebucket.go
- listbuckets.go
- bucketexists.go
- removebucket.go
- listobjects.go
- listobjectsV2.go
- listincompleteuploads.go
Full Examples : Bucket policy Operations
Full Examples : Bucket lifecycle Operations
Full Examples : Bucket encryption Operations
Full Examples : Bucket replication Operations
Full Examples : Bucket notification Operations
- setbucketnotification.go
- getbucketnotification.go
- removeallbucketnotification.go
- listenbucketnotification.go (MinIO Extension)
- listennotification.go (MinIO Extension)
Full Examples : File Object Operations
Full Examples : Object Operations
- putobject.go
- getobject.go
- putobject-context.go
- getobject-context.go
- statobject.go
- copyobject.go
- removeobject.go
- removeincompleteupload.go
- removeobjects.go
Full Examples : Encrypted Object Operations
Full Examples : Presigned Operations
Explore Further
Contribute
License
This SDK is distributed under the Apache License, Version 2.0, see LICENSE and NOTICE for more information.