metadata

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Metadata

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

Metadata is responsible for creating document metadata.

func New

func New(opts ...Option) *Metadata

New creates a new metadata transformer.

func (*Metadata) CreateDocumentMetadata

func (t *Metadata) CreateDocumentMetadata(rm *protocol.ResolutionModel, info protocol.TransformationInfo) (document.Metadata, error)

CreateDocumentMetadata will create document metadata.

type Option

type Option func(opts *Metadata)

Option is a metadata instance option.

func WithIncludePublishedOperations

func WithIncludePublishedOperations(enabled bool) Option

WithIncludePublishedOperations sets optional include published operations flag.

func WithIncludeUnpublishedOperations

func WithIncludeUnpublishedOperations(enabled bool) Option

WithIncludeUnpublishedOperations sets optional include unpublished operations flag.

type PublishedOperation

type PublishedOperation struct {

	// Type defines operation type.
	Type operation.Type `json:"type"`

	// OperationRequest is the original operation request.
	OperationRequest []byte `json:"operation"`

	// TransactionTime is the logical anchoring time.
	TransactionTime uint64 `json:"transactionTime"`

	// TransactionNumber is the transaction number of the transaction this operation was batched within.
	TransactionNumber uint64 `json:"transactionNumber"`

	// ProtocolVersion is the genesis time of the protocol that was used for this operation.
	ProtocolVersion uint64 `json:"protocolVersion"`

	// CanonicalReference contains canonical reference that applies to this operation.
	CanonicalReference string `json:"canonicalReference,omitempty"`

	// EquivalenceReferences contains equivalence reference that applies to this operation.
	EquivalentReferences []string `json:"equivalentReferences,omitempty"`

	// AnchorOrigin is anchor origin
	AnchorOrigin interface{} `json:"anchorOrigin,omitempty"`
}

PublishedOperation defines an published operation for metadata. It is a subset of anchored operation.

type UnpublishedOperation

type UnpublishedOperation struct {

	// Type defines operation type.
	Type operation.Type `json:"type"`

	// OperationRequest is the original operation request.
	OperationRequest []byte `json:"operation"`

	// TransactionTime is the logical anchoring time.
	TransactionTime uint64 `json:"transactionTime"`

	// ProtocolVersion is the genesis time of the protocol that was used for this operation.
	ProtocolVersion uint64 `json:"protocolVersion"`

	// AnchorOrigin is anchor origin.
	AnchorOrigin interface{} `json:"anchorOrigin,omitempty"`
}

UnpublishedOperation defines an un-published operation for metadata. It is a subset of anchored operation.

Jump to

Keyboard shortcuts

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