minio

package
v0.4.3 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 1, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

func New

func New(opts ...Option) (*Client, error)

func (*Client) FPutObject

func (c *Client) FPutObject(bucketName string, objectName string, filePath string, userTags map[string]string) (*UploadInfo, error)

FPutObject Put Object

func (*Client) GetObject

func (c *Client) GetObject(bucketName, objectName string) (*minioClient.Object, error)

GetObject Get Object

func (*Client) GetObjectByte

func (c *Client) GetObjectByte(bucketName, objectName string) ([]byte, error)

GetObjectByte Get Object Byte

func (*Client) GetObjectRead

func (c *Client) GetObjectRead(bucketName, objectName string) (io.ReadCloser, *minioClient.ObjectInfo, *http.Header, error)

GetObjectRead Get Object read

func (*Client) MakeBucket

func (c *Client) MakeBucket(bucketName string, objectLocking ...bool) error

MakeBucket Make Bucket

func (*Client) PutObject

func (c *Client) PutObject(bucketName string, objectName string, reader io.Reader, objectSize int64, userTags map[string]string) (*UploadInfo, error)

PutObject Put Object

func (*Client) RemoveObject

func (c *Client) RemoveObject(bucketName, objectName string) error

RemoveObject Remove Object

func (*Client) StatObject

func (c *Client) StatObject(bucketName, objectName string) (*ObjectInfo, error)

StatObject Stat Object

type ObjectInfo

type ObjectInfo struct {
	// An ETag is optionally set to md5sum of an object.  In case of multipart objects,
	// ETag is of the form MD5SUM-N where MD5SUM is md5sum of all individual md5sums of
	// each parts concatenated into one string.
	ETag string `json:"etag"`

	Key          string    `json:"name"`         // Name of the object
	LastModified time.Time `json:"lastModified"` // Date and time the object was last modified.
	Size         int64     `json:"size"`         // Size in bytes of the object.
	ContentType  string    `json:"contentType"`  // A standard MIME type describing the format of the object data.

	// x-amz-meta-* headers stripped "x-amz-meta-" prefix containing the first value.
	UserMetadata map[string]string `json:"userMetadata"`

	// x-amz-tagging values in their k/v values.
	UserTags map[string]string `json:"userTags"`

	// x-amz-tagging-count value
	UserTagCount int

	// The class of storage used to store the object.
	StorageClass string `json:"storageClass"`

	// Versioning related information
	IsLatest       bool
	IsDeleteMarker bool
	VersionID      string `xml:"VersionId"`
}

ObjectInfo container for object metadata.

type Option

type Option func(*Client)

Option for queue system

func WithAccess

func WithAccess(accessKeyID, secretAccessKey string) Option

WithAccess set accessKeyID, secretAccessKey function

func WithContext

func WithContext(ctx context.Context) Option

WithContext set ctx function

func WithEncryption

func WithEncryption(password string) Option

WithEncryption set password function

func WithEndpoint

func WithEndpoint(endpoint string) Option

WithEndpoint set endpoint function

func WithRegion

func WithRegion(region string) Option

WithRegion set region function

func WithUseSSL

func WithUseSSL(useSSL bool) Option

WithUseSSL set useSSL function

type UploadInfo

type UploadInfo struct {
	Bucket       string
	Key          string
	ETag         string
	Size         int64
	LastModified time.Time
}

UploadInfo contains information about the newly uploaded or copied object.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL