aws

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 16, 2025 License: Apache-2.0, MIT Imports: 65 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrDynamoRecordNotFound = errors.New("no record found in dynamo table")

ErrDynamoRecordNotFound is used when there is no record in a dynamo table (given that GetItem does not actually error)

View Source
var ErrIndexingServiceProofsMissing = errors.New("indexing service proofs are missing")
View Source
var ErrMissingSecret = errors.New("missing value for secret")

ErrMissingSecret means that the value returned from Secrets was empty

Functions

func Construct

func Construct(cfg Config) (storage.Service, error)

Types

type Config

type Config struct {
	Config                            aws.Config
	S3Options                         []func(*s3.Options)
	DynamoOptions                     []func(*dynamodb.Options)
	SentryDSN                         string
	SentryEnvironment                 string
	AllocationsTableName              string
	AcceptanceTableName               string
	BlobStoreBucketEndpoint           string
	BlobStoreBucketRegion             string
	BlobStoreBucketAccessKeyID        string
	BlobStoreBucketSecretAccessKey    string
	BlobStoreBucketKeyPattern         string
	BlobStoreBucket                   string
	AggregatesBucket                  string
	AggregatesPrefix                  string
	BufferBucket                      string
	BufferPrefix                      string
	ChunkLinksTableName               string
	MetadataTableName                 string
	IPNIStoreBucket                   string
	IPNIStorePrefix                   string
	IPNIAnnounceURLs                  []url.URL
	ClaimStoreBucket                  string
	ClaimStorePrefix                  string
	PublicURL                         string
	IndexingServiceDID                string
	IndexingServiceURL                string
	IndexingServiceProof              string
	UploadServiceDID                  did.DID
	UploadServiceURL                  *url.URL
	IPNIPublisherAnnounceAddress      string
	BlobsPublicURL                    string
	RanLinkIndexTableName             string
	ReceiptStoreBucket                string
	ReceiptStorePrefix                string
	SQSPublishingQueueID              string
	SQSAdvertisementPublishingQueueID string
	PublishingBucket                  string
	PrincipalMapping                  map[string]string
	principal.Signer
}

func FromEnv

func FromEnv(ctx context.Context) Config

FromEnv constructs the AWS Configuration from the environment

type DynamoAcceptanceStore added in v0.0.18

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

DynamoAcceptanceStore implements the AcceptanceStore interface on dynamodb

func NewDynamoAcceptanceStore added in v0.0.18

func NewDynamoAcceptanceStore(cfg aws.Config, tableName string, opts ...func(*dynamodb.Options)) *DynamoAcceptanceStore

NewDynamoAcceptanceStore returns an AcceptanceStore connected to a AWS DynamoDB table

func (*DynamoAcceptanceStore) Get added in v0.0.18

func (*DynamoAcceptanceStore) List added in v0.0.18

List implements acceptancestore.AcceptanceStore.

func (*DynamoAcceptanceStore) Put added in v0.0.18

Put implements acceptancestore.AcceptanceStore.

type DynamoAllocationStore

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

DynamoAllocationStore implements the AllocationStore interface on dynamodb

func NewDynamoAllocationStore

func NewDynamoAllocationStore(cfg aws.Config, tableName string, opts ...func(*dynamodb.Options)) *DynamoAllocationStore

NewDynamoAllocationStore returns an AllocationStore connected to a AWS DynamoDB table

func (*DynamoAllocationStore) Get added in v0.0.14

func (*DynamoAllocationStore) List

List implements allocationstore.AllocationStore.

func (*DynamoAllocationStore) Put

Put implements allocationstore.AllocationStore.

type DynamoProviderContextTable

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

DynamoProviderContextTable implements the store.ProviderContextTable interface on dynamodb

func NewDynamoProviderContextTable

func NewDynamoProviderContextTable(cfg aws.Config, tableName string, opts ...func(*dynamodb.Options)) *DynamoProviderContextTable

NewDynamoProviderContextTable returns a ProviderContextTable connected to a AWS DynamoDB table

func (*DynamoProviderContextTable) Delete

func (d *DynamoProviderContextTable) Delete(ctx context.Context, p peer.ID, contextID []byte) error

Delete implements store.ProviderContextTable.

func (*DynamoProviderContextTable) Get

func (d *DynamoProviderContextTable) Get(ctx context.Context, p peer.ID, contextID []byte) ([]byte, error)

Get implements store.ProviderContextTable.

func (*DynamoProviderContextTable) Put

func (d *DynamoProviderContextTable) Put(ctx context.Context, p peer.ID, contextID []byte, data []byte) error

Put implements store.ProviderContextTable.

type DynamoRanLinkIndex

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

DynamoRanLinkIndex implements the store.ProviderContextTable interface on dynamodb

func NewDynamoRanLinkIndex

func NewDynamoRanLinkIndex(cfg aws.Config, tableName string, opts ...func(*dynamodb.Options)) *DynamoRanLinkIndex

NewDynamoRanLinkIndex returns a ProviderContextTable connected to a AWS DynamoDB table

func (*DynamoRanLinkIndex) Get

Get implements store.ProviderContextTable.

func (*DynamoRanLinkIndex) Put

Put implements store.ProviderContextTable.

type HandlerContext added in v0.0.13

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

func NewHandlerContext added in v0.0.13

func NewHandlerContext(w http.ResponseWriter, r *http.Request) *HandlerContext

NewHandlerContext creates a new context that satisfies [server.RequestContext] and allows echo style handlers to be used with AWS lambda.

func (*HandlerContext) Request added in v0.0.13

func (c *HandlerContext) Request() *http.Request

func (*HandlerContext) Response added in v0.0.13

func (c *HandlerContext) Response() *echo.Response

func (*HandlerContext) Stream added in v0.0.13

func (c *HandlerContext) Stream(code int, contentType string, r io.Reader) error

type KeyFormatterFunc

type KeyFormatterFunc func(digest multihash.Multihash) string

func NewPatternKeyFormatter

func NewPatternKeyFormatter(pattern string) KeyFormatterFunc

NewPatternKeyFormatter creates a key formatter which replaces instances of "{blob}" in the provided pattern with the base58btc encoding of the multihash digest.

type S3BlobPresigner

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

func (*S3BlobPresigner) SignUploadURL

func (s *S3BlobPresigner) SignUploadURL(ctx context.Context, digest multihash.Multihash, size uint64, ttl uint64) (url.URL, http.Header, error)

SignUploadURL implements presigner.RequestPresigner.

func (*S3BlobPresigner) VerifyUploadURL

func (s *S3BlobPresigner) VerifyUploadURL(ctx context.Context, url url.URL, headers http.Header) (url.URL, http.Header, error)

VerifyUploadURL implements presigner.RequestPresigner.

type S3BlobStore

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

S3BlobStore implements the blobstore.BlobStore interface on S3

func NewS3BlobStore

func NewS3BlobStore(cfg aws.Config, bucket string, formatKey KeyFormatterFunc, opts ...func(*s3.Options)) *S3BlobStore

func (*S3BlobStore) Get

Get implements blobstore.Blobstore.

func (*S3BlobStore) PresignClient

func (s *S3BlobStore) PresignClient() presigner.RequestPresigner

func (*S3BlobStore) Put

func (s *S3BlobStore) Put(ctx context.Context, digest multihash.Multihash, size uint64, body io.Reader) error

Put implements blobstore.Blobstore.

type S3IndexerProofs

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

S3IndexerProofs returns delegation proofs for the indexer

func NewS3IndexerProofs

func NewS3IndexerProofs(cfg aws.Config, bucket string, keyPrefix string, opts ...func(*s3.Options)) *S3IndexerProofs

func (*S3IndexerProofs) Get

Get implements store.Store.

type S3Store

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

S3Store implements the store.Store interface on S3

func NewS3Store

func NewS3Store(cfg aws.Config, bucket string, keyPrefix string, opts ...func(*s3.Options)) *S3Store

func NewS3StoreWithClient added in v0.0.17

func NewS3StoreWithClient(client *s3.Client, bucket string, keyPrefix string) *S3Store

func (*S3Store) Get

func (s *S3Store) Get(ctx context.Context, key string) (io.ReadCloser, error)

Get implements store.Store.

func (*S3Store) Put

func (s *S3Store) Put(ctx context.Context, key string, length uint64, data io.Reader) error

Put implements store.Store.

func (*S3Store) Replace added in v0.0.17

func (s *S3Store) Replace(ctx context.Context, key string, old io.Reader, length uint64, new io.Reader) error

Jump to

Keyboard shortcuts

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