awsdemo

package module
v0.0.0-...-041b7c8 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2020 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Config = ProjectConfig{
	AwsRegion: "ap-southeast-1",
}

Functions

func DeleteS3Object

func DeleteS3Object(bucketName, keyName string) (bool, error)

* 从aws s3中删除对象

func DeleteSqsMessage

func DeleteSqsMessage(queueUrl string, receiptHandle string) error

从sqs中删除消息

func GetAwsQueueUrl

func GetAwsQueueUrl(queueName string) (string, error)

func GetObjectFromS3

func GetObjectFromS3(bucketName, keyName string) (*aws.WriteAtBuffer, error)

func NewAwsSession

func NewAwsSession() *session.Session

* 获取aws的session

func ReceiveMessage

func ReceiveMessage(queueUrl string, maxNumber int64) (result *sqs.ReceiveMessageOutput, err error)

* 获取消息

func SendMessageToSQS

func SendMessageToSQS(queueName string, body string) error

发送消息到SQS 参数:body 传递的消息内容,queueName 消息队列名称

func UpljoadBinFileToS3

func UpljoadBinFileToS3(f io.Reader, bucketName string, keyName, contentType string) (string, error)

Types

type ProjectConfig

type ProjectConfig struct {
	// 图片上传的目标桶
	AwsRegion     string // aws的区域
	TargetBucket  string // 目标桶
	TargetRootDir string // 目标桶根目录

	// aws密匙
	AwsSecretKeyId     string // Aws Secret Key Id
	AwsSecretAccessKey string // Aws Secret Access Key
}

Jump to

Keyboard shortcuts

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