s3

package
v0.0.0-...-a3b2f4c Latest Latest
Warning

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

Go to latest
Published: Oct 16, 2023 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	OptionEndpoint        = "endpoint"
	OptionAccessKeyId     = "accessKeyId"
	OptionSecretAccessKey = "secretAccessKey"
	OptionRegion          = "region"
	OptionBucket          = "bucket"
	OptionPrefix          = "prefix"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type S3Cache

type S3Cache struct {
	Client *s3.S3

	Bucket string
	Prefix string
}

func New

func New(options map[string]string) (*S3Cache, error)

func (*S3Cache) Delete

func (s *S3Cache) Delete(ctx context.Context, key string) error

Delete removes a certificate data from the cache under the specified key. If there's no such key in the cache, Delete returns nil.

func (*S3Cache) Get

func (s *S3Cache) Get(ctx context.Context, key string) ([]byte, error)

Get returns a certificate data for the specified key. If there's no such key, Get returns ErrCacheMiss.

func (*S3Cache) Put

func (s *S3Cache) Put(ctx context.Context, key string, data []byte) error

Put stores the data in the cache under the specified key. Underlying implementations may use any data storage format, as long as the reverse operation, Get, results in the original data.

Jump to

Keyboard shortcuts

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