document

package
v0.1535.0-MLPAB2651per... Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2024 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Document

type Document struct {
	PK            dynamo.LpaKeyType
	SK            dynamo.DocumentKeyType
	Filename      string
	VirusDetected bool
	Scanned       bool
	Key           string
	Uploaded      time.Time
	Sent          time.Time
}

type Documents

type Documents []Document

func (*Documents) Delete

func (ds *Documents) Delete(documentKey string) bool

func (*Documents) Filenames

func (ds *Documents) Filenames() []string

func (*Documents) Get

func (ds *Documents) Get(documentKey string) Document

func (*Documents) InfectedFilenames

func (ds *Documents) InfectedFilenames() []string

func (*Documents) Keys

func (ds *Documents) Keys() []string

func (*Documents) NotScanned

func (ds *Documents) NotScanned() Documents

func (*Documents) Put

func (ds *Documents) Put(scannedDocument Document)

func (*Documents) Scanned

func (ds *Documents) Scanned() Documents

func (*Documents) ScannedNotSent

func (ds *Documents) ScannedNotSent() Documents

func (*Documents) Sent

func (ds *Documents) Sent() Documents

type DynamoClient

type DynamoClient interface {
	One(ctx context.Context, pk dynamo.PK, sk dynamo.SK, v interface{}) error
	OneByPK(ctx context.Context, pk dynamo.PK, v interface{}) error
	OneByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v interface{}) error
	AllByPartialSK(ctx context.Context, pk dynamo.PK, partialSK dynamo.SK, v interface{}) error
	LatestForActor(ctx context.Context, sk dynamo.SK, v interface{}) error
	AllBySK(ctx context.Context, sk dynamo.SK, v interface{}) error
	AllByKeys(ctx context.Context, keys []dynamo.Keys) ([]map[string]dynamodbtypes.AttributeValue, error)
	AllKeysByPK(ctx context.Context, pk dynamo.PK) ([]dynamo.Keys, error)
	Put(ctx context.Context, v interface{}) error
	Create(ctx context.Context, v interface{}) error
	DeleteKeys(ctx context.Context, keys []dynamo.Keys) error
	DeleteOne(ctx context.Context, pk dynamo.PK, sk dynamo.SK) error
	Update(ctx context.Context, pk dynamo.PK, sk dynamo.SK, values map[string]dynamodbtypes.AttributeValue, expression string) error
	BatchPut(ctx context.Context, items []interface{}) error
	OneBySK(ctx context.Context, sk dynamo.SK, v interface{}) error
	OneByUID(ctx context.Context, uid string, v interface{}) error
	WriteTransaction(ctx context.Context, transaction *dynamo.Transaction) error
}

type EventClient

type EventClient interface {
	SendUidRequested(context.Context, event.UidRequested) error
	SendApplicationUpdated(context.Context, event.ApplicationUpdated) error
	SendReducedFeeRequested(context.Context, event.ReducedFeeRequested) error
}

type S3Client

type S3Client interface {
	PutObject(context.Context, string, []byte) error
	DeleteObject(context.Context, string) error
	DeleteObjects(ctx context.Context, keys []string) error
	PutObjectTagging(context.Context, string, map[string]string) error
}

type Store

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

func NewStore

func NewStore(dynamoClient DynamoClient, s3Client S3Client, eventClient EventClient) *Store

func (*Store) Create

func (s *Store) Create(ctx context.Context, donor *donordata.Provided, filename string, data []byte) (Document, error)

func (*Store) Delete

func (s *Store) Delete(ctx context.Context, document Document) error

func (*Store) DeleteInfectedDocuments

func (s *Store) DeleteInfectedDocuments(ctx context.Context, documents Documents) error

func (*Store) GetAll

func (s *Store) GetAll(ctx context.Context) (Documents, error)

func (*Store) Put

func (s *Store) Put(ctx context.Context, document Document) error

func (*Store) Submit

func (s *Store) Submit(ctx context.Context, donor *donordata.Provided, documents Documents) error

func (*Store) UpdateScanResults

func (s *Store) UpdateScanResults(ctx context.Context, lpaID, s3ObjectKey string, virusDetected bool) error

Jump to

Keyboard shortcuts

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