Skip to content

Commit

Permalink
Typo
Browse files Browse the repository at this point in the history
  • Loading branch information
iredmail committed Sep 7, 2023
1 parent 4dfe51a commit bf6aa01
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 2 deletions.
15 changes: 13 additions & 2 deletions s3/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ func (s *Storage) Delete(key string) error
func (s *Storage) Reset() error
func (s *Storage) Close() error
func (s *Storage) Conn() *s3.Client

// Additional useful methods.
func (s *Storage) CreateBucker(bucket string) error
func (s *Storage) DeleteBucket(bucket string) error
func (s *Storage) SetWithChecksum(key string, val []byte, checksum map[types.ChecksumAlgorithm][]byte) error
```

### Installation
Expand Down Expand Up @@ -83,15 +88,19 @@ ask S3 server to verify data integrity on server side:
> For more information, see [PutObjectInput](https://pkg.go.dev/github.com/aws/aws-sdk-go-v2/service/s3#PutObjectInput).
```go
key := "my-key"
val := []byte("my-value")
sha256sum := sha256.New().Sum256(val)

hash := sha256.New()
hash.Write(val)
sha256sum := hash.Sum(nil)

// import "github.com/aws/aws-sdk-go-v2/service/s3/types"
checksum = map[types.ChecksumAlgorithm][]byte{
types.ChecksumAlgorithmSha256: sha256sum,
}

err := store.SetWithChecksum("my-key", []byte("my-value"), checksum)
err := store.SetWithChecksum(key, val, checksum)
```

### Config
Expand Down Expand Up @@ -136,7 +145,9 @@ type Credentials struct {
```

### Default Config

The default configuration lacks Bucket, Region, and Endpoint which are all required and must be overwritten:

```go
// ConfigDefault is the default config
var ConfigDefault = Config{
Expand Down
1 change: 1 addition & 0 deletions s3/s3_methods.go
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ func (s *Storage) CreateBucket(bucket string) error {
return err
}

// DeleteBucket deletes a bucket.
func (s *Storage) DeleteBucket(bucket string) error {
ctx, cancel := s.requestContext()
defer cancel()
Expand Down

0 comments on commit bf6aa01

Please sign in to comment.