txnprovider

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: Apache-2.0 Imports: 16 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,
	metrics metricsProvider) *OperationHandler

NewOperationHandler returns new operations handler.

func (*OperationHandler) PrepareTxnFiles

func (h *OperationHandler) PrepareTxnFiles(ops []*operation.QueuedOperation) (*protocol.AnchoringInfo, error)

PrepareTxnFiles will create batch files(core index, core proof, provisional index, provisional proof and chunk) from batch operation and return anchor string, batch files information and operations.

type OperationParser

type OperationParser interface {
	ParseOperation(namespace string, operationRequest []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, opts ...Opt) *OperationProvider

NewOperationProvider returns a new operation provider.

func (*OperationProvider) GetTxnOperations

func (h *OperationProvider) GetTxnOperations(t *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.

type Opt added in v1.0.0

type Opt func(ops *options)

Opt is an OperationProvider option.

func WithSourceCASURIFormatter added in v1.0.0

func WithSourceCASURIFormatter(formatter sourceURIFormatter) Opt

WithSourceCASURIFormatter sets the formatter to use when converting an alternate source to a CAS URI.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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