confs3

package
v1.2.5-rc2 Latest Latest
Warning

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

Go to latest
Published: Jun 24, 2023 License: Apache-2.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	DefaultGetObjectOptions    = minio.GetObjectOptions{}
	DefaultRemoveObjectOptions = minio.RemoveObjectOptions{}
)
View Source
var ErrInvalidObjectKey = errors.New("invalid object key")

Functions

func COSPresignedValues

func COSPresignedValues(db *ObjectDB, key string, exp time.Duration) url.Values

func HMAC

func HMAC(key, msg, signMethod string) []byte

Types

type AuthTime

type AuthTime struct {
	SignStartTime time.Time
	SignEndTime   time.Time
	KeyStartTime  time.Time
	KeyEndTime    time.Time
}

AuthTime is a struct storing the q-signSearch-time and q-key-time which are needed to generate signature

func NewAuthTime

func NewAuthTime(du time.Duration) *AuthTime

type ObjectDB

type ObjectDB struct {
	Endpoint        string
	Region          string
	AccessKeyID     string
	SecretAccessKey types.Password
	BucketName      string
	Secure          bool
	UrlExpire       types.Duration
	Presigned       PresignedFn `env:"-"`
}

func (*ObjectDB) Client

func (db *ObjectDB) Client() (*minio.Client, error)

func (*ObjectDB) Delete

func (db *ObjectDB) Delete(key string) error

func (*ObjectDB) DeleteObject

func (db *ObjectDB) DeleteObject(ctx context.Context, meta *ObjectMeta) error

func (*ObjectDB) DownloadUrl added in v1.2.3

func (db *ObjectDB) DownloadUrl(key string) (string, error)

func (*ObjectDB) ListObjectByGroup

func (db *ObjectDB) ListObjectByGroup(ctx context.Context, grp string) ([]*ObjectMeta, error)

func (*ObjectDB) LivenessCheck

func (db *ObjectDB) LivenessCheck() map[string]string

func (*ObjectDB) PresignedPutObject

func (db *ObjectDB) PresignedPutObject(ctx context.Context, meta *ObjectMeta, exp time.Duration) (string, error)

func (*ObjectDB) ProtectURL

func (db *ObjectDB) ProtectURL(ctx context.Context, meta *ObjectMeta, exp time.Duration) (*url.URL, error)

func (*ObjectDB) PublicURL

func (db *ObjectDB) PublicURL(meta *ObjectMeta) *url.URL

func (*ObjectDB) PutObject

func (db *ObjectDB) PutObject(ctx context.Context, r io.Reader, meta *ObjectMeta) error

func (*ObjectDB) Read

func (db *ObjectDB) Read(key string) ([]byte, error)

func (*ObjectDB) ReadObject

func (db *ObjectDB) ReadObject(ctx context.Context, w io.Writer, meta *ObjectMeta) error

func (*ObjectDB) SetDefault added in v1.2.3

func (db *ObjectDB) SetDefault()

func (*ObjectDB) StatsObject

func (db *ObjectDB) StatsObject(ctx context.Context, meta *ObjectMeta) (*ObjectMeta, error)

func (*ObjectDB) Upload

func (db *ObjectDB) Upload(key string, content []byte) error

type ObjectMeta

type ObjectMeta struct {
	ObjectID    uint64 `json:"objectID"`
	Group       string `json:"group"`
	Size        int64  `json:"size"`
	ContentType string `json:"contentType"`
	ETag        string `json:"etag"`
}

func ParseObjectMetaFromKey

func ParseObjectMetaFromKey(key string) (*ObjectMeta, error)

func (ObjectMeta) Key

func (meta ObjectMeta) Key() string

type PresignedFn

type PresignedFn func(db *ObjectDB, key string, exp time.Duration) url.Values

type S3Endpoint

type S3Endpoint interface {
	Endpoint() string
	AccessKeyID() string
	SecretAccessKey() string
	BucketName() string
	Secure() bool
}

Jump to

Keyboard shortcuts

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