aws

package module
v0.0.0-...-65545f7 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: MIT Imports: 22 Imported by: 0

Documentation

Overview

#### References: - https://us-east-1.console.aws.amazon.com/console/home?region=us-east-1 - https://docs.aws.amazon.com/IAM/latest/UserGuide/id_credentials_temp_request.html - https://docs.aws.amazon.com/AmazonS3/latest/userguide/example-bucket-policies.html - https://docs.aws.amazon.com/code-samples/latest/catalog/go-s3-s3_copy_object.go.html - https://snyk.io/advisor/npm-package/@aws-sdk/client-s3/example - https://github.com/awsdocs/aws-doc-sdk-examples/blob/0f49111e99d1bd7d3ac11103051d731ee3eb519b/javascript/example_code/nodegetstarted/sampleV3.js

Index

Constants

View Source
const (
	AWS_Domain     = "amazonaws.com"
	CODE_NoSuchKey = "NoSuchKey"
)

Variables

This section is empty.

Functions

func ConfigDemo

func ConfigDemo() string

Types

type S3Client

type S3Client struct {
	*s3manager.Uploader
	// contains filtered or unexported fields
}

func NewS3Client

func NewS3Client(fp, field string) (client *S3Client, err error)

func (*S3Client) BucketUrl

func (client *S3Client) BucketUrl() string

func (*S3Client) Copy

func (client *S3Client) Copy(ctx context.Context, source, target string, opts ...request.Option) (
	code string, err error)

func (*S3Client) Delete

func (client *S3Client) Delete(ctx context.Context, source string, opts ...request.Option) (
	err error)

func (*S3Client) Get

func (client *S3Client) Get(ctx context.Context, source, target string, opts ...request.Option) (
	code string, err error)

func (*S3Client) GetSts

func (client *S3Client) GetSts(ctx context.Context, sessionName string) (
	result *StsResult, err error)

func (*S3Client) StsUploadLocal

func (client *S3Client) StsUploadLocal(ctx context.Context, sessionName, source, target string) (
	link string, err error)

func (*S3Client) Upload

func (client *S3Client) Upload(ctx context.Context, source, target string) (
	link string, err error)

func (*S3Client) UploadDir

func (client *S3Client) UploadDir(ctx context.Context, source, target string) (
	link string, err error)

func (*S3Client) UploadFromUrl

func (client *S3Client) UploadFromUrl(ctx context.Context, source, target string) (
	link string, err error)

func (*S3Client) UploadLocal

func (client *S3Client) UploadLocal(ctx context.Context, source, target string) (
	link string, err error)

type S3Config

type S3Config struct {
	AccessKeyId     string `mapstructure:"access_key_id"  json:"accessKeyId,omitempty"`
	SecretAccessKey string `mapstructure:"secrete_access_key" json:"secreteAccessKey,omitempty"`
	Region          string `mapstructure:"region" json:"region,omitempty"`
	Bucket          string `mapstructure:"bucket" json:"bucket,omitempty"`

	AssumeArn       string `mapstructure:"assume_arn" json:"assumeArn,omitempty"`
	DurationSeconds int64  `mapstructure:"duration_seconds" json:"site,omitempty"`
	// contains filtered or unexported fields
}

func NewS3Config

func NewS3Config(fp, field string) (config S3Config, err error)

func (*S3Config) Valid

func (config *S3Config) Valid() (err error)

type StsResult

type StsResult struct {
	AccessKeyId     string `json:"accessKeyId"`
	SecretAccessKey string `json:"secretAccessKey"`
	SessionToken    string `json:"sessionToken"`
	Expiration      string `json:"expiration"`
	Region          string `json:"region"`
	Bucket          string `json:"bucket"`
}

Jump to

Keyboard shortcuts

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