s3

package
v1.0.2 Latest Latest
Warning

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

Go to latest
Published: May 13, 2022 License: AGPL-3.0 Imports: 30 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func FromGatewayObjectPart

func FromGatewayObjectPart(partID int, oi minio.ObjectInfo) (pi minio.PartInfo)

FromGatewayObjectPart converts ObjectInfo for custom part stored as object to PartInfo

func NewChainCredentials

func NewChainCredentials(providers []credentials.Provider) *credentials.Credentials

NewChainCredentials returns a pointer to a new Credentials object wrapping a chain of providers.

Types

type Chain

type Chain struct {
	Providers []credentials.Provider
	// contains filtered or unexported fields
}

A Chain will search for a provider which returns credentials and cache that provider until Retrieve is called again.

The Chain provides a way of chaining multiple providers together which will pick the first available using priority order of the Providers in the list.

If none of the Providers retrieve valid credentials Value, ChainProvider's Retrieve() will return the no credentials value.

If a Provider is found which returns valid credentials Value ChainProvider will cache that Provider for all calls to IsExpired(), until Retrieve is called again after IsExpired() is true.

creds := credentials.NewChainCredentials(
    []credentials.Provider{
        &credentials.EnvAWSS3{},
        &credentials.EnvMinio{},
    })

// Usage of ChainCredentials.
mc, err := minio.NewWithCredentials(endpoint, creds, secure, "us-east-1")
if err != nil {
     log.Fatalln(err)
}

func (*Chain) IsExpired

func (c *Chain) IsExpired() bool

IsExpired will returned the expired state of the currently cached provider if there is one. If there is no current provider, true will be returned.

func (*Chain) Retrieve

func (c *Chain) Retrieve() (credentials.Value, error)

Retrieve returns the credentials value, returns no credentials(anonymous) if no credentials provider returned any value.

If a provider is found with credentials, it will be cached and any calls to IsExpired() will return the expired state of the cached provider.

type S3

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

S3 implements Gateway.

func (*S3) Name

func (g *S3) Name() string

Name implements Gateway interface.

func (*S3) NewGatewayLayer

func (g *S3) NewGatewayLayer(creds madmin.Credentials) (minio.ObjectLayer, error)

NewGatewayLayer returns s3 ObjectLayer.

Jump to

Keyboard shortcuts

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