Documentation
¶
Index ¶
- Constants
- Variables
- func Construct(cfg Config) (types.Service, error)
- func NewBlockIndexTableMapper(id principal.Signer, blockIndexStore BlockIndexStore, ...) (blockIndexTableMapper, error)
- type AllocationsStore
- type BlockIndexRecord
- type BlockIndexStore
- type BucketFallbackMapper
- type Config
- type DynamoAllocationsTable
- type DynamoContentToClaimsMapper
- type DynamoMigratedShardChecker
- type DynamoProviderBlockIndexTable
- type DynamoProviderContextTable
- func (d *DynamoProviderContextTable) Delete(ctx context.Context, p peer.ID, contextID []byte) error
- func (d *DynamoProviderContextTable) Get(ctx context.Context, p peer.ID, contextID []byte) ([]byte, error)
- func (d *DynamoProviderContextTable) Put(ctx context.Context, p peer.ID, contextID []byte, data []byte) error
- type IAMAuthTokenRequest
- type LegacyConfig
- type MigratedShardChecker
- type S3Store
- type SNSRemoteSyncMessage
- type SNSRemoteSyncNotifier
- type SQSCachingDecoder
- type SQSCachingQueue
- func (s *SQSCachingQueue) Delete(ctx context.Context, jobID string) error
- func (s *SQSCachingQueue) Queue(ctx context.Context, job providercacher.ProviderCachingJob) error
- func (s *SQSCachingQueue) Read(ctx context.Context, maxJobs int) ([]queuepoller.WithID[providercacher.ProviderCachingJob], error)
- func (s *SQSCachingQueue) Release(ctx context.Context, jobID string) error
Constants ¶
const ( REQUEST_PROTOCOL = "http://" PARAM_ACTION = "Action" PARAM_USER = "User" ACTION_NAME = "connect" SERVICE_NAME = "elasticache" PARAM_EXPIRES = "X-Amz-Expires" TOKEN_EXPIRY_SECONDS = 899 EMPTY_BODY_SHA256 = "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" // the hex encoded SHA-256 of an empty string )
Variables ¶
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)
var ErrNoPrivateKey = errors.New("no value for private key")
ErrNoPrivateKey means that the value returned from Secrets was empty
Functions ¶
func NewBlockIndexTableMapper ¶
func NewBlockIndexTableMapper(id principal.Signer, blockIndexStore BlockIndexStore, migratedShardChecker MigratedShardChecker, bucketURL string, claimExpiration time.Duration, bucketPrefixes []string) (blockIndexTableMapper, error)
NewBlockIndexTableMapper creates a new ContentToClaimsMapper that synthethizes location claims from data in the blockIndexStore - a giant index of historical data, mapping multihashes to bucket keys/URLs and their byte offsets.
The data referenced by bucket keys in the blockIndexStore has been consolidated into a single bucket. So this instance does the work of mapping old bucket keys to URLs, where the base URL is the passed bucketURL param.
Using the data in the blockIndexStore, the service will materialize content claims using the id param as the signing key. Claims will be set to expire in the amount of time given by the claimExpiration parameter.
Types ¶
type AllocationsStore ¶
type BlockIndexRecord ¶
type BlockIndexStore ¶
type BucketFallbackMapper ¶
type BucketFallbackMapper struct {
// contains filtered or unexported fields
}
func NewBucketFallbackMapper ¶
func NewBucketFallbackMapper(id principal.Signer, httpClient *http.Client, bucketURL *url.URL, allocationsStore AllocationsStore, getOpts func() []delegation.Option) BucketFallbackMapper
type Config ¶
type Config struct {
construct.ServiceConfig
aws.Config
LegacyConfig
SupportLegacyServices bool
ProvidersCacheExpirationSeconds int64
NoProvidersCacheExpirationSeconds int64
ClaimsCacheExpirationSeconds int64
IndexesCacheExpirationSeconds int64
SQSCachingQueueID string
CachingBucket string
SQSPublishingQueueID string
PublishingBucket string
SQSAdvertisementPublishingQueueID string
ChunkLinksTableName string
MetadataTableName string
IPNIStoreBucket string
IPNIStorePrefix string
IPNIAnnounceURLs []url.URL
NotifierHeadBucket string
NotifierTopicArn string
ClaimStoreBucket string
ClaimStorePrefix string
BaseTraceSampleRatio float64
SentryDSN string
SentryEnvironment string
TelemetryEnabled bool
PrincipalMapping map[string]string
IPNIFormatPeerID string
IPNIFormatEndpoint string
principal.Signer
}
Config describes all the values required to setup AWS from the environment
type DynamoAllocationsTable ¶
type DynamoAllocationsTable struct {
// contains filtered or unexported fields
}
func NewDynamoAllocationsTable ¶
func NewDynamoAllocationsTable(client dynamodb.QueryAPIClient, tableName string) *DynamoAllocationsTable
type DynamoContentToClaimsMapper ¶
type DynamoContentToClaimsMapper struct {
// contains filtered or unexported fields
}
DynamoContentToClaimsMapper uses a DynamoDB table to map content hashes to the corresponding claims
func NewDynamoContentToClaimsMapper ¶
func NewDynamoContentToClaimsMapper(queryClient dynamodb.QueryAPIClient, tableName string) DynamoContentToClaimsMapper
type DynamoMigratedShardChecker ¶
type DynamoMigratedShardChecker struct {
// contains filtered or unexported fields
}
func NewDynamoMigratedShardChecker ¶
func NewDynamoMigratedShardChecker(storeTableName string, storeTableClient dynamodb.QueryAPIClient, blobRegistryTableName string, blobRegistryTableClient dynamodb.QueryAPIClient, allocationsStore AllocationsStore) *DynamoMigratedShardChecker
func (*DynamoMigratedShardChecker) ShardMigrated ¶
type DynamoProviderBlockIndexTable ¶
type DynamoProviderBlockIndexTable struct {
// contains filtered or unexported fields
}
func NewDynamoProviderBlockIndexTable ¶
func NewDynamoProviderBlockIndexTable(client dynamodb.QueryAPIClient, tableName string) *DynamoProviderBlockIndexTable
func (*DynamoProviderBlockIndexTable) Query ¶
func (d *DynamoProviderBlockIndexTable) Query(ctx context.Context, digest multihash.Multihash) ([]BlockIndexRecord, error)
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) *DynamoProviderContextTable
NewDynamoProviderContextTable returns a ProviderContextTable connected to a AWS DynamoDB table
type IAMAuthTokenRequest ¶
type IAMAuthTokenRequest struct {
// contains filtered or unexported fields
}
type LegacyConfig ¶ added in v1.12.1
type LegacyConfig struct {
LegacyClaimsTableName string
LegacyClaimsTableRegion string
LegacyClaimsBucket string
LegacyBlockIndexTableName string
LegacyBlockIndexTableRegion string
LegacyStoreTableName string
LegacyStoreTableRegion string
LegacyBlobRegistryTableName string
LegacyBlobRegistryTableRegion string
LegacyAllocationsTableName string
LegacyAllocationsTableRegion string
LegacyDotStorageBucketPrefixes []string // legacy .storage buckets
LegacyDataBucketURL string
}
type MigratedShardChecker ¶
type S3Store ¶
type S3Store struct {
// contains filtered or unexported fields
}
S3Store implements the store.Store interface on S3
func NewS3StoreWithClient ¶
type SNSRemoteSyncMessage ¶
type SNSRemoteSyncNotifier ¶
type SNSRemoteSyncNotifier struct {
// contains filtered or unexported fields
}
func NewSNSRemoteSyncNotifier ¶
func NewSNSRemoteSyncNotifier(config aws.Config, topicArn string) *SNSRemoteSyncNotifier
func (*SNSRemoteSyncNotifier) NotifyRemoteSync ¶
func (s *SNSRemoteSyncNotifier) NotifyRemoteSync(ctx context.Context, head, prev ipld.Link)
type SQSCachingDecoder ¶
type SQSCachingDecoder struct {
// contains filtered or unexported fields
}
SQSCachingDecoder provides interfaces for working with caching jobs received over SQS
func NewSQSCachingDecoder ¶
func NewSQSCachingDecoder(cfg aws.Config, bucket string) *SQSCachingDecoder
NewSQSCachingDecoder returns a new decoder for the given AWS config
func (*SQSCachingDecoder) DecodeMessage ¶
func (s *SQSCachingDecoder) DecodeMessage(ctx context.Context, receiptHandle string, messageBody string) (queuepoller.WithID[providercacher.ProviderCachingJob], error)
DecodeMessage decodes a provider caching job from the SQS message body, reading the stored index from S3
type SQSCachingQueue ¶
type SQSCachingQueue struct {
// contains filtered or unexported fields
}
SQSCachingQueue implements the providercacher.CachingQueue interface using SQS
func NewSQSCachingQueue ¶
func NewSQSCachingQueue(cfg aws.Config, queueID string, bucket string) *SQSCachingQueue
NewSQSCachingQueue returns a new SQSCachingQueue for the given aws config
func (*SQSCachingQueue) Delete ¶
func (s *SQSCachingQueue) Delete(ctx context.Context, jobID string) error
Delete deletes a job message from the SQS queue.
func (*SQSCachingQueue) Queue ¶
func (s *SQSCachingQueue) Queue(ctx context.Context, job providercacher.ProviderCachingJob) error
Queue implements blobindexlookup.CachingQueue.
func (*SQSCachingQueue) Read ¶
func (s *SQSCachingQueue) Read(ctx context.Context, maxJobs int) ([]queuepoller.WithID[providercacher.ProviderCachingJob], error)
Read reads a batch of jobs from the SQS queue. Returns an empty slice if no jobs are available. The caller must process jobs and delete them from the queue when done.