minioclient

package
v0.0.0-...-4c1562d Latest Latest
Warning

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

Go to latest
Published: Dec 6, 2024 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

View Source
const (
	BucketPublicReadPolicy = "public_read"
)

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(ctx context.Context, conf *Config) (*Client, error)

func (*Client) Close

func (c *Client) Close()

func (*Client) CreateBucketIfNotExist

func (c *Client) CreateBucketIfNotExist(ctx context.Context) error

func (*Client) GetConfig

func (c *Client) GetConfig() *Config

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, objectKey string) ([]byte, error)

func (*Client) PresignedGetObject

func (c *Client) PresignedGetObject(ctx context.Context, objectKey string) (string, error)

func (*Client) PresignedPutObject

func (c *Client) PresignedPutObject(ctx context.Context, objectKey string) (string, error)

func (*Client) PublicGetObject

func (c *Client) PublicGetObject(ctx context.Context, objectKey string) (string, error)

func (*Client) PutObject

func (c *Client) PutObject(ctx context.Context, objectKey string, buf []byte) error

type Config

type Config struct {
	Endpoint           string        `yaml:"endpoint"`
	Bucket             string        `yaml:"bucket"`
	Policy             string        `yaml:"policy"`
	AccessKeyID        string        `yaml:"access_key_id"`
	SecretAccessKey    string        `yaml:"secret_access_key"`
	PresignedPutExpiry time.Duration `yaml:"presigned_put_expiry"`
	PresignedGetExpiry time.Duration `yaml:"presigned_get_expiry"`
}

func NewDefaultConf

func NewDefaultConf() *Config

Jump to

Keyboard shortcuts

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