# README
Minio Go Library for Amazon S3 Compatible Cloud Storage 
Install 
$ go get github.com/minio/minio-go
Example
package main
import (
"log"
"github.com/minio/minio-go"
)
func main() {
config := minio.Config{
AccessKeyID: "YOUR-ACCESS-KEY-HERE",
SecretAccessKey: "YOUR-PASSWORD-HERE",
Endpoint: "https://s3.amazonaws.com",
}
s3Client, err := minio.New(config)
if err != nil {
log.Fatalln(err)
}
for bucket := range s3Client.ListBuckets() {
if bucket.Err != nil {
log.Fatalln(bucket.Err)
}
log.Println(bucket.Stat)
}
}
Documentation
Bucket Level
- MakeBucket(bucket, acl) error
- BucketExists(bucket) error
- RemoveBucket(bucket) error
- GetBucketACL(bucket) (BucketACL, error)
- SetBucketACL(bucket, BucketACL) error)
- ListObjects(bucket, prefix, recursive) <-chan ObjectStat
- ListBuckets() <-chan BucketStat
- DropAllIncompleteUploads(bucket) <-chan error
- DropIncompleteUpload(bucket, object) <-chan error
Object Level
- PutObject(bucket, object, size, io.Reader) error
- GetObject(bucket, object) (io.Reader, ObjectStat, error)
- GetPartialObject(bucket, object, offset, length) (io.Reader, ObjectStat, error)
- StatObject(bucket, object) (ObjectStat, error)
- RemoveObject(bucket, object) error
API Reference
Contribute
# Functions
BodyToErrorResponse returns a new encoded ErrorResponse structure.
New - instantiate a new minio api client.
ToErrorResponse returns parsed ErrorResponse struct, if input is nil or not ErrorResponse return value is nil this fuction is useful when some one wants to dig deeper into the error structures over the network.
# Structs
BucketStat container for bucket metadata.
BucketStatCh - bucket metadata over read channel.
Config - main configuration struct used by all to set endpoint, credentials, and other options for requests.
ErrorResponse is the type error returned by some API operations.
ObjectStat container for object metadata.
ObjectStatCh - object metadata over read channel.
# Interfaces
API - Cloud Storage API interface.
BucketAPI - bucket specific Read/Write/Stat interface.
ObjectAPI - object specific Read/Write/Stat interface.
PresignedAPI - object specific for now.
# Type aliases
BucketACL - bucket level access control.