minio

package
v0.2.7 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2024 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Overview

Package minio provides Helper type to initialize minio client, as well as retrieve resources or resource info with a url string.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewMinioClient

func NewMinioClient(config Config) (*minio.Client, error)

NewMinioClient creates a new minio client. If accesskey and secretkey are provided, they are used to create the client. Otherwise, AWS EC2 IAM role credentials will be used instead.

Types

type Config

type Config struct {
	Endpoint  string `json:"endpoint"`
	AccessKey string `json:"accesskey"`
	SecretKey string `json:"secretkey"`
	Secure    bool   `json:"secure"`
	Region    string `json:"region"`
}

Config is used to create a minio client.

type Handler

type Handler = core.Handler

Handler is an alias for core.Handler

type Helper

type Helper struct {
	Client     *minio.Client
	BucketName string
	Prefix     string
	// contains filtered or unexported fields
}

Helper provides the interface to the S3 compatible backend.

func NewMinioHelperWithBucket

func NewMinioHelperWithBucket(config Config, bucketName string, prefix string, maxAttempts int) (Helper, error)

NewMinioHelperWithBucket creates a new minio.Helper object.

func (*Helper) GetBucketNameAndPrefix

func (h *Helper) GetBucketNameAndPrefix(url string) (bucketname string, prefix string)

GetBucketNameAndPrefix infers the bucket name and prefix from the url.

func (*Helper) GetObject

func (h *Helper) GetObject(url string) (Resource, error)

GetObject retrieves the metadata and data from the S3 compatible backend.

func (*Helper) StatObject

func (h *Helper) StatObject(url string) (Resource, error)

StatObject retrieves the metadata (only) from a S3 compatible backend.

func (*Helper) TestConnection

func (h *Helper) TestConnection() (string, error)

TestConnection test connection to backend

type Resource

type Resource = core.Resource

Resource is an alias for core.Resource

type ResourceInfo

type ResourceInfo = core.ResourceInfo

ResourceInfo is an alias for core.ResourceInfo

type ServeHandler

type ServeHandler = core.ServeHandler

ServeHandler is an alias for core.ServeHandler

Jump to

Keyboard shortcuts

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