kodo

package
v0.0.49-alpha.39 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: Apache-2.0 Imports: 22 Imported by: 1

Documentation

Overview

Copyright © 2023 OpenIM. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	Endpoint        string
	Bucket          string
	BucketURL       string
	AccessKeyID     string
	AccessKeySecret string
	SessionToken    string
	PublicRead      bool
}

type Kodo

type Kodo struct {
	AccessKey     string
	SecretKey     string
	Region        string
	Token         string
	Endpoint      string
	BucketURL     string
	Auth          *auth.Credentials
	Client        *awss3.Client
	PresignClient *awss3.PresignClient
}

func NewKodo

func NewKodo(conf Config) (*Kodo, error)

func (Kodo) AbortMultipartUpload

func (k Kodo) AbortMultipartUpload(ctx context.Context, uploadID string, name string) error

func (Kodo) AccessURL

func (k Kodo) AccessURL(ctx context.Context, name string, expire time.Duration, opt *s3.AccessURLOption) (string, error)

func (Kodo) AuthSign

func (k Kodo) AuthSign(ctx context.Context, uploadID string, name string, expire time.Duration, partNumbers []int) (*s3.AuthSignResult, error)

func (Kodo) CompleteMultipartUpload

func (k Kodo) CompleteMultipartUpload(ctx context.Context, uploadID string, name string, parts []s3.Part) (*s3.CompleteMultipartUploadResult, error)

func (Kodo) CopyObject

func (k Kodo) CopyObject(ctx context.Context, src string, dst string) (*s3.CopyObjectInfo, error)

func (Kodo) DeleteObject

func (k Kodo) DeleteObject(ctx context.Context, name string) error

func (Kodo) Engine

func (k Kodo) Engine() string

func (*Kodo) FormData

func (k *Kodo) FormData(ctx context.Context, name string, size int64, contentType string, duration time.Duration) (*s3.FormData, error)

func (Kodo) InitiateMultipartUpload

func (k Kodo) InitiateMultipartUpload(ctx context.Context, name string) (*s3.InitiateMultipartUploadResult, error)

func (Kodo) IsNotFound

func (k Kodo) IsNotFound(err error) bool

func (Kodo) ListUploadedParts

func (k Kodo) ListUploadedParts(ctx context.Context, uploadID string, name string, partNumberMarker int, maxParts int) (*s3.ListUploadedPartsResult, error)

func (Kodo) PartLimit

func (k Kodo) PartLimit() *s3.PartLimit

func (Kodo) PartSize

func (k Kodo) PartSize(ctx context.Context, size int64) (int64, error)

func (Kodo) PresignedPutObject

func (k Kodo) PresignedPutObject(ctx context.Context, name string, expire time.Duration) (string, error)

func (*Kodo) SetObjectContentType

func (k *Kodo) SetObjectContentType(ctx context.Context, name string, contentType string) error

func (Kodo) StatObject

func (k Kodo) StatObject(ctx context.Context, name string) (*s3.ObjectInfo, error)

Jump to

Keyboard shortcuts

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