aws

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 23, 2025 License: MIT Imports: 10 Imported by: 0

Documentation

Overview

Package aws fornece a implementação da interface de armazenamento para Amazon S3

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client implementa a interface StorageProvider para AWS S3

func NewClient

func NewClient(config Config) (*Client, error)

NewClient cria um novo cliente AWS S3

func (*Client) BucketExists

func (c *Client) BucketExists(ctx context.Context, bucketName string) (bool, error)

BucketExists verifica se um bucket existe no S3

func (*Client) Close

func (c *Client) Close() error

Close fecha o cliente (no caso do S3, não há nada a fechar)

func (*Client) DeleteObject

func (c *Client) DeleteObject(ctx context.Context, bucketName, objectName string) error

DeleteObject remove um objeto do S3

func (*Client) EnsureBucketExists

func (c *Client) EnsureBucketExists(ctx context.Context, bucketName string) error

EnsureBucketExists garante que um bucket existe, criando-o se necessário

func (*Client) GetObject

func (c *Client) GetObject(ctx context.Context, bucketName, objectName string) (*interfaces.ObjectInfo, io.ReadCloser, error)

GetObject obtém um objeto armazenado no S3

func (*Client) ListObjects

func (c *Client) ListObjects(ctx context.Context, bucketName string) (map[string]*interfaces.ObjectInfo, error)

ListObjects lista todos os objetos em um bucket específico

func (*Client) UploadObject

func (c *Client) UploadObject(ctx context.Context, bucketName, objectName string, reader io.Reader, size int64, contentType string) (*interfaces.UploadInfo, error)

UploadObject faz upload de um objeto para o S3

type Config

type Config struct {
	Region          string
	AccessKeyID     string
	SecretAccessKey string
	Endpoint        string // Opcional, para uso com serviços S3-compatible
	DisableSSL      bool   // Opcional, para uso com serviços S3-compatible
}

Config contém a configuração necessária para o cliente AWS S3

Jump to

Keyboard shortcuts

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