Documentation ¶
Index ¶
- func BuildProvider(ctx context.Context, config *fs.ProviderConfig) (fs.S3Provider, error)
- type Provider
- func (p *Provider) GetPreSignedURL(ctx context.Context, bucket, path string, expires time.Duration) (string, error)
- func (p *Provider) GetSTS(ctx context.Context, roleSessionName string) (*fs.STSResponse, error)
- func (p *Provider) ParseUrlKey(urlStr string) (key string, err error)
- func (p *Provider) ProviderConfig() *fs.ProviderConfig
- func (p *Provider) S3Client() *s3.Client
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func BuildProvider ¶
func BuildProvider(ctx context.Context, config *fs.ProviderConfig) (fs.S3Provider, error)
BuildProvider create aws s3 provider. it matches fs.S3ProviderBuilder
Types ¶
type Provider ¶
type Provider struct {
// contains filtered or unexported fields
}
Provider for ali yun. it implements fs.S3Provider. it uses s3.Client to access s3 compatible storage, use native ali yun sdk to call sts service. import package to register provider:
import ( _ "github.com/woocoos/knockout-go/api/fs/alioss" )
func (*Provider) GetPreSignedURL ¶
func (p *Provider) GetPreSignedURL(ctx context.Context, bucket, path string, expires time.Duration) (string, error)
GetPreSignedURL get signed url by ali yun rule.
func (*Provider) GetSTS ¶
GetSTS get STS note: roleSessionName is required, but you can pass an any string(by zmm).
func (*Provider) ParseUrlKey ¶
ParseUrlKey parse url key.
func (*Provider) ProviderConfig ¶
func (p *Provider) ProviderConfig() *fs.ProviderConfig
ProviderConfig return ProviderConfig. Provider need hold a ProviderConfig.
Click to show internal directories.
Click to hide internal directories.