aws

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jun 11, 2025 License: Apache-2.0, MIT Imports: 54 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

View Source
var PieceQueueMessageGroupID = "piece-queue"

Functions

func Construct

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

func DecodeLinkMessage

func DecodeLinkMessage(messageBody string) (datamodel.Link, error)

DecodeLinkMessage extracts a link from an SQS queue messagebody

func DecodePieceMessage

func DecodePieceMessage(messageBody string) (piece.PieceLink, error)

DecodePieceMessage extracts a piece link from an SQS queue messagebody

Types

type AWSAggregator

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

func (*AWSAggregator) AggregatePiece

func (aa *AWSAggregator) AggregatePiece(ctx context.Context, pieceLink piece.PieceLink) error

AggregatePiece is the frontend to aggregation

type Config

type Config struct {
	Config                         aws.Config
	S3Options                      []func(*s3.Options)
	DynamoOptions                  []func(*dynamodb.Options)
	SentryDSN                      string
	SentryEnvironment              string
	AllocationsTableName           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
	IPNIPublisherAnnounceAddress   string
	BlobsPublicURL                 string
	RanLinkIndexTableName          string
	ReceiptStoreBucket             string
	ReceiptStorePrefix             string
	SQSPDPPieceAggregatorURL       string
	SQSPDPAggregateSubmitterURL    string
	SQSPDPPieceAccepterURL         string
	PDPProofSet                    uint64
	CurioURL                       string
	PrincipalMapping               map[string]string
	principal.Signer
}

func FromEnv

func FromEnv(ctx context.Context) Config

FromEnv constructs the AWS Configuration from the environment

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) 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 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 LinkMessage

type LinkMessage struct {
	Link string `json:"link,omitempty"`
}

LinkMessage is a struct that is serialized onto an SQS message queue in JSON

type PDP

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

func NewPDP

func NewPDP(cfg Config) (*PDP, error)

func (*PDP) Aggregator

func (p *PDP) Aggregator() aggregator.Aggregator

Aggregator implements pdp.PDP.

func (*PDP) PieceAdder

func (p *PDP) PieceAdder() pieceadder.PieceAdder

PieceAdder implements pdp.PDP.

func (*PDP) PieceFinder

func (p *PDP) PieceFinder() piecefinder.PieceFinder

PieceFinder implements pdp.PDP.

type PieceLinkMessage

type PieceLinkMessage struct {
	Piece string `json:"piece,omitempty"`
}

PieceLinkMessage is the struct that is serialized onto an SQS message queue in JSON

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 (*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.

type SQSAggregateQueue

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

SQSAggregateQueue implements the providercacher.CachingQueue interface using SQS

func NewSQSAggregateQueue

func NewSQSAggregateQueue(cfg aws.Config, queurURL string) *SQSAggregateQueue

NewSQSAggregateQueue returns a new SQSCachingQueue for the given aws config

func (*SQSAggregateQueue) Enqueue

func (s *SQSAggregateQueue) Enqueue(ctx context.Context, _ string, link datamodel.Link) error

Enqueue implements blobindexlookup.CachingQueue.

type SQSPieceQueue

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

SQSPieceQueue implements the providercacher.CachingQueue interface using SQS

func NewSQSPieceQueue

func NewSQSPieceQueue(cfg aws.Config, queurURL string) *SQSPieceQueue

NewSQSPieceQueue returns a new SQSCachingQueue for the given aws config

func (*SQSPieceQueue) Queue

func (s *SQSPieceQueue) Queue(ctx context.Context, piece piece.PieceLink) error

Queue implements blobindexlookup.CachingQueue.

Jump to

Keyboard shortcuts

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