processor

package
v1.2.5 Latest Latest
Warning

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

Go to latest
Published: Apr 6, 2023 License: Apache-2.0 Imports: 21 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Arguments

type Arguments struct {
	Request   interface{}
	Principal *model.Principal
}

Arguments for a Processor

type BigQueryJobCreator

type BigQueryJobCreator struct {
	BackupRepository            repository.BackupRepository
	JobRepository               repository.JobRepository
	SourceMetadataRepository    repository.SourceMetadataRepository
	SourceMetadataJobRepository repository.SourceMetadataJobRepository
	BigQuery                    bigquery.Client
}

BigQueryJobCreator prepares jobs for BigQuery

func NewBigQueryJobCreator

func NewBigQueryJobCreator(ctxIn context.Context, backupRepository repository.BackupRepository, jobRepository repository.JobRepository, bigQueryClient bigquery.Client,
	sourceMetadataRepository repository.SourceMetadataRepository, sourceMetadataJobRepository repository.SourceMetadataJobRepository) *BigQueryJobCreator

NewBigQueryJobCreator return instance of BigQueryJobCreator

func (*BigQueryJobCreator) PrepareJobs

func (b *BigQueryJobCreator) PrepareJobs(ctxIn context.Context, backup *repository.Backup) error

PrepareJobs new BigQuery extract job

type BucketListingProcessorFactory

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

BucketListingProcessorFactory create Process for BucketListing

func (*BucketListingProcessorFactory) CreateProcessor

func (c *BucketListingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for BucketListing

func (*BucketListingProcessorFactory) DoMatchRequestType

func (c *BucketListingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match BucketListing

type CalculatingProcessorFactory

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

CalculatingProcessorFactory create Process for Calculating

func (CalculatingProcessorFactory) CreateProcessor

func (c CalculatingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for Calculating

func (CalculatingProcessorFactory) DoMatchRequestType

func (c CalculatingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Calculating

type CloudStorageJobCreator

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

CloudStorageJobCreator will create Transfer Jobs in GCP to backup GCS

func NewCloudStorageJobCreator

func NewCloudStorageJobCreator(ctxIn context.Context, backupRepository repository.BackupRepository, jobRepository repository.JobRepository) *CloudStorageJobCreator

NewCloudStorageJobCreator return instance of CloudStorageJobCreator

func (*CloudStorageJobCreator) PrepareJobs

func (b *CloudStorageJobCreator) PrepareJobs(ctxIn context.Context, backup *repository.Backup) error

PrepareJobs for GCS backup

type CreatingProcessorFactory

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

CreatingProcessorFactory create Process for Creating

func NewCreatingProcessorFactory

func NewCreatingProcessorFactory(backupProvider provider.SinkGCPProjectProvider, tokenSourceProvider impersonate.TargetPrincipalForProjectProvider, credentialsProvider secret.SecretProvider) *CreatingProcessorFactory

func (*CreatingProcessorFactory) CreateProcessor

func (c *CreatingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for Creating

func (*CreatingProcessorFactory) DoMatchRequestType

func (c *CreatingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Creating

type DatasetListingProcessorFactory

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

DatasetListingProcessorFactory create Process for DatasetListing

func (*DatasetListingProcessorFactory) CreateProcessor

func (c *DatasetListingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for DatasetListing

func (*DatasetListingProcessorFactory) DoMatchRequestType

func (c *DatasetListingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Listing

type GettingProcessorFactory

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

GettingProcessorFactory create Process for Getting

func NewGettingProcessorFactory

func NewGettingProcessorFactory(tokenSourceProvider impersonate.TargetPrincipalForProjectProvider, credentialProvider secret.SecretProvider) *GettingProcessorFactory

func (GettingProcessorFactory) CreateProcessor

func (c GettingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for Getting

func (GettingProcessorFactory) DoMatchRequestType

func (c GettingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Getting

type ListingProcessorFactory

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

ListingProcessorFactory create Process for Listing

func NewListingProcessorFactory

func NewListingProcessorFactory(tokenSourceProvider impersonate.TargetPrincipalForProjectProvider, credentialsProvider secret.SecretProvider) *ListingProcessorFactory

func (ListingProcessorFactory) CreateProcessor

func (c ListingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return instance of Operations for Listing

func (ListingProcessorFactory) DoMatchRequestType

func (c ListingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Listing

type Operations

type Operations interface {
	Process(context.Context, *Arguments) (*Result, error)
}

Operations define operations for processors

type Processor

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

Processor handle request

func (*Processor) Process

func (p *Processor) Process(ctxIn context.Context, processorArgs *Arguments) (*Result, error)

Process triggers request processing

type RestoringProcessorFactory

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

RestoringProcessorFactory create Operations for Restoring

func NewRestoringProcessorFactory

func NewRestoringProcessorFactory(tokenSourceProvider impersonate.TargetPrincipalForProjectProvider, credentialsProvider secret.SecretProvider) *RestoringProcessorFactory

func (RestoringProcessorFactory) CreateProcessor

func (c RestoringProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor return Operations for Restoring

func (RestoringProcessorFactory) DoMatchRequestType

func (c RestoringProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType does request type match Restoring

type Result

type Result struct {
	JobsTotal           uint64
	BucketListResponse  *requestobjects.BucketListResponse
	CalculateResponse   *requestobjects.CalculatedResponse
	DatasetListResponse *requestobjects.DatasetListResponse
	// contains filtered or unexported fields
}

Result for a request

func (Result) GetBackup

func (pr Result) GetBackup() *repository.Backup

GetBackup returns backup

func (Result) GetBackups

func (pr Result) GetBackups() []*repository.Backup

GetBackups returns backups

func (Result) GetJobs

func (pr Result) GetJobs() []*repository.Job

GetJobs returns backup jobs

type ScheduleProcessor

type ScheduleProcessor interface {
	CreateBigQueryJobCreator(ctxIn context.Context, client bigquery.Client) *BigQueryJobCreator
	CreateCloudStorageJobCreator(ctxIn context.Context) *CloudStorageJobCreator
	GetNextBackupJobs(context.Context, repository.BackupType) ([]*repository.Job, error)
	GetScheduledBackupJobs(context.Context, repository.BackupType) ([]*repository.Job, error)
	GetExpired(context.Context, repository.BackupType) ([]*repository.Backup, error)
	GetExpiredBigQueryMirrorRevisions(ctxIn context.Context, maxRevisionLifetimeInWeeks int) ([]*repository.MirrorRevision, error)
	GetScheduledBackups(context.Context, repository.BackupType) ([]*repository.Backup, error)
	GetByStatusAndAfter(context.Context, []repository.JobStatus, int) ([]*repository.Job, error)
	GetJobsForBackupID(ctxIn context.Context, backupID string, jobPage repository.JobPage) ([]*repository.Job, error)
	UpdateJob(ctxIn context.Context, backupType repository.BackupType, jobID string, status repository.JobStatus, externalID string) error
	UpdateBackupStatus(ctxIn context.Context, id string, status repository.BackupStatus) error
	UpdateLastCleanupTime(ctxIn context.Context, backupID string, lastCleanupTime time.Time) error
	MarkBackupDeleted(ctxIn context.Context, id string) error
	MarkSourceMetadataDeleted(ctxIn context.Context, id int) error
	MarkJobDeleted(ctxIn context.Context, id string) error
	GetBackupForID(ctxIn context.Context, id string) (*repository.Backup, error)
	AddTrashcanEntry(ctxIn context.Context, backupID string, source string, timestamp time.Time) error
	DeleteTrashcanEntry(ctxIn context.Context, backupID string, source string) error
	FilterExistingTrashcanEntries(context.Context, []TrashcanEntry) ([]TrashcanEntry, error)
	GetEntriesInTrashcanBefore(ctxIn context.Context, deltaWeeks int) ([]*repository.SourceTrashcan, error)
}

ScheduleProcessor defines operation for scheduling

func NewScheduleProcessor

func NewScheduleProcessor(ctxIn context.Context, credentialsProvider secret.SecretProvider) (ScheduleProcessor, error)

NewScheduleProcessor create new instance of ScheduleProcessor

type TrashcanEntry

type TrashcanEntry struct {
	BackupID string
	Source   string
}

TrashcanEntry moved objects into trashcan

type UpdatingProcessorFactory

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

UpdatingProcessorFactory factory for operation Updating

func NewUpdatingProcessorFactory

func NewUpdatingProcessorFactory(tokenSourceProvider impersonate.TargetPrincipalForProjectProvider, credentialsProvider secret.SecretProvider) *UpdatingProcessorFactory

func (UpdatingProcessorFactory) CreateProcessor

func (c UpdatingProcessorFactory) CreateProcessor(ctxIn context.Context) (Operations, error)

CreateProcessor create instance of Operations

func (UpdatingProcessorFactory) DoMatchRequestType

func (c UpdatingProcessorFactory) DoMatchRequestType(requestType requestobjects.RequestType) bool

DoMatchRequestType compare request string type to Updating

Jump to

Keyboard shortcuts

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