aws

package
v1.0.6 Latest Latest
Warning

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

Go to latest
Published: Dec 19, 2024 License: Apache-2.0, MIT Imports: 49 Imported by: 0

Documentation

Index

Constants

View Source
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

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 ErrNoPrivateKey = errors.New("no value for private key")

ErrNoPrivateKey means that the value returned from Secrets was empty

Functions

func Construct

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

Construct constructs types.Service from AWS deps for Lamda functions

Types

type CachingQueueMessage

type CachingQueueMessage struct {
	JobID    uuid.UUID            `json:"JobID,omitempty"`
	Provider model.ProviderResult `json:"Provider,omitempty"`
}

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

type Config

type Config struct {
	construct.ServiceConfig
	aws.Config
	SQSCachingQueueURL        string
	CachingBucket             string
	ChunkLinksTableName       string
	MetadataTableName         string
	IPNIStoreBucket           string
	IPNIStorePrefix           string
	NotifierHeadBucket        string
	NotifierTopicArn          string
	ClaimStoreBucket          string
	ClaimStorePrefix          string
	LegacyClaimsTableName     string
	LegacyClaimsBucket        string
	LegacyBlockIndexTableName string
	LegacyDataBucketURL       string
	principal.Signer
}

Config describes all the values required to setup AWS from the environment

func FromEnv

func FromEnv(ctx context.Context) Config

FromEnv constructs the AWS Configuration from the environment

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

func (DynamoContentToClaimsMapper) GetClaims

func (dm DynamoContentToClaimsMapper) GetClaims(ctx context.Context, contentHash multihash.Multihash) ([]cid.Cid, error)

GetClaim returns claim CIDs for a given content hash. Implements ContentToClaimMapper

type DynamoProviderBlockIndexTable

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

func NewDynamoProviderBlockIndexTable

func NewDynamoProviderBlockIndexTable(client dynamodb.QueryAPIClient, tableName string) *DynamoProviderBlockIndexTable

func (*DynamoProviderBlockIndexTable) Query

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

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 IAMAuthTokenRequest

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

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) *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, len uint64, data io.Reader) error

Put implements store.Store.

type SNSRemoteSyncMessage

type SNSRemoteSyncMessage struct {
	Head string `json:"Head,omitempty"`
	Prev string `json:"Prev,omitempty"`
}

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

func (s *SQSCachingDecoder) CleanupMessage(ctx context.Context, messageBody string) error

CleanupMessage removes stored information in the s3 bucket

func (*SQSCachingDecoder) DecodeMessage

func (s *SQSCachingDecoder) DecodeMessage(ctx context.Context, messageBody string) (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, queurURL string, bucket string) *SQSCachingQueue

NewSQSCachingQueue returns a new SQSCachingQueue for the given aws config

func (*SQSCachingQueue) Queue

Queue implements blobindexlookup.CachingQueue.

Jump to

Keyboard shortcuts

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