bufferedbatch

package
v0.4.7 Latest Latest
Warning

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

Go to latest
Published: Jun 30, 2020 License: Apache-2.0 Imports: 9 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Batch

type Batch struct {
	Links []*chainscript.Link
	// contains filtered or unexported fields
}

Batch can be used as a base class for types that want to implement github.com/stratumn/go-core/store.Batch. All operations are stored in arrays and can be replayed. Only the Write method must be implemented.

func NewBatch

func NewBatch(ctx context.Context, a store.Adapter) *Batch

NewBatch creates a new Batch.

func (b *Batch) CreateLink(ctx context.Context, link *chainscript.Link) (_ chainscript.LinkHash, err error)

CreateLink implements github.com/stratumn/go-core/store.LinkWriter.CreateLink.

func (*Batch) FindSegments

func (b *Batch) FindSegments(ctx context.Context, filter *store.SegmentFilter) (_ *types.PaginatedSegments, err error)

FindSegments returns the union of segments in the store and not committed yet.

func (*Batch) GetMapIDs

func (b *Batch) GetMapIDs(ctx context.Context, filter *store.MapFilter) (_ []string, err error)

GetMapIDs returns the union of mapIds in the store and not committed yet.

func (*Batch) GetSegment

func (b *Batch) GetSegment(ctx context.Context, linkHash chainscript.LinkHash) (segment *chainscript.Segment, err error)

GetSegment returns a segment from the cache or delegates the call to the store.

func (*Batch) Write

func (b *Batch) Write(ctx context.Context) (err error)

Write implements github.com/stratumn/go-core/store.Batch.Write.

Jump to

Keyboard shortcuts

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