gcp

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: 6 Imported by: 0

Documentation

Overview

Package gcp fornece a implementação da interface de armazenamento para Google Cloud Storage

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 Google Cloud Storage

func NewClient

func NewClient(ctx context.Context, config Config) (*Client, error)

NewClient cria um novo cliente GCS

func (*Client) BucketExists

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

BucketExists verifica se um bucket existe no GCS

func (*Client) Close

func (c *Client) Close() error

Close fecha o cliente GCS

func (*Client) DeleteObject

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

DeleteObject remove um objeto do GCS

func (*Client) EnsureBucketExists

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

EnsureBucketExists garante que um bucket existe no GCS

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 GCS

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 no GCS

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 GCS

type Config

type Config struct {
	ProjectID string // Projeto responsável pela cobrança (requester pays)
}

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

Jump to

Keyboard shortcuts

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