oss

package
v0.1.4 Latest Latest
Warning

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

Go to latest
Published: Sep 27, 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 interface {
	PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, options ...PutObjectOptions) (*PutObjectResult, error)
	GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)
	RemoveObject(ctx context.Context, bucketName, objectName string) error
	StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error)
}

type MinioClient

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

func NewMinioClient added in v0.1.3

func NewMinioClient(config MinioClientConfig) (*MinioClient, error)

func (*MinioClient) GetObject

func (o *MinioClient) GetObject(ctx context.Context, bucketName, objectName string) (io.ReadCloser, error)

func (*MinioClient) PutObject added in v0.1.3

func (o *MinioClient) PutObject(ctx context.Context, bucketName, objectName string, reader io.Reader, objectSize int64, options ...PutObjectOptions) (*PutObjectResult, error)

func (*MinioClient) RemoveObject

func (o *MinioClient) RemoveObject(ctx context.Context, bucketName, objectName string) error

func (*MinioClient) StatObject

func (o *MinioClient) StatObject(ctx context.Context, bucketName, objectName string) (*ObjectStat, error)

type MinioClientConfig

type MinioClientConfig struct {
	Domain          string
	Endpoint        string
	AccessKeyID     string
	SecretAccessKey string
	UseSSL          bool
	BucketName      string
}

type ObjectStat

type ObjectStat struct {
	Key          string
	ETag         string
	LastModified time.Time
	Size         int64
	ContentType  string
	UserMetadata map[string]string
}

func (*ObjectStat) GetName

func (o *ObjectStat) GetName() string

type PutObjectOptions

type PutObjectOptions struct {
	ContentType  string
	UserMetadata map[string]string
}

type PutObjectResult

type PutObjectResult struct {
	URL  string
	ETag string
}

Jump to

Keyboard shortcuts

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