cloud

package
v1.4.8 Latest Latest
Warning

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

Go to latest
Published: Oct 28, 2021 License: Apache-2.0 Imports: 11 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DefaultConfig = Config{
	BufferSize:    32,
	CatchupBlocks: []flow.Identifier{},
}

DefaultConfig is the default configuration for the Google Cloud Streamer.

Functions

This section is empty.

Types

type Config added in v1.3.1

type Config struct {
	BufferSize    uint
	CatchupBlocks []flow.Identifier
}

Config is the configuration for a Google Cloud Streamer.

type GCPStreamer

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

GCPStreamer is a component that downloads block data from a Google Cloud bucket. It exposes a callback to be used by the consensus follower to notify the Streamer when a new block has been finalized. The streamer will then add that block to the queue, which is consumed by downloading the block data for the identifiers it contains.

func NewGCPStreamer

func NewGCPStreamer(log zerolog.Logger, bucket *storage.BucketHandle, options ...Option) *GCPStreamer

NewGCPStreamer returns a new GCP Streamer using the given bucket and options.

func (*GCPStreamer) Next

func (g *GCPStreamer) Next() (*uploader.BlockData, error)

Next returns the next available block data. It returns an ErrUnavailable if no block data is available at the moment.

func (*GCPStreamer) OnBlockFinalized

func (g *GCPStreamer) OnBlockFinalized(blockID flow.Identifier)

OnBlockFinalized is a callback for the Flow consensus follower. It is called each time a block is finalized by the Flow consensus algorithm.

type Option added in v1.3.1

type Option func(*Config)

Option is a function that can be applied to a Config.

func WithBufferSize added in v1.3.1

func WithBufferSize(size uint) Option

WithBufferSize can be used to specify the buffer size for a Google Cloud Streamer to use.

func WithCatchupBlocks added in v1.4.0

func WithCatchupBlocks(blockIDs []flow.Identifier) Option

WithCatchupBlocks injects a number of block IDs that are already finalized, but for which we still need to download the execution data records.

Jump to

Keyboard shortcuts

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