txnprovider

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: Mar 3, 2021 License: Apache-2.0 Imports: 15 Imported by: 13

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type AnchorData

type AnchorData struct {
	NumberOfOperations int
	CoreIndexFileURI   string
}

AnchorData holds anchored data.

func ParseAnchorData

func ParseAnchorData(data string) (*AnchorData, error)

ParseAnchorData will parse anchor string into anchor data model.

func (*AnchorData) GetAnchorString

func (ad *AnchorData) GetAnchorString() string

GetAnchorString will create anchor string from anchor data.

type DCAS

type DCAS interface {
	Read(key string) ([]byte, error)
}

DCAS interface to access content addressable storage.

type OperationHandler

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

OperationHandler creates batch files(chunk, map, anchor) from batch operations.

func NewOperationHandler

func NewOperationHandler(p protocol.Protocol, cas cas.Client, cp compressionProvider, parser OperationParser) *OperationHandler

NewOperationHandler returns new operations handler.

func (*OperationHandler) PrepareTxnFiles

func (h *OperationHandler) PrepareTxnFiles(ops []*operation.QueuedOperation) (string, []*operation.Reference, error)

PrepareTxnFiles will create batch files(chunk, map, anchor) from batch operations, store those files in CAS and return anchor string.

type OperationParser

type OperationParser interface {
	ParseOperation(namespace string, operationBuffer []byte, batch bool) (*model.Operation, error)
	ValidateSuffixData(suffixData *model.SuffixDataModel) error
	ValidateDelta(delta *model.DeltaModel) error
	ParseSignedDataForUpdate(compactJWS string) (*model.UpdateSignedDataModel, error)
	ParseSignedDataForDeactivate(compactJWS string) (*model.DeactivateSignedDataModel, error)
	ParseSignedDataForRecover(compactJWS string) (*model.RecoverSignedDataModel, error)
}

OperationParser defines the functions for parsing operations.

type OperationProvider

type OperationProvider struct {
	protocol.Protocol
	// contains filtered or unexported fields
}

OperationProvider is an operation provider.

func NewOperationProvider

func NewOperationProvider(p protocol.Protocol, parser OperationParser, cas DCAS, dp decompressionProvider) *OperationProvider

NewOperationProvider returns a new operation provider.

func (*OperationProvider) GetTxnOperations

func (h *OperationProvider) GetTxnOperations(txn *txn.SidetreeTxn) ([]*operation.AnchoredOperation, error)

GetTxnOperations will read batch files(core/provisional index, proof files and chunk file) and assemble batch operations from those files.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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