s3util

package
v0.0.0-...-b178995 Latest Latest
Warning

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

Go to latest
Published: Jul 19, 2020 License: MIT Imports: 16 Imported by: 0

Documentation

Overview

http://docs.aws.amazon.com/cli/latest/userguide/cli-chap-getting-started.html#cli-config-files

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func New

func New(region string) (*session.Session, error)

func NewWithCustomEndoint

func NewWithCustomEndoint(accessKey, secretKey, region, url string) (*session.Session, error)

func Open

func Open(nkey *[32]byte, data []byte) ([]byte, error)

Open a previously sealed secretbox with the key derived from `password` (using scrypt)

func Seal

func Seal(nkey *[32]byte, blb *blob.Blob) ([]byte, error)

Seal the data with the key derived from `password` (using scrypt) and seal the data with nacl/secretbox

Types

type Bucket

type Bucket struct {
	Name string
	// contains filtered or unexported fields
}

func NewBucket

func NewBucket(svc *s3.S3, name string) *Bucket

func (*Bucket) Create

func (b *Bucket) Create() error

func (*Bucket) Exists

func (b *Bucket) Exists() (bool, error)

func (*Bucket) GetObject

func (b *Bucket) GetObject(key string) *Object

func (*Bucket) Iter

func (b *Bucket) Iter(max int, f func(*Object) error) error

func (*Bucket) List

func (b *Bucket) List(marker string, max int) ([]*Object, error)

func (*Bucket) ListPrefix

func (b *Bucket) ListPrefix(prefix, marker string, max int) ([]*Object, error)

type EncryptedBlob

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

func NewEncryptedBlob

func NewEncryptedBlob(o *Object, key *[32]byte) *EncryptedBlob

func (*EncryptedBlob) HashAndPlainText

func (b *EncryptedBlob) HashAndPlainText() (string, []byte, error)

func (*EncryptedBlob) PlainText

func (b *EncryptedBlob) PlainText() ([]byte, error)

func (*EncryptedBlob) PlainTextHash

func (b *EncryptedBlob) PlainTextHash() (string, error)

type Object

type Object struct {
	Key    string
	Bucket string
	Size   int64
	// contains filtered or unexported fields
}

func (*Object) Copy

func (o *Object) Copy(dest string) error

func (*Object) Delete

func (o *Object) Delete() error

func (*Object) Exists

func (o *Object) Exists() (bool, error)

func (*Object) Peeker

func (o *Object) Peeker(size int64) (io.ReadCloser, error)

func (*Object) Reader

func (o *Object) Reader() (io.ReadCloser, error)

Jump to

Keyboard shortcuts

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