generator

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 9, 2025 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type GeneratorAggregator

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

GeneratorAggregator aggregates snapshot generators

func NewAggregator

func NewAggregator(generators []SnapshotGenerator) *GeneratorAggregator

NewAggregator will aggregate the generators on input.

func (*GeneratorAggregator) Close

func (a *GeneratorAggregator) Close() error

Close will aggregate the errors of the generator close calls.

func (*GeneratorAggregator) CreateSnapshot

func (a *GeneratorAggregator) CreateSnapshot(ctx context.Context, ss *snapshot.Snapshot) error

CreateSnapshot will call the CreateSnapshot method for each of the aggregated snapshot generators sequentially, in the order in which they were provided. If one of them fails, an error will be returned without continuing with the rest of generator calls.

type SnapshotGenerator

type SnapshotGenerator interface {
	CreateSnapshot(ctx context.Context, snapshot *snapshot.Snapshot) error
	Close() error
}

type SnapshotRecorder

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

SnapshotRecorder is a decorator around a snapshot generator that will record the snapshot request status.

func NewSnapshotRecorder

func NewSnapshotRecorder(store snapshotstore.Store, generator SnapshotGenerator) *SnapshotRecorder

NewSnapshotRecorder will return the generator on input wrapped with an activity recorder that will keep track of the status of the snapshot requests.

func (*SnapshotRecorder) Close

func (s *SnapshotRecorder) Close() error

func (*SnapshotRecorder) CreateSnapshot

func (s *SnapshotRecorder) CreateSnapshot(ctx context.Context, ss *snapshot.Snapshot) error

Directories

Path Synopsis
data

Jump to

Keyboard shortcuts

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