Documentation
¶
Index ¶
- type AWSConfig
- type AWSProvider
- func (p *AWSProvider) CheckConnectionHealth(ctx context.Context) error
- func (p *AWSProvider) DetectRegion() string
- func (p *AWSProvider) GetSecret(ctx context.Context, secretName string) (string, error)
- func (p *AWSProvider) Init(ctx context.Context) error
- func (p *AWSProvider) IsRunningInEC2() bool
- func (p *AWSProvider) IsRunningInECS() bool
- func (p *AWSProvider) Provider() string
- func (p *AWSProvider) S3() (*s3.Client, error)
- func (p *AWSProvider) SQS() (*sqs.Client, error)
- func (p *AWSProvider) SecretsManager() (*secretsmanager.Client, error)
- func (p *AWSProvider) SendSQSMessage(ctx context.Context, queueURL, message string) error
- func (p *AWSProvider) UploadToS3(ctx context.Context, bucket, key string, data []byte) error
- type Provider
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AWSConfig ¶
type AWSConfig struct {
// 区域
Region string
// 访问密钥ID
AccessKeyID string
// 访问密钥
SecretAccessKey string
// 会话令牌
SessionToken string
// 使用ECS容器凭证
UseECSContainerCredential bool
// 使用EC2实例配置文件
UseEC2InstanceProfile bool
// 使用SSO
UseSSO bool
// SSO配置文件
SSOProfile string
// 配置文件名
ProfileName string
// 配置文件路径
ConfigurationPath string
UseSharedConfig bool
// 最大重试次数
MaxRetries int
// 端点URL(模拟本地使用)
EndpointURL string
// 连接超时(秒)
ConnectionTimeout int
}
AWSConfig AWS配置
type AWSProvider ¶
type AWSProvider struct {
// contains filtered or unexported fields
}
AWSProvider AWS云服务提供商适配器
func NewAWSProvider ¶
func NewAWSProvider(cfg AWSConfig) (*AWSProvider, error)
NewAWSProvider 创建AWS提供商适配器
func (*AWSProvider) CheckConnectionHealth ¶
func (p *AWSProvider) CheckConnectionHealth(ctx context.Context) error
CheckConnectionHealth 检查AWS连接健康状态
func (*AWSProvider) DetectRegion ¶
func (p *AWSProvider) DetectRegion() string
DetectRegion 自动检测当前区域
func (*AWSProvider) IsRunningInEC2 ¶
func (p *AWSProvider) IsRunningInEC2() bool
IsRunningInEC2 检查是否在EC2环境中运行
func (*AWSProvider) IsRunningInECS ¶
func (p *AWSProvider) IsRunningInECS() bool
IsRunningInECS 检查是否在ECS环境中运行
func (*AWSProvider) SecretsManager ¶
func (p *AWSProvider) SecretsManager() (*secretsmanager.Client, error)
SecretsManager 获取SecretsManager客户端
func (*AWSProvider) SendSQSMessage ¶
func (p *AWSProvider) SendSQSMessage(ctx context.Context, queueURL, message string) error
SendSQSMessage 发送消息到SQS
func (*AWSProvider) UploadToS3 ¶
UploadToS3 上传文件到S3
Click to show internal directories.
Click to hide internal directories.