alioss

package
v0.0.0-...-9462efd Latest Latest
Warning

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

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

Documentation

Index

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

func (p *Provider) GetSTS(ctx context.Context, roleSessionName string) (*fs.STSResponse, error)

GetSTS get STS note: roleSessionName is required, but you can pass an any string(by zmm).

func (*Provider) ParseUrlKey

func (p *Provider) ParseUrlKey(urlStr string) (key string, err error)

ParseUrlKey parse url key.

func (*Provider) ProviderConfig

func (p *Provider) ProviderConfig() *fs.ProviderConfig

ProviderConfig return ProviderConfig. Provider need hold a ProviderConfig.

func (*Provider) S3Client

func (p *Provider) S3Client() *s3.Client

S3Client get s3 client

Jump to

Keyboard shortcuts

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