awss3

package
v0.0.0-...-9e48597 Latest Latest
Warning

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

Go to latest
Published: Apr 12, 2024 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	DRIVE_TYPE_SYSTEM = 1
	DRIVE_TYPE_TEAM   = 2
)
View Source
const AWS_DRIVE_URL_KOZMO_CLOUD = "kozmo-cloud-storage.kozmoai.com.s3.ap-northeast-1.amazonaws.com"
View Source
const AWS_DRIVE_URL_KOZMO_CLOUD_TEAM = "kozmo-cloud-team-storage.kozmoai.com.s3.ap-northeast-1.amazonaws.com"
View Source
const KOZMO_DRIVE_URL_KOZMO_CLOUD = "kozmo-cloud-storage.kozmoai.com"
View Source
const KOZMO_DRIVE_URL_KOZMO_CLOUD_TEAM = "kozmo-cloud-team-storage.kozmoai.com"

Variables

This section is empty.

Functions

func CreateAWSSession

func CreateAWSSession(awsConfig *AWSConfig) *session.Session

func CreateS3Session

func CreateS3Session(awsSession *session.Session) *s3.S3

Types

type AWSConfig

type AWSConfig struct {
	Endpoint        string
	AccessKeyID     string
	AccessKeySecret string
	Region          string
	BucketName      string
	UploadTimeout   time.Duration
	DriveType       int
}

func NewAWSConfig

func NewAWSConfig(endpoint string, accessKeyID string, accessKeySecret string, region string, bucketName string, uploadTimeout int) *AWSConfig

func NewSystemAwsConfigByGlobalConfig

func NewSystemAwsConfigByGlobalConfig(config *config.Config) *AWSConfig

func NewTeamAwsConfigByGlobalConfig

func NewTeamAwsConfigByGlobalConfig(config *config.Config) *AWSConfig

type S3Drive

type S3Drive struct {
	Instance *s3.S3
	Session  *session.Session
	Config   *AWSConfig
}

func NewS3Drive

func NewS3Drive(awsConfig *AWSConfig) *S3Drive

func (*S3Drive) GetPreSignedPutURL

func (s3Drive *S3Drive) GetPreSignedPutURL(fileName string) (string, error)

Jump to

Keyboard shortcuts

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