s3provider

package
v0.10.0 Latest Latest
Warning

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

Go to latest
Published: Jul 7, 2025 License: MIT Imports: 13 Imported by: 4

Documentation

Index

Constants

View Source
const (
	DefaultImage       = "minio/minio"
	DefaultName        = "minio"
	DefaultBucket      = "test-bucket"
	DefaultRegion      = "us-east-1"
	DefaultHost        = "minio"
	DefaultPort        = 9000
	DefaultConsolePort = 9001
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Input

type Input = Minio

type Minio

type Minio struct {
	Host        string `toml:"host"`
	Port        int    `toml:"port"`
	ConsolePort int    `toml:"console_port"`
	AccessKey   string `toml:"access_key"`
	SecretKey   string `toml:"secret_key"`
	Bucket      string `toml:"bucket"`
	Region      string `toml:"region"`
}

func DefaultMinio

func DefaultMinio() *Minio

func (Minio) GetAccessKey

func (m Minio) GetAccessKey() string

func (Minio) GetBaseEndpoint

func (m Minio) GetBaseEndpoint() string

func (Minio) GetBucket

func (m Minio) GetBucket() string

func (Minio) GetConsoleBaseURL

func (m Minio) GetConsoleBaseURL() string

func (Minio) GetConsoleURL

func (m Minio) GetConsoleURL() string

func (Minio) GetEndpoint

func (m Minio) GetEndpoint() string

func (Minio) GetRegion

func (m Minio) GetRegion() string

func (Minio) GetSecretKey

func (m Minio) GetSecretKey() string

func (Minio) Output

func (m Minio) Output() *Output

type MinioFactory

type MinioFactory struct{}

func (MinioFactory) New

func (mf MinioFactory) New(options ...Option) (Provider, error)

func (MinioFactory) NewFrom

func (mf MinioFactory) NewFrom(input *Input) (*Output, error)

type Option

type Option func(*Minio)

func WithAccessKey

func WithAccessKey(accessKey string) Option

func WithConsolePort

func WithConsolePort(consolePort int) Option

func WithPort

func WithPort(port int) Option

func WithSecretKey

func WithSecretKey(secretKey string) Option

type Output

type Output struct {
	SecretKey      string `toml:"secret_key"`
	AccessKey      string `toml:"access_key"`
	Bucket         string `toml:"bucket"`
	ConsoleURL     string `toml:"console_url"`
	ConsoleBaseURL string `toml:"console_base_url"`
	Endpoint       string `toml:"endpoint"`
	BaseEndpoint   string `toml:"base_endpoint"`
	Region         string `toml:"region"`
	UseCache       bool   `toml:"use_cache"`
}

type Provider

type Provider interface {
	GetEndpoint() string
	GetBaseEndpoint() string
	GetConsoleURL() string
	GetConsoleBaseURL() string
	GetSecretKey() string
	GetAccessKey() string
	GetBucket() string
	GetRegion() string
	Output() *Output
}

Provider is the interface that wraps S3 interaction methods.

type ProviderFactory

type ProviderFactory interface {
	New(...Option) (Provider, error)
	NewFrom(*Input) (*Output, error)
}

ProviderFactory is the interface that standardizes S3 providers constructors.

func NewMinioFactory

func NewMinioFactory() ProviderFactory

Jump to

Keyboard shortcuts

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