fftypes

package
v1.0.5 Latest Latest
Warning

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

Go to latest
Published: Sep 26, 2022 License: Apache-2.0 Imports: 23 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ManifestVersionUnset uint = 0
	ManifestVersion1     uint = 1
)
View Source
const (
	// ChartHistogramMaxBuckets max buckets that can be requested
	ChartHistogramMaxBuckets = 100
	// ChartHistogramMinBuckets min buckets that can be requested
	ChartHistogramMinBuckets = 1
)
View Source
const (
	// SystemTopicDefinitions is the FireFly event topic for events that are confirmations of definition of pre-defined datatypes
	SystemTopicDefinitions = "ff_definition"
	// SystemBatchPinTopic is the FireFly event topic for events from the FireFly batch pin listener
	SystemBatchPinTopic = "ff_batch_pin"
)
View Source
const (

	// SystemTagDefineDatatype is the tag for messages that broadcast data definitions
	SystemTagDefineDatatype = "ff_define_datatype"

	// SystemTagDefineNamespace is the tag for messages that broadcast namespace definitions
	SystemTagDefineNamespace = "ff_define_namespace"

	// DeprecatedSystemTagDefineOrganization is the tag for messages that broadcast organization definitions
	DeprecatedSystemTagDefineOrganization = "ff_define_organization"

	// DeprecatedSystemTagDefineNode is the tag for messages that broadcast node definitions
	DeprecatedSystemTagDefineNode = "ff_define_node"

	// SystemTagDefineGroup is the tag for messages that send the definition of a group, to all parties in that group
	SystemTagDefineGroup = "ff_define_group"

	// SystemTagDefinePool is the tag for messages that broadcast data definitions
	SystemTagDefinePool = "ff_define_pool"

	// SystemTagDefineFFI is the tag for messages that broadcast contract FFIs
	SystemTagDefineFFI = "ff_define_ffi"

	// SystemTagDefineContractAPI is the tag for messages that broadcast contract APIs
	SystemTagDefineContractAPI = "ff_define_contract_api"

	// SystemTagIdentityClaim is the tag for messages that broadcast an identity claim
	SystemTagIdentityClaim = "ff_identity_claim"

	// SystemTagIdentityVerification is the tag for messages that broadcast an identity verification
	SystemTagIdentityVerification = "ff_identity_verification"

	// SystemTagIdentityUpdate is the tag for messages that broadcast an identity update
	SystemTagIdentityUpdate = "ff_identity_update"
)
View Source
const (
	HTTPHeadersBlobHashSHA256 = "x-ff-blob-hash-sha256"
	HTTPHeadersBlobSize       = "x-ff-blob-size"
)
View Source
const (
	DIDPrefix              = "did:"
	FireFlyDIDPrefix       = "did:firefly:"
	FireFlyOrgDIDPrefix    = "did:firefly:org/"
	FireFlyNodeDIDPrefix   = "did:firefly:node/"
	FireFlyCustomDIDPrefix = "did:firefly:ns/"
)
View Source
const (
	// DefaultTopic will be set as the topic of any messages set without a topic
	DefaultTopic = "default"
)
View Source
const FFStringArrayStandardMax = 1024

FFStringArrayStandardMax is the standard length we set as a VARCHAR max in tables for a string array

View Source
const FFStringNameItemsMax = 15

Because each FFName has a max length of 64, 15 names (plus comma delimeters) is a safe max to pack into a string column of length 1024

View Source
const MaxFFBigIntHexLength = 65
View Source
const (
	NullString = "null"
)
View Source
const (
	// ShortIDlphabet is designed for easy double-click select
	ShortIDlphabet = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz"
)
View Source
const (

	// SystemNamespace is the system reserved namespace name
	SystemNamespace = "ff_system"
)

Variables

View Source
var (
	// BatchTypeBroadcast is a batch that is broadcast via the shared data interface
	BatchTypeBroadcast = ffEnum("batchtype", "broadcast")
	// BatchTypePrivate is a batch that is sent privately to a group
	BatchTypePrivate = ffEnum("batchtype", "private")
)
View Source
var (
	// CallTypeInvoke is an invocation that submits a transaction for inclusion in the chain
	CallTypeInvoke = ffEnum("contractcalltype", "invoke")
	// CallTypeQuery is a query that returns data from the chain
	CallTypeQuery = ffEnum("contractcalltype", "query")
)
View Source
var (
	// ValidatorTypeJSON is the validator type for JSON Schema validation
	ValidatorTypeJSON = ffEnum("validatortype", "json")
	// ValidatorTypeNone explicitly disables validation, even when a datatype is set. Allowing categorization of datatype without validation.
	ValidatorTypeNone = ffEnum("validatortype", "none")
	// ValidatorTypeSystemDefinition is the validator type for system definitions
	ValidatorTypeSystemDefinition = ffEnum("validatortype", "definition")
)
View Source
var (
	// EventTypeTransactionSubmitted occurs only on the node that initiates a tranaction, when the transaction is submitted
	EventTypeTransactionSubmitted = ffEnum("eventtype", "transaction_submitted")
	// EventTypeMessageConfirmed is the most important event type in the system. This means a message and all of its data
	// is available for processing by an application. Most applications only need to listen to this event type
	EventTypeMessageConfirmed = ffEnum("eventtype", "message_confirmed")
	// EventTypeMessageRejected occurs if a message is received and confirmed from a sequencing perspective, but is rejected as invalid (mismatch to schema, or duplicate system broadcast)
	EventTypeMessageRejected = ffEnum("eventtype", "message_rejected")
	// EventTypeNamespaceConfirmed occurs when a new namespace is ready for use (on the namespace itself)
	EventTypeNamespaceConfirmed = ffEnum("eventtype", "namespace_confirmed")
	// EventTypeDatatypeConfirmed occurs when a new datatype is ready for use (on the namespace of the datatype)
	EventTypeDatatypeConfirmed = ffEnum("eventtype", "datatype_confirmed")
	// EventTypeIdentityConfirmed occurs when a new identity has been confirmed, as as result of a signed claim broadcast, and any associated claim verification
	EventTypeIdentityConfirmed = ffEnum("eventtype", "identity_confirmed")
	// EventTypeIdentityUpdated occurs when an existing identity is update by the owner of that identity
	EventTypeIdentityUpdated = ffEnum("eventtype", "identity_updated")
	// EventTypePoolConfirmed occurs when a new token pool is ready for use
	EventTypePoolConfirmed = ffEnum("eventtype", "token_pool_confirmed")
	// EventTypePoolOpFailed occurs when a token pool creation initiated by this node has failed (based on feedback from connector)
	EventTypePoolOpFailed = ffEnum("eventtype", "token_pool_op_failed")
	// EventTypeTransferConfirmed occurs when a token transfer has been confirmed
	EventTypeTransferConfirmed = ffEnum("eventtype", "token_transfer_confirmed")
	// EventTypeTransferOpFailed occurs when a token transfer submitted by this node has failed (based on feedback from connector)
	EventTypeTransferOpFailed = ffEnum("eventtype", "token_transfer_op_failed")
	// EventTypeApprovalConfirmed occurs when a token approval has been confirmed
	EventTypeApprovalConfirmed = ffEnum("eventtype", "token_approval_confirmed")
	// EventTypeApprovalOpFailed occurs when a token approval submitted by this node has failed (based on feedback from connector)
	EventTypeApprovalOpFailed = ffEnum("eventtype", "token_approval_op_failed")
	// EventTypeContractInterfaceConfirmed occurs when a new contract interface has been confirmed
	EventTypeContractInterfaceConfirmed = ffEnum("eventtype", "contract_interface_confirmed")
	// EventTypeContractAPIConfirmed occurs when a new contract API has been confirmed
	EventTypeContractAPIConfirmed = ffEnum("eventtype", "contract_api_confirmed")
	// EventTypeBlockchainEventReceived occurs when a new event has been received from the blockchain
	EventTypeBlockchainEventReceived = ffEnum("eventtype", "blockchain_event_received")
	// EventTypeBlockchainInvokeOpSucceeded occurs when a blockchain "invoke" request has succeeded
	EventTypeBlockchainInvokeOpSucceeded = ffEnum("eventtype", "blockchain_invoke_op_succeeded")
	// EventTypeBlockchainInvokeOpFailed occurs when a blockchain "invoke" request has failed
	EventTypeBlockchainInvokeOpFailed = ffEnum("eventtype", "blockchain_invoke_op_failed")
)
View Source
var (
	// IdentityTypeOrg is an organization
	IdentityTypeOrg = ffEnum("identitytype", "org")
	// IdentityTypeNode is a node
	IdentityTypeNode = ffEnum("identitytype", "node")
	// IdentityTypeCustom is a user defined identity within a namespace
	IdentityTypeCustom = ffEnum("identitytype", "custom")
)
View Source
var (
	// MessageTypeDefinition is a message broadcasting a definition of a system type, pre-defined by firefly (namespaces, identities, data definitions, etc.)
	MessageTypeDefinition = ffEnum("messagetype", "definition")
	// MessageTypeBroadcast is a broadcast message, meaning it is intended to be visible by all parties in the network
	MessageTypeBroadcast = ffEnum("messagetype", "broadcast")
	// MessageTypePrivate is a private message, meaning it is only sent explicitly to individual parties in the network
	MessageTypePrivate = ffEnum("messagetype", "private")
	// MessageTypeGroupInit is a special private message that contains the definition of the group
	MessageTypeGroupInit = ffEnum("messagetype", "groupinit")
	// MessageTypeTransferBroadcast is a broadcast message to accompany/annotate a token transfer
	MessageTypeTransferBroadcast = ffEnum("messagetype", "transfer_broadcast")
	// MessageTypeTransferPrivate is a private message to accompany/annotate a token transfer
	MessageTypeTransferPrivate = ffEnum("messagetype", "transfer_private")
)
View Source
var (
	// MessageStateStaged is a message created locally which is not ready to send
	MessageStateStaged = ffEnum("messagestate", "staged")
	// MessageStateReady is a message created locally which is ready to send
	MessageStateReady = ffEnum("messagestate", "ready")
	// MessageStateSent is a message created locally which has been sent in a batch
	MessageStateSent = ffEnum("messagestate", "sent")
	// MessageStatePending is a message that has been received but is awaiting aggregation/confirmation
	MessageStatePending = ffEnum("messagestate", "pending")
	// MessageStateConfirmed is a message that has completed all required confirmations (blockchain if pinned, token transfer if transfer coupled, etc)
	MessageStateConfirmed = ffEnum("messagestate", "confirmed")
	// MessageStateRejected is a message that has completed confirmation, but has been rejected by FireFly
	MessageStateRejected = ffEnum("messagestate", "rejected")
)
View Source
var (
	// NamespaceTypeLocal is a namespace that only exists because it was defined in the local configuration of the node
	NamespaceTypeLocal = ffEnum("namespacetype", "local")
	// NamespaceTypeBroadcast is a namespace that was broadcast through the network. Broadcast namespaces can overwrite a local namespace
	NamespaceTypeBroadcast = ffEnum("namespacetype", "broadcast")
	// NamespaceTypeSystem is a reserved namespace used by FireFly itself
	NamespaceTypeSystem = ffEnum("namespacetype", "system")
)
View Source
var (
	// OffsetTypeBatch is an offset stored by the batch manager on the messages table
	OffsetTypeBatch = ffEnum("offsettype", "batch")
	// OffsetTypeAggregator is an offset stored by the aggregator on the events table
	OffsetTypeAggregator = ffEnum("offsettype", "aggregator")
	// OffsetTypeSubscription is an offeset stored by a dispatcher on the events table
	OffsetTypeSubscription = ffEnum("offsettype", "subscription")
)
View Source
var (
	// OpTypeBlockchainPinBatch is a blockchain transaction to pin a batch
	OpTypeBlockchainPinBatch = ffEnum("optype", "blockchain_pin_batch")
	// OpTypeBlockchainInvoke is a smart contract invoke
	OpTypeBlockchainInvoke = ffEnum("optype", "blockchain_invoke")
	// OpTypeSharedStorageUploadBatch is a shared storage operation to upload broadcast data
	OpTypeSharedStorageUploadBatch = ffEnum("optype", "sharedstorage_upload_batch")
	// OpTypeSharedStorageUploadBlob is a shared storage operation to upload blob data
	OpTypeSharedStorageUploadBlob = ffEnum("optype", "sharedstorage_upload_blob")
	// OpTypeSharedStorageDownloadBatch is a shared storage operation to download broadcast data
	OpTypeSharedStorageDownloadBatch = ffEnum("optype", "sharedstorage_download_batch")
	// OpTypeSharedStorageDownloadBlob is a shared storage operation to download broadcast data
	OpTypeSharedStorageDownloadBlob = ffEnum("optype", "sharedstorage_download_blob")
	// OpTypeDataExchangeSendBatch is a private send of a batch
	OpTypeDataExchangeSendBatch = ffEnum("optype", "dataexchange_send_batch")
	// OpTypeDataExchangeSendBlob is a private send of a blob
	OpTypeDataExchangeSendBlob = ffEnum("optype", "dataexchange_send_blob")
	// OpTypeTokenCreatePool is a token pool creation
	OpTypeTokenCreatePool = ffEnum("optype", "token_create_pool")
	// OpTypeTokenActivatePool is a token pool activation
	OpTypeTokenActivatePool = ffEnum("optype", "token_activate_pool")
	// OpTypeTokenTransfer is a token transfer
	OpTypeTokenTransfer = ffEnum("optype", "token_transfer")
	// OpTypeTokenApproval is a token approval
	OpTypeTokenApproval = ffEnum("optype", "token_approval")
)
View Source
var (
	TokenTypeFungible    = ffEnum("tokentype", "fungible")
	TokenTypeNonFungible = ffEnum("tokentype", "nonfungible")
)
View Source
var (
	// TokenPoolStateUnknown is a token pool that may not yet be activated
	// (should not be used in the code - only set via database migration for previously-created pools)
	TokenPoolStateUnknown = ffEnum("tokenpoolstate", "unknown")
	// TokenPoolStatePending is a token pool that has been announced but not yet confirmed
	TokenPoolStatePending = ffEnum("tokenpoolstate", "pending")
	// TokenPoolStateConfirmed is a token pool that has been confirmed on chain
	TokenPoolStateConfirmed = ffEnum("tokenpoolstate", "confirmed")
)
View Source
var (
	TokenTransferTypeMint     = ffEnum("tokentransfertype", "mint")
	TokenTransferTypeBurn     = ffEnum("tokentransfertype", "burn")
	TokenTransferTypeTransfer = ffEnum("tokentransfertype", "transfer")
)
View Source
var (
	// TransactionTypeNone deprecated - replaced by TransactionTypeUnpinned
	TransactionTypeNone = ffEnum("txtype", "none")
	// TransactionTypeUnpinned indicates the message will be sent without pinning any evidence to the blockchain. Not supported for broadcast. The FireFly transaction will be used to track the sends to all group members.
	TransactionTypeUnpinned = ffEnum("txtype", "unpinned")
	// TransactionTypeBatchPin represents a pinning transaction, that verifies the originator of the data, and sequences the event deterministically between parties
	TransactionTypeBatchPin = ffEnum("txtype", "batch_pin")
	// TransactionTypeTokenPool represents a token pool creation
	TransactionTypeTokenPool = ffEnum("txtype", "token_pool")
	// TransactionTypeTokenTransfer represents a token transfer
	TransactionTypeTokenTransfer = ffEnum("txtype", "token_transfer")
	// TransactionTypeContractInvoke is a smart contract invoke
	TransactionTypeContractInvoke = ffEnum("txtype", "contract_invoke")
	// TransactionTypeTokenTransfer represents a token approval
	TransactionTypeTokenApproval = ffEnum("txtype", "token_approval")
)
View Source
var (
	TransportPayloadTypeMessage = ffEnum("transportpayload", "message")
	TransportPayloadTypeBatch   = ffEnum("transportpayload", "batch")
)
View Source
var (
	// VerifierTypeEthAddress is an Ethereum (secp256k1) address string
	VerifierTypeEthAddress = ffEnum("verifiertype", "ethereum_address")
	// VerifierTypeMSPIdentity is the MSP id (X509 distinguished name) of an issued signing certificate / keypair
	VerifierTypeMSPIdentity = ffEnum("verifiertype", "fabric_msp_id")
	// VerifierTypeFFDXPeerID is the peer identifier that FireFly Data Exchange verifies (using plugin specific tech) when receiving data
	VerifierTypeFFDXPeerID = ffEnum("verifiertype", "dx_peer_id")
)
View Source
var (
	// WSClientActionStart is a request to the server to start delivering messages to the client
	WSClientActionStart = ffEnum("wstype", "start")
	// WSClientActionAck acknowledges an event that was delivered, allowing further messages to be sent
	WSClientActionAck = ffEnum("wstype", "ack")

	// WSProtocolErrorEventType is a special event "type" field for server to send the client, if it performs a ProtocolError
	WSProtocolErrorEventType = ffEnum("wstype", "protocol_error")
)
View Source
var (
	// WSChangeEventCommandTypeStart is the command to start listening
	WSChangeEventCommandTypeStart = ffEnum("changeevent_cmd_type", "start")
)

Functions

func CheckValidatorType

func CheckValidatorType(ctx context.Context, validator ValidatorType) error

func FFEnumValues

func FFEnumValues(t string) []interface{}

func NewFFISchemaCompiler added in v0.13.0

func NewFFISchemaCompiler() *jsonschema.Compiler

func ParseToByteSize

func ParseToByteSize(byteString string) int64

ParseToByteSize is a standard handling of a number of bytes, in config or API options

func ParseToDuration

func ParseToDuration(durationString string) time.Duration

ParseToDuration is a standard handling of any duration string, in config or API options

func SafeHashCompare

func SafeHashCompare(h1 *Bytes32, h2 *Bytes32) bool

func ShortID

func ShortID() string

func ToStringArray

func ToStringArray(unknown interface{}) ([]string, bool)

func TokenBalanceIdentifier added in v0.11.0

func TokenBalanceIdentifier(pool *UUID, tokenIndex, identity string) string

func ValidateFFNameField

func ValidateFFNameField(ctx context.Context, str string, fieldName string) error

func ValidateFFNameFieldNoUUID added in v0.11.4

func ValidateFFNameFieldNoUUID(ctx context.Context, str string, fieldName string) error

func ValidateLength

func ValidateLength(ctx context.Context, str string, fieldName string, max int) error

func ValidateSafeCharsOnly added in v0.12.0

func ValidateSafeCharsOnly(ctx context.Context, str string, fieldName string) error

Types

type BaseFFIParamValidator added in v0.13.0

type BaseFFIParamValidator struct{}

func (BaseFFIParamValidator) Compile added in v0.13.0

func (v BaseFFIParamValidator) Compile(ctx jsonschema.CompilerContext, m map[string]interface{}) (jsonschema.ExtSchema, error)

func (*BaseFFIParamValidator) GetExtensionName added in v0.13.0

func (v *BaseFFIParamValidator) GetExtensionName() string

func (*BaseFFIParamValidator) GetMetaSchema added in v0.13.0

func (v *BaseFFIParamValidator) GetMetaSchema() *jsonschema.Schema

type Batch

type Batch struct {
	BatchHeader
	Hash    *Bytes32     `ffstruct:"Batch" json:"hash"`
	Payload BatchPayload `ffstruct:"Batch" json:"payload"`
}

Batch is the full payload object used in-flight.

func (*Batch) Confirmed

func (b *Batch) Confirmed() (*BatchPersisted, *BatchManifest)

Confirmed generates a newly confirmed persisted batch, including (re-)generating the manifest

type BatchHeader added in v0.14.0

type BatchHeader struct {
	ID        *UUID     `ffstruct:"BatchHeader" json:"id"`
	Type      BatchType `ffstruct:"BatchHeader" json:"type" ffenum:"batchtype"`
	Namespace string    `ffstruct:"BatchHeader" json:"namespace"`
	Node      *UUID     `ffstruct:"BatchHeader" json:"node,omitempty"`
	Group     *Bytes32  `ffstruct:"BatchHeader" json:"group,omitempty"`
	Created   *FFTime   `ffstruct:"BatchHeader" json:"created"`
	SignerRef
}

BatchHeader is the common fields between the serialized batch, and the batch manifest

type BatchManifest added in v0.14.0

type BatchManifest struct {
	Version uint           `json:"version"`
	ID      *UUID          `json:"id"`
	TX      TransactionRef `json:"tx"`
	SignerRef
	Messages []*MessageManifestEntry `json:"messages"`
	Data     DataRefs                `json:"data"`
}

BatchManifest is all we need to persist to be able to reconstitute an identical batch, and also all of the fields that are protected by the hash of the batch. It can be generated from a received batch to confirm you have received an identical batch to that sent.

func (*BatchManifest) String added in v0.14.0

func (bm *BatchManifest) String() string

type BatchPayload

type BatchPayload struct {
	TX       TransactionRef `ffstruct:"BatchPayload" json:"tx"`
	Messages []*Message     `ffstruct:"BatchPayload" json:"messages"`
	Data     DataArray      `ffstruct:"BatchPayload" json:"data"`
}

BatchPayload contains the full JSON of the messages and data, but importantly only the immutable parts of the messages/data. In v0.13 and earlier, we used the whole of this payload object to form the hash of the in-flight batch. Subsequent to that we only calculate the hash of the manifest, as that contains the hashes of all the messages and data (thus minimizing the overhead of calculating the hash). - See Message.BatchMessage() and Data.BatchData()

func (*BatchPayload) Hash

func (ma *BatchPayload) Hash() *Bytes32

func (*BatchPayload) Manifest added in v0.14.0

func (ma *BatchPayload) Manifest(id *UUID) *BatchManifest

type BatchPersisted added in v0.14.0

type BatchPersisted struct {
	BatchHeader
	Hash       *Bytes32       `ffstruct:"BatchPersisted" json:"hash"`
	Manifest   *JSONAny       `ffstruct:"BatchPersisted" json:"manifest"`
	TX         TransactionRef `ffstruct:"BatchPersisted" json:"tx"`
	PayloadRef string         `ffstruct:"BatchPersisted" json:"payloadRef,omitempty"`
	Confirmed  *FFTime        `ffstruct:"BatchPersisted" json:"confirmed"`
}

BatchPersisted is the structure written to the database

func (*BatchPersisted) GenInflight added in v0.14.0

func (b *BatchPersisted) GenInflight(messages []*Message, data DataArray) *Batch

func (*BatchPersisted) GenManifest added in v0.14.0

func (b *BatchPersisted) GenManifest(messages []*Message, data DataArray) *BatchManifest

type BatchType added in v0.14.0

type BatchType = FFEnum

BatchType is the type of a batch

type Blob

type Blob struct {
	Hash       *Bytes32 `json:"hash"`
	Size       int64    `json:"size"`
	PayloadRef string   `json:"payloadRef,omitempty"`
	Peer       string   `json:"peer,omitempty"`
	Created    *FFTime  `json:"created,omitempty"`
	Sequence   int64    `json:"-"`
}

type BlobRef

type BlobRef struct {
	Hash   *Bytes32 `ffstruct:"BlobRef" json:"hash"`
	Size   int64    `ffstruct:"BlobRef" json:"size"`
	Name   string   `ffstruct:"BlobRef" json:"name"`
	Public string   `ffstruct:"BlobRef" json:"public,omitempty"`
}

func (*BlobRef) BatchBlobRef added in v0.14.0

func (br *BlobRef) BatchBlobRef(batchType BatchType) *BlobRef

type BlockchainEvent added in v0.12.0

type BlockchainEvent struct {
	ID         *UUID                    `ffstruct:"BlockchainEvent" json:"id,omitempty"`
	Source     string                   `ffstruct:"BlockchainEvent" json:"source,omitempty"`
	Namespace  string                   `ffstruct:"BlockchainEvent" json:"namespace,omitempty"`
	Name       string                   `ffstruct:"BlockchainEvent" json:"name,omitempty"`
	Listener   *UUID                    `ffstruct:"BlockchainEvent" json:"listener,omitempty"`
	ProtocolID string                   `ffstruct:"BlockchainEvent" json:"protocolId,omitempty"`
	Output     JSONObject               `ffstruct:"BlockchainEvent" json:"output,omitempty"`
	Info       JSONObject               `ffstruct:"BlockchainEvent" json:"info,omitempty"`
	Timestamp  *FFTime                  `ffstruct:"BlockchainEvent" json:"timestamp,omitempty"`
	TX         BlockchainTransactionRef `ffstruct:"BlockchainEvent" json:"tx"`
}

type BlockchainEventFilter added in v0.14.0

type BlockchainEventFilter struct {
	Name     string `ffstruct:"SubscriptionBlockchainEventFilter" json:"name,omitempty"`
	Listener string `ffstruct:"SubscriptionBlockchainEventFilter" json:"listener,omitempty"`
}

type BlockchainTransactionRef added in v1.0.0

type BlockchainTransactionRef struct {
	Type         TransactionType `ffstruct:"Transaction" json:"type"`
	ID           *UUID           `ffstruct:"Transaction" json:"id,omitempty"`
	BlockchainID string          `ffstruct:"Transaction" json:"blockchainId,omitempty"`
}

BlockchainTransactionRef refers to a transaction and a transaction blockchain ID, in other types

type Bytes32

type Bytes32 [32]byte

Bytes32 is a holder of a hash, that can be used to correlate onchain data with off-chain data.

func HashResult

func HashResult(hash hash.Hash) *Bytes32

func HashString added in v0.14.0

func HashString(s string) *Bytes32

func MustParseBytes32 added in v0.12.0

func MustParseBytes32(hexStr string) *Bytes32

func NewRandB32

func NewRandB32() *Bytes32

func ParseBytes32

func ParseBytes32(ctx context.Context, hexStr string) (*Bytes32, error)

func UUIDBytes

func UUIDBytes(u *UUID) *Bytes32

UUIDBytes returns the bytes of a UUID as a compressed hex string

func (*Bytes32) Equals

func (b32 *Bytes32) Equals(b2 *Bytes32) bool

func (Bytes32) MarshalText

func (b32 Bytes32) MarshalText() ([]byte, error)

func (*Bytes32) Scan

func (b32 *Bytes32) Scan(src interface{}) error

Scan implements sql.Scanner

func (*Bytes32) String

func (b32 *Bytes32) String() string

func (*Bytes32) UnmarshalText

func (b32 *Bytes32) UnmarshalText(b []byte) error

func (*Bytes32) Value

func (b32 *Bytes32) Value() (driver.Value, error)

Value implements sql.Valuer

type ChangeEvent

type ChangeEvent struct {
	// The resource collection where the changed resource exists
	Collection string `json:"collection"`
	// The type of event
	Type ChangeEventType `json:"type"`
	// Namespace is set if there is a namespace associated with the changed resource
	Namespace string `json:"namespace,omitempty"`
	// UUID is set if the resource is identified by ID
	ID *UUID `json:"id,omitempty"`
	// Hash is set if the resource is identified primarily by hash (groups is currently the only example)
	Hash *Bytes32 `json:"hash,omitempty"`
	// Sequence is set if there is a local ordered sequence associated with the changed resource
	Sequence *int64 `json:"sequence,omitempty"`
	// DroppedSince only for ChangeEventTypeDropped. When the first miss happened
	DroppedSince *FFTime `json:"droppedSince,omitempty"`
	// DroppedCount only for ChangeEventTypeDropped. How many events dropped
	DroppedCount int64 `json:"droppedCount,omitempty"`
}

ChangeEvent is a change to the local FireFly core node.

type ChangeEventFilter added in v1.0.0

type ChangeEventFilter struct {
	Types      []ChangeEventType `json:"types,omitempty"`
	Namespaces []string          `json:"namespaces,omitempty"`
}

type ChangeEventType

type ChangeEventType string

ChangeEventType

const (
	ChangeEventTypeCreated ChangeEventType = "created"
	ChangeEventTypeUpdated ChangeEventType = "updated" // note bulk updates might not results in change events.
	ChangeEventTypeDeleted ChangeEventType = "deleted"
	ChangeEventTypeDropped ChangeEventType = "dropped" // See ChangeEventDropped structure, sent to client instead of ChangeEvent when dropping notifications
)

type ChartHistogram added in v0.11.2

type ChartHistogram struct {
	Count     string                `ffstruct:"ChartHistogram" json:"count"`
	Timestamp *FFTime               `ffstruct:"ChartHistogram" json:"timestamp"`
	Types     []*ChartHistogramType `ffstruct:"ChartHistogram" json:"types"`
	IsCapped  bool                  `ffstruct:"ChartHistogram" json:"isCapped"`
}

ChartHistogram is a list of buckets with types

type ChartHistogramInterval added in v0.11.2

type ChartHistogramInterval struct {
	// StartTime start time of histogram interval
	StartTime *FFTime `json:"startTime"`
	// EndTime end time of histogram interval
	EndTime *FFTime `json:"endTime"`
}

ChartHistogramInterval specifies lower and upper timestamps for histogram bucket

type ChartHistogramType added in v0.14.0

type ChartHistogramType struct {
	Count string `ffstruct:"ChartHistogramType" json:"count"`
	Type  string `ffstruct:"ChartHistogramType" json:"type"`
}

ChartHistogramType is a type and count

type ConfigRecord

type ConfigRecord struct {
	Key   string   `json:"key,omitempty"`
	Value *JSONAny `json:"value,omitempty"`
}

type ContractAPI added in v0.12.0

type ContractAPI struct {
	ID        *UUID         `ffstruct:"ContractAPI" json:"id,omitempty" ffexcludeinput:"true"`
	Namespace string        `ffstruct:"ContractAPI" json:"namespace,omitempty" ffexcludeinput:"true"`
	Interface *FFIReference `ffstruct:"ContractAPI" json:"interface"`
	Location  *JSONAny      `ffstruct:"ContractAPI" json:"location,omitempty"`
	Name      string        `ffstruct:"ContractAPI" json:"name"`
	Message   *UUID         `ffstruct:"ContractAPI" json:"message,omitempty" ffexcludeinput:"true"`
	URLs      ContractURLs  `ffstruct:"ContractAPI" json:"urls" ffexcludeinput:"true"`
}

func (*ContractAPI) LocationAndLedgerEquals added in v0.12.0

func (c *ContractAPI) LocationAndLedgerEquals(a *ContractAPI) bool

func (*ContractAPI) SetBroadcastMessage added in v0.12.0

func (c *ContractAPI) SetBroadcastMessage(msgID *UUID)

func (*ContractAPI) Topic added in v0.12.0

func (c *ContractAPI) Topic() string

func (*ContractAPI) Validate added in v0.12.0

func (c *ContractAPI) Validate(ctx context.Context, existing bool) (err error)

type ContractCallRequest added in v0.12.0

type ContractCallRequest struct {
	Type       ContractCallType       `ffstruct:"ContractCallRequest" json:"type,omitempty" ffenum:"contractcalltype" ffexcludeinput:"true"`
	Interface  *UUID                  `ffstruct:"ContractCallRequest" json:"interface,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	Location   *JSONAny               `ffstruct:"ContractCallRequest" json:"location,omitempty"`
	Key        string                 `ffstruct:"ContractCallRequest" json:"key,omitempty"`
	Method     *FFIMethod             `ffstruct:"ContractCallRequest" json:"method,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	MethodPath string                 `ffstruct:"ContractCallRequest" json:"methodPath,omitempty" ffexcludeinput:"postContractAPIInvoke,postContractAPIQuery"`
	Input      map[string]interface{} `ffstruct:"ContractCallRequest" json:"input"`
}

type ContractCallType added in v0.12.0

type ContractCallType = FFEnum

type ContractListener added in v0.14.0

type ContractListener struct {
	ID        *UUID                    `ffstruct:"ContractListener" json:"id,omitempty" ffexcludeinput:"true"`
	Interface *FFIReference            `ffstruct:"ContractListener" json:"interface,omitempty" ffexcludeinput:"postContractAPIListeners"`
	Namespace string                   `ffstruct:"ContractListener" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name      string                   `ffstruct:"ContractListener" json:"name,omitempty"`
	BackendID string                   `ffstruct:"ContractListener" json:"backendId,omitempty" ffexcludeinput:"true"`
	Location  *JSONAny                 `ffstruct:"ContractListener" json:"location,omitempty"`
	Created   *FFTime                  `ffstruct:"ContractListener" json:"created,omitempty" ffexcludeinput:"true"`
	Event     *FFISerializedEvent      `ffstruct:"ContractListener" json:"event,omitempty" ffexcludeinput:"postContractAPIListeners"`
	Signature string                   `ffstruct:"ContractListener" json:"signature" ffexcludeinput:"true"`
	Topic     string                   `ffstruct:"ContractListener" json:"topic,omitempty"`
	Options   *ContractListenerOptions `ffstruct:"ContractListener" json:"options,omitempty"`
}

type ContractListenerInput added in v0.14.0

type ContractListenerInput struct {
	ContractListener
	EventPath string `ffstruct:"ContractListener" json:"eventPath,omitempty"`
}

type ContractListenerOptions added in v0.14.0

type ContractListenerOptions struct {
	FirstEvent string `ffstruct:"ContractListenerOptions" json:"firstEvent,omitempty"`
}

func (*ContractListenerOptions) Scan added in v0.14.0

func (o *ContractListenerOptions) Scan(src interface{}) error

Scan implements sql.Scanner

func (ContractListenerOptions) Value added in v0.14.0

type ContractURLs added in v0.12.0

type ContractURLs struct {
	OpenAPI string `ffstruct:"ContractURLs" json:"openapi"`
	UI      string `ffstruct:"ContractURLs" json:"ui"`
}

type Data

type Data struct {
	ID        *UUID         `ffstruct:"Data" json:"id,omitempty"`
	Validator ValidatorType `ffstruct:"Data" json:"validator"`
	Namespace string        `ffstruct:"Data" json:"namespace,omitempty"`
	Hash      *Bytes32      `ffstruct:"Data" json:"hash,omitempty"`
	Created   *FFTime       `ffstruct:"Data" json:"created,omitempty"`
	Datatype  *DatatypeRef  `ffstruct:"Data" json:"datatype,omitempty"`
	Value     *JSONAny      `ffstruct:"Data" json:"value"`
	Blob      *BlobRef      `ffstruct:"Data" json:"blob,omitempty"`

	ValueSize int64 `json:"-"` // Used internally for message size calcuation, without full payload retrieval
}

func (*Data) BatchData added in v0.14.0

func (d *Data) BatchData(batchType BatchType) *Data

BatchData is the fields in a data record that are assured to be consistent on all parties. This is what is transferred and hashed in a batch payload between nodes.

func (*Data) CalcHash

func (d *Data) CalcHash(ctx context.Context) (*Bytes32, error)

func (*Data) EstimateSize added in v0.12.0

func (d *Data) EstimateSize() int64

func (*Data) Seal

func (d *Data) Seal(ctx context.Context, blob *Blob) (err error)

type DataAndBlob

type DataAndBlob struct {
	Data *Data
	Blob *Blob
}

type DataArray added in v0.14.0

type DataArray []*Data

func (DataArray) Refs added in v0.14.0

func (da DataArray) Refs() DataRefs

type DataRef

type DataRef struct {
	ID   *UUID    `ffstruct:"DataRef" json:"id,omitempty"`
	Hash *Bytes32 `ffstruct:"DataRef" json:"hash,omitempty" ffexcludeinput:"true"`

	ValueSize int64 `json:"-"` // used internally for message size calculation, without full payload retrieval
}

type DataRefOrValue

type DataRefOrValue struct {
	DataRef

	Validator ValidatorType `ffstruct:"DataRefOrValue" json:"validator,omitempty"`
	Datatype  *DatatypeRef  `ffstruct:"DataRefOrValue" json:"datatype,omitempty"`
	Value     *JSONAny      `ffstruct:"DataRefOrValue" json:"value,omitempty"`
	Blob      *BlobRef      `ffstruct:"DataRefOrValue" json:"blob,omitempty" ffexcludeinput:"true"`
}

DataRefOrValue allows a value to be specified in-line in the data array of an input message, avoiding the need for a multiple API calls.

type DataRefs

type DataRefs []*DataRef

func (DataRefs) Hash

func (d DataRefs) Hash() *Bytes32

type Datatype

type Datatype struct {
	ID        *UUID         `ffstruct:"Datatype" json:"id,omitempty" ffexcludeinput:"true"`
	Message   *UUID         `ffstruct:"Datatype" json:"message,omitempty" ffexcludeinput:"true"`
	Validator ValidatorType `ffstruct:"Datatype" json:"validator" ffenum:"validatortype"`
	Namespace string        `ffstruct:"Datatype" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name      string        `ffstruct:"Datatype" json:"name,omitempty"`
	Version   string        `ffstruct:"Datatype" json:"version,omitempty"`
	Hash      *Bytes32      `ffstruct:"Datatype" json:"hash,omitempty" ffexcludeinput:"true"`
	Created   *FFTime       `ffstruct:"Datatype" json:"created,omitempty" ffexcludeinput:"true"`
	Value     *JSONAny      `ffstruct:"Datatype" json:"value,omitempty"`
}

Datatype is the structure defining a data definition, such as a JSON schema

func (*Datatype) SetBroadcastMessage

func (dt *Datatype) SetBroadcastMessage(msgID *UUID)

func (*Datatype) Topic

func (dt *Datatype) Topic() string

func (*Datatype) Validate

func (dt *Datatype) Validate(ctx context.Context, existing bool) (err error)

type DatatypeRef

type DatatypeRef struct {
	Name    string `ffstruct:"DatatypeRef" json:"name,omitempty"`
	Version string `ffstruct:"DatatypeRef" json:"version,omitempty"`
}

func (*DatatypeRef) String

func (dr *DatatypeRef) String() string

type Definition

type Definition interface {
	// Topic returns the topic on which the object should be broadcast
	Topic() string
	// SetBroadcastMessage sets the message that broadcast the definition
	SetBroadcastMessage(msgID *UUID)
}

Definition is implemented by all objects that can be broadcast as system definitions to the network

type DeprecatedDXInfo added in v0.14.0

type DeprecatedDXInfo struct {
	Peer     string     `json:"peer,omitempty"`
	Endpoint JSONObject `json:"endpoint,omitempty"`
}

type DeprecatedNode added in v0.14.0

type DeprecatedNode struct {
	ID          *UUID            `json:"id"`
	Message     *UUID            `json:"message,omitempty"`
	Owner       string           `json:"owner,omitempty"`
	Name        string           `json:"name,omitempty"`
	Description string           `json:"description,omitempty"`
	DX          DeprecatedDXInfo `json:"dx"`
	Created     *FFTime          `json:"created,omitempty"`
	// contains filtered or unexported fields
}

DeprecatedNode is the data structure we used to use prior to FIR-9. Now we use the common Identity structure throughout

func (*DeprecatedNode) AddMigratedParent added in v0.14.0

func (node *DeprecatedNode) AddMigratedParent(parentID *UUID) *IdentityClaim

func (*DeprecatedNode) Migrated added in v0.14.0

func (node *DeprecatedNode) Migrated() *IdentityClaim

Migrate creates and maintains a migrated IdentityClaim object, which is used when processing an old-style nodeanization broadcast received when joining an existing network

func (*DeprecatedNode) SetBroadcastMessage added in v0.14.0

func (node *DeprecatedNode) SetBroadcastMessage(msgID *UUID)

func (*DeprecatedNode) Topic added in v0.14.0

func (node *DeprecatedNode) Topic() string

type DeprecatedOrganization added in v0.14.0

type DeprecatedOrganization struct {
	ID          *UUID      `json:"id"`
	Message     *UUID      `json:"message,omitempty"`
	Parent      string     `json:"parent,omitempty"`
	Identity    string     `json:"identity,omitempty"`
	Name        string     `json:"name,omitempty"`
	Description string     `json:"description,omitempty"`
	Profile     JSONObject `json:"profile,omitempty"`
	Created     *FFTime    `json:"created,omitempty"`
	// contains filtered or unexported fields
}

DeprecatedOrganization is the data structure we used to use prior to FIR-9. Now we use the common Identity structure throughout

func (*DeprecatedOrganization) Migrated added in v0.14.0

func (org *DeprecatedOrganization) Migrated() *IdentityClaim

Migrate creates and maintains a migrated IdentityClaim object, which is used when processing an old-style organization broadcast received when joining an existing network

func (*DeprecatedOrganization) SetBroadcastMessage added in v0.14.0

func (org *DeprecatedOrganization) SetBroadcastMessage(msgID *UUID)

func (*DeprecatedOrganization) Topic added in v0.14.0

func (org *DeprecatedOrganization) Topic() string

type EmptyInput

type EmptyInput struct{}

EmptyInput represents an API with no input fields, but requiring a JSON content type on the request

type EnrichedEvent added in v0.14.0

type EnrichedEvent struct {
	Event
	BlockchainEvent   *BlockchainEvent `ffstruct:"EnrichedEvent" json:"blockchainEvent,omitempty"`
	ContractAPI       *ContractAPI     `ffstruct:"EnrichedEvent" json:"contractAPI,omitempty"`
	ContractInterface *FFI             `ffstruct:"EnrichedEvent" json:"contractInterface,omitempty"`
	Datatype          *Datatype        `ffstruct:"EnrichedEvent" json:"datatype,omitempty"`
	Identity          *Identity        `ffstruct:"EnrichedEvent" json:"identity,omitempty"`
	Message           *Message         `ffstruct:"EnrichedEvent" json:"message,omitempty"`
	NamespaceDetails  *Namespace       `ffstruct:"EnrichedEvent" json:"namespaceDetails,omitempty"`
	TokenApproval     *TokenApproval   `ffstruct:"EnrichedEvent" json:"tokenApproval,omitempty"`
	TokenPool         *TokenPool       `ffstruct:"EnrichedEvent" json:"tokenPool,omitempty"`
	TokenTransfer     *TokenTransfer   `ffstruct:"EnrichedEvent" json:"tokenTransfer,omitempty"`
	Transaction       *Transaction     `ffstruct:"EnrichedEvent" json:"transaction,omitempty"`
	Operation         *Operation       `ffstruct:"EnrichedEvent" json:"operation,omitempty"`
}

EnrichedEvent adds the referred object to an event

type Event

type Event struct {
	ID          *UUID     `ffstruct:"Event" json:"id"`
	Sequence    int64     `ffstruct:"Event" json:"sequence"`
	Type        EventType `ffstruct:"Event" json:"type" ffenum:"eventtype"`
	Namespace   string    `ffstruct:"Event" json:"namespace"`
	Reference   *UUID     `ffstruct:"Event" json:"reference"`
	Correlator  *UUID     `ffstruct:"Event" json:"correlator,omitempty"`
	Transaction *UUID     `ffstruct:"Event" json:"tx,omitempty"`
	Topic       string    `ffstruct:"Event" json:"topic,omitempty"`
	Created     *FFTime   `ffstruct:"Event" json:"created"`
}

Event is an activity in the system, delivered reliably to applications, that indicates something has happened in the network

func NewEvent

func NewEvent(t EventType, ns string, ref *UUID, tx *UUID, topic string) *Event

func (*Event) LocalSequence

func (e *Event) LocalSequence() int64

type EventDelivery

type EventDelivery struct {
	EnrichedEvent
	Subscription SubscriptionRef `json:"subscription"`
}

EventDelivery adds the referred object to an event, as well as details of the subscription that caused the event to be dispatched to an application.

type EventDeliveryResponse

type EventDeliveryResponse struct {
	ID           *UUID           `json:"id"`
	Rejected     bool            `json:"rejected,omitempty"`
	Info         string          `json:"info,omitempty"`
	Subscription SubscriptionRef `json:"subscription"`
	Reply        *MessageInOut   `json:"reply,omitempty"`
}

EventDeliveryResponse is the payload an application sends back, to confirm it has accepted (or rejected) the event and as such does not need to receive it again.

type EventType

type EventType = FFEnum

EventType indicates what the event means, as well as what the Reference in the event refers to

type FFBigInt added in v0.12.0

type FFBigInt big.Int

FFBigInt is a wrapper on a Go big.Int that standardizes JSON and DB serialization

func NewFFBigInt added in v0.12.0

func NewFFBigInt(x int64) *FFBigInt

func (*FFBigInt) Equals added in v0.12.0

func (i *FFBigInt) Equals(i2 *FFBigInt) bool

func (*FFBigInt) Int added in v0.12.0

func (i *FFBigInt) Int() *big.Int

func (*FFBigInt) Int64 added in v1.0.0

func (i *FFBigInt) Int64() int64

func (FFBigInt) MarshalText added in v0.12.0

func (i FFBigInt) MarshalText() ([]byte, error)

func (*FFBigInt) Scan added in v0.12.0

func (i *FFBigInt) Scan(src interface{}) error

func (*FFBigInt) Uint64 added in v1.0.0

func (i *FFBigInt) Uint64() uint64

func (*FFBigInt) UnmarshalJSON added in v0.12.0

func (i *FFBigInt) UnmarshalJSON(b []byte) error

func (FFBigInt) Value added in v0.12.0

func (i FFBigInt) Value() (driver.Value, error)

type FFDuration

type FFDuration time.Duration

FFDuration is serialized to JSON in the string format of time.Duration It can be unmarshalled from a number, or a string. - If it is a string in time.Duration format, that will be used - If it is a string that can be parsed as an int64, that will be used in Milliseconds - If it is a number, that will be used in Milliseconds

func ParseDurationString

func ParseDurationString(durationString string, def time.Duration) (FFDuration, error)

ParseDurationString is a standard handling of any duration string, in config or API options

func (*FFDuration) MarshalJSON

func (fd *FFDuration) MarshalJSON() ([]byte, error)

func (*FFDuration) Scan

func (fd *FFDuration) Scan(src interface{}) error

Scan implements sql.Scanner

func (*FFDuration) String

func (fd *FFDuration) String() string

func (*FFDuration) UnmarshalJSON

func (fd *FFDuration) UnmarshalJSON(b []byte) error

func (*FFDuration) Value

func (fd *FFDuration) Value() (driver.Value, error)

Value implements sql.Valuer

type FFEnum

type FFEnum string

func (FFEnum) Equals

func (ts FFEnum) Equals(ts2 FFEnum) bool

func (FFEnum) Lower

func (ts FFEnum) Lower() FFEnum

func (FFEnum) String

func (ts FFEnum) String() string

func (*FFEnum) UnmarshalText

func (ts *FFEnum) UnmarshalText(b []byte) error

func (FFEnum) Value

func (ts FFEnum) Value() (driver.Value, error)

type FFI added in v0.12.0

type FFI struct {
	ID          *UUID        `ffstruct:"FFI" json:"id,omitempty" ffexcludeinput:"true"`
	Message     *UUID        `ffstruct:"FFI" json:"message,omitempty" ffexcludeinput:"true"`
	Namespace   string       `ffstruct:"FFI" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name        string       `ffstruct:"FFI" json:"name"`
	Description string       `ffstruct:"FFI" json:"description"`
	Version     string       `ffstruct:"FFI" json:"version"`
	Methods     []*FFIMethod `ffstruct:"FFI" json:"methods,omitempty"`
	Events      []*FFIEvent  `ffstruct:"FFI" json:"events,omitempty"`
}

func (*FFI) SetBroadcastMessage added in v0.12.0

func (f *FFI) SetBroadcastMessage(msgID *UUID)

func (*FFI) Topic added in v0.12.0

func (f *FFI) Topic() string

func (*FFI) Validate added in v0.12.0

func (f *FFI) Validate(ctx context.Context, existing bool) (err error)

type FFIEvent added in v0.12.0

type FFIEvent struct {
	ID        *UUID  `ffstruct:"FFIEvent" json:"id,omitempty" ffexcludeinput:"true"`
	Interface *UUID  `ffstruct:"FFIEvent" json:"interface,omitempty" ffexcludeinput:"true"`
	Namespace string `ffstruct:"FFIEvent" json:"namespace,omitempty" ffexcludeinput:"true"`
	Pathname  string `ffstruct:"FFIEvent" json:"pathname,omitempty" ffexcludeinput:"true"`
	Signature string `ffstruct:"FFIEvent" json:"signature" ffexcludeinput:"true"`
	FFIEventDefinition
}

type FFIEventDefinition added in v0.12.0

type FFIEventDefinition struct {
	Name        string    `ffstruct:"FFIEvent" json:"name"`
	Description string    `ffstruct:"FFIEvent" json:"description"`
	Params      FFIParams `ffstruct:"FFIEvent" json:"params"`
}

type FFIGenerationRequest added in v0.13.1

type FFIGenerationRequest struct {
	Namespace   string   `ffstruct:"FFIGenerationRequest" json:"namespace,omitempty"`
	Name        string   `ffstruct:"FFIGenerationRequest" json:"name"`
	Description string   `ffstruct:"FFIGenerationRequest" json:"description"`
	Version     string   `ffstruct:"FFIGenerationRequest" json:"version"`
	Input       *JSONAny `ffstruct:"FFIGenerationRequest" json:"input"`
}

type FFIMethod added in v0.12.0

type FFIMethod struct {
	ID          *UUID     `ffstruct:"FFIMethod" json:"id,omitempty" ffexcludeinput:"true"`
	Interface   *UUID     `ffstruct:"FFIMethod" json:"interface,omitempty" ffexcludeinput:"true"`
	Name        string    `ffstruct:"FFIMethod" json:"name"`
	Namespace   string    `ffstruct:"FFIMethod" json:"namespace,omitempty" ffexcludeinput:"true"`
	Pathname    string    `ffstruct:"FFIMethod" json:"pathname" ffexcludeinput:"true"`
	Description string    `ffstruct:"FFIMethod" json:"description"`
	Params      FFIParams `ffstruct:"FFIMethod" json:"params"`
	Returns     FFIParams `ffstruct:"FFIMethod" json:"returns"`
}

type FFIParam added in v0.12.0

type FFIParam struct {
	Name   string   `ffstruct:"FFIParam" json:"name"`
	Schema *JSONAny `ffstruct:"FFIParam" json:"schema,omitempty"`
}

type FFIParamValidator added in v0.12.0

type FFIParamValidator interface {
	Compile(ctx jsonschema.CompilerContext, m map[string]interface{}) (jsonschema.ExtSchema, error)
	GetMetaSchema() *jsonschema.Schema
	GetExtensionName() string
}

type FFIParams added in v0.12.0

type FFIParams []*FFIParam

func (*FFIParams) Scan added in v0.12.0

func (m *FFIParams) Scan(src interface{}) error

Scan implements sql.Scanner

func (FFIParams) Value added in v0.12.0

func (m FFIParams) Value() (driver.Value, error)

type FFIReference added in v0.12.0

type FFIReference struct {
	ID      *UUID  `ffstruct:"FFIReference" json:"id,omitempty"`
	Name    string `ffstruct:"FFIReference" json:"name,omitempty"`
	Version string `ffstruct:"FFIReference" json:"version,omitempty"`
}

type FFISerializedEvent added in v0.12.0

type FFISerializedEvent struct {
	FFIEventDefinition
}

func (*FFISerializedEvent) Scan added in v0.12.0

func (fse *FFISerializedEvent) Scan(src interface{}) error

Scan implements sql.Scanner

func (FFISerializedEvent) Value added in v0.12.0

func (fse FFISerializedEvent) Value() (driver.Value, error)

type FFStringArray added in v0.12.0

type FFStringArray []string

FFStringArray is an array of strings, each conforming to the requirements of a FireFly name

func NewFFStringArray added in v0.12.0

func NewFFStringArray(initialContent ...string) FFStringArray

func (FFStringArray) AddToSortedSet added in v0.12.0

func (sa FFStringArray) AddToSortedSet(newValues ...string) (res FFStringArray, changed bool)

AddToSortedSet determines if the new string is already in the set of strings (case insensitive), and if not it adds it to the list (lower case) and returns a new slice of alphabetically sorted strings reference and true. If no change is made, the original reference is returned and false.

func (*FFStringArray) Scan added in v0.12.0

func (sa *FFStringArray) Scan(src interface{}) error

func (FFStringArray) String added in v0.12.0

func (sa FFStringArray) String() string

func (FFStringArray) Validate added in v0.12.0

func (sa FFStringArray) Validate(ctx context.Context, fieldName string, isName bool, maxItems int) error

func (FFStringArray) Value added in v0.12.0

func (sa FFStringArray) Value() (driver.Value, error)

type FFTime

type FFTime time.Time

FFTime is serialized to JSON on the API in RFC3339 nanosecond UTC time (noting that JavaScript can parse this format happily into millisecond time with Date.pase()). It is persisted as a nanosecond resolution timestamp in the database. It can be parsed from RFC3339, or unix timestamps (second, millisecond or nanosecond resolution)

func Now

func Now() *FFTime

func ParseTimeString added in v0.12.0

func ParseTimeString(str string) (*FFTime, error)

func UnixTime

func UnixTime(unixTime int64) *FFTime

func ZeroTime

func ZeroTime() FFTime

func (*FFTime) Equal

func (ft *FFTime) Equal(ft2 *FFTime) bool

func (*FFTime) MarshalJSON

func (ft *FFTime) MarshalJSON() ([]byte, error)

func (*FFTime) Scan

func (ft *FFTime) Scan(src interface{}) error

Scan implements sql.Scanner

func (FFTime) String

func (ft FFTime) String() string

func (*FFTime) Time added in v0.11.0

func (ft *FFTime) Time() *time.Time

func (*FFTime) UnixNano

func (ft *FFTime) UnixNano() int64

func (*FFTime) UnmarshalText

func (ft *FFTime) UnmarshalText(b []byte) error

func (FFTime) Value

func (ft FFTime) Value() (driver.Value, error)

Value implements sql.Valuer

type Group

type Group struct {
	GroupIdentity
	Message *UUID    `ffstruct:"Group" json:"message,omitempty"`
	Hash    *Bytes32 `ffstruct:"Group" json:"hash,omitempty"`
	Created *FFTime  `ffstruct:"Group" json:"created,omitempty"`
}

func (*Group) Seal

func (group *Group) Seal()

func (*Group) SetBroadcastMessage

func (group *Group) SetBroadcastMessage(msgID *UUID)

func (*Group) Topic

func (group *Group) Topic() string

func (*Group) Validate

func (group *Group) Validate(ctx context.Context, existing bool) (err error)

type GroupIdentity

type GroupIdentity struct {
	Namespace string  `ffstruct:"Group" json:"namespace,omitempty"`
	Name      string  `ffstruct:"Group" json:"name"`
	Members   Members `ffstruct:"Group" json:"members"`
}

func (*GroupIdentity) Hash

func (man *GroupIdentity) Hash() *Bytes32

type HexUUID

type HexUUID = Bytes32

HexUUID is 32 character ASCII string containing the hex representation of UUID, with the dashes of the canonical representation removed

type IDAndSequence added in v0.14.0

type IDAndSequence struct {
	ID       UUID
	Sequence int64
}

IDAndSequence is a combination of a UUID and a stored sequence

type Identity

type Identity struct {
	IdentityBase
	IdentityProfile
	Messages IdentityMessages `ffstruct:"Identity" json:"messages,omitempty" ffexcludeinput:"true"`
	Created  *FFTime          `ffstruct:"Identity" json:"created,omitempty" ffexcludeinput:"true"`
	Updated  *FFTime          `ffstruct:"Identity" json:"updated,omitempty"`
}

Identity is the persisted structure backing all identities, including orgs, nodes and custom identities

func (*Identity) Validate added in v0.14.0

func (identity *Identity) Validate(ctx context.Context) (err error)

type IdentityBase added in v0.14.0

type IdentityBase struct {
	ID        *UUID        `ffstruct:"Identity" json:"id" ffexcludeinput:"true"`
	DID       string       `ffstruct:"Identity" json:"did"`
	Type      IdentityType `ffstruct:"Identity" json:"type" ffenum:"identitytype" ffexcludeinput:"true"`
	Parent    *UUID        `ffstruct:"Identity" json:"parent,omitempty"`
	Namespace string       `ffstruct:"Identity" json:"namespace"`
	Name      string       `ffstruct:"Identity" json:"name,omitempty"`
}

IdentityBase are the immutable fields of an identity that determine what the identity itself is

func (*IdentityBase) Equals added in v0.14.0

func (i *IdentityBase) Equals(ctx context.Context, i2 *IdentityBase) bool

func (*IdentityBase) GenerateDID added in v0.14.0

func (i *IdentityBase) GenerateDID(ctx context.Context) (string, error)

func (*IdentityBase) Topic added in v0.14.0

func (i *IdentityBase) Topic() string

func (*IdentityBase) Validate added in v0.14.0

func (i *IdentityBase) Validate(ctx context.Context) (err error)

type IdentityClaim added in v0.14.0

type IdentityClaim struct {
	Identity *Identity `ffstruct:"IdentityClaim" json:"identity"`
}

IdentityClaim is the data payload used in a message to broadcast an intent to publish a new identity. Most claims (except root orgs, where different requirements apply) require a separate IdentityVerification from the parent identity to be published (on the same topic) before the identity is considered valid and is stored as a confirmed identity.

func (*IdentityClaim) SetBroadcastMessage added in v0.14.0

func (ic *IdentityClaim) SetBroadcastMessage(msgID *UUID)

func (*IdentityClaim) Topic added in v0.14.0

func (ic *IdentityClaim) Topic() string

type IdentityCreateDTO added in v0.14.0

type IdentityCreateDTO struct {
	Name   string       `ffstruct:"Identity" json:"name"`
	Type   IdentityType `ffstruct:"Identity" json:"type,omitempty"`
	Parent string       `ffstruct:"IdentityCreateDTO" json:"parent,omitempty"` // can be a DID for resolution, or the UUID directly
	Key    string       `ffstruct:"IdentityCreateDTO" json:"key,omitempty"`
	IdentityProfile
}

IdentityCreateDTO is the input structure to submit to register an identity. The blockchain key that will be used to establish the claim for the identity needs to be provided.

type IdentityMessages added in v0.14.0

type IdentityMessages struct {
	Claim        *UUID `ffstruct:"IdentityMessages" json:"claim"`
	Verification *UUID `ffstruct:"IdentityMessages" json:"verification"`
	Update       *UUID `ffstruct:"IdentityMessages" json:"update"`
}

type IdentityProfile added in v0.14.0

type IdentityProfile struct {
	Description string     `ffstruct:"IdentityProfile" json:"description,omitempty"`
	Profile     JSONObject `ffstruct:"IdentityProfile" json:"profile,omitempty"`
}

IdentityProfile are the field of a profile that can be updated over time

type IdentityType added in v0.14.0

type IdentityType = FFEnum

IdentityType is the type of an identity

type IdentityUpdate added in v0.14.0

type IdentityUpdate struct {
	Identity IdentityBase    `ffstruct:"IdentityUpdate" json:"identity"`
	Updates  IdentityProfile `ffstruct:"IdentityUpdate" json:"updates,omitempty"`
}

IdentityUpdate is the data payload used in message to broadcast an update to an identity profile. The broadcast must be on the same identity as the currently established identity claim message for the identity, and it must contain the same identity data. The profile is replaced in its entirety.

func (*IdentityUpdate) SetBroadcastMessage added in v0.14.0

func (iu *IdentityUpdate) SetBroadcastMessage(msgID *UUID)

func (*IdentityUpdate) Topic added in v0.14.0

func (iu *IdentityUpdate) Topic() string

type IdentityUpdateDTO added in v0.14.0

type IdentityUpdateDTO struct {
	IdentityProfile
}

IdentityUpdateDTO is the input structure to submit to update an identityprofile. The same key in the claim will be used for the update.

type IdentityVerification added in v0.14.0

type IdentityVerification struct {
	Claim    MessageRef   `ffstruct:"IdentityVerification" json:"claim"`
	Identity IdentityBase `ffstruct:"IdentityVerification" json:"identity"`
}

IdentityVerification is the data payload used in message to broadcast a verification of a child identity. Must refer to the UUID and Hash of the IdentityClaim message, and must contain the same base identity data.

func (*IdentityVerification) SetBroadcastMessage added in v0.14.0

func (iv *IdentityVerification) SetBroadcastMessage(msgID *UUID)

func (*IdentityVerification) Topic added in v0.14.0

func (iv *IdentityVerification) Topic() string

type IdentityWithVerifiers added in v1.0.0

type IdentityWithVerifiers struct {
	Identity
	Verifiers []*VerifierRef `ffstruct:"IdentityWithVerifiers" json:"verifiers"`
}

IdentityWithVerifiers has an embedded array of verifiers

type InlineData

type InlineData []*DataRefOrValue

InlineData is an array of data references or values

type InputGroup

type InputGroup struct {
	Name    string        `ffstruct:"InputGroup" json:"name,omitempty"`
	Members []MemberInput `ffstruct:"InputGroup" json:"members"`
}

InputGroup declares a group in-line for automatic resolution, without having to define a group up-front

type JSONAny added in v0.12.0

type JSONAny string

JSONAny uses raw encode/decode to preserve field order, and can handle any types of field. It validates the JSON can be unmarshalled, but does not change the order. It does however trim out whitespace

func JSONAnyPtr added in v0.12.0

func JSONAnyPtr(str string) *JSONAny

func JSONAnyPtrBytes added in v0.12.0

func JSONAnyPtrBytes(b []byte) *JSONAny

func (*JSONAny) Bytes added in v0.12.0

func (h *JSONAny) Bytes() []byte

func (*JSONAny) Hash added in v0.12.0

func (h *JSONAny) Hash() *Bytes32

func (*JSONAny) IsNil added in v0.12.0

func (h *JSONAny) IsNil() bool

func (*JSONAny) JSONObject added in v0.12.0

func (h *JSONAny) JSONObject() JSONObject

JSONObject attempts to de-serailize the contained structure as a JSON Object (map) Safe and will never return nil Will return an empty object if the type is array, string, bool, number etc.

func (*JSONAny) JSONObjectNowarn added in v0.12.0

func (h *JSONAny) JSONObjectNowarn() JSONObject

JSONObjectNowarn acts the same as JSONObject, but does not warn if the value cannot be parsed as an object

func (*JSONAny) JSONObjectOk added in v0.12.0

func (h *JSONAny) JSONObjectOk(noWarn ...bool) (JSONObject, bool)

func (*JSONAny) Length added in v0.12.0

func (h *JSONAny) Length() int64

func (JSONAny) MarshalJSON added in v0.12.0

func (h JSONAny) MarshalJSON() ([]byte, error)

func (*JSONAny) Scan added in v0.12.0

func (h *JSONAny) Scan(src interface{}) error

Scan implements sql.Scanner

func (*JSONAny) String added in v0.12.0

func (h *JSONAny) String() string

func (*JSONAny) Unmarshal added in v0.14.0

func (h *JSONAny) Unmarshal(ctx context.Context, v interface{}) error

func (*JSONAny) UnmarshalJSON added in v0.12.0

func (h *JSONAny) UnmarshalJSON(b []byte) error

func (*JSONAny) Value added in v0.14.0

func (h *JSONAny) Value() (driver.Value, error)

Value ensures we write null to the DB for null values

type JSONObject

type JSONObject map[string]interface{}

JSONObject is a holder of a hash, that can be used to correlate onchain data with off-chain data.

func (JSONObject) GetBool

func (jd JSONObject) GetBool(key string) bool

func (JSONObject) GetInt64 added in v0.12.0

func (jd JSONObject) GetInt64(key string) int64

func (JSONObject) GetInteger added in v0.12.0

func (jd JSONObject) GetInteger(key string) *big.Int

func (JSONObject) GetObject

func (jd JSONObject) GetObject(key string) JSONObject

func (JSONObject) GetObjectArray

func (jd JSONObject) GetObjectArray(key string) JSONObjectArray

func (JSONObject) GetObjectArrayOk

func (jd JSONObject) GetObjectArrayOk(key string) (JSONObjectArray, bool)

func (JSONObject) GetObjectOk

func (jd JSONObject) GetObjectOk(key string) (JSONObject, bool)

func (JSONObject) GetString

func (jd JSONObject) GetString(key string) string

func (JSONObject) GetStringArray

func (jd JSONObject) GetStringArray(key string) []string

func (JSONObject) GetStringArrayOk

func (jd JSONObject) GetStringArrayOk(key string) ([]string, bool)

func (JSONObject) GetStringOk

func (jd JSONObject) GetStringOk(key string) (string, bool)

func (JSONObject) Hash

func (jd JSONObject) Hash(jsonDesc string) (*Bytes32, error)

func (*JSONObject) Scan

func (jd *JSONObject) Scan(src interface{}) error

Scan implements sql.Scanner

func (JSONObject) String

func (jd JSONObject) String() string

func (JSONObject) Value

func (jd JSONObject) Value() (driver.Value, error)

Value implements sql.Valuer

type JSONObjectArray

type JSONObjectArray []JSONObject

JSONObjectArray is an array of JSONObject

func ToJSONObjectArray

func ToJSONObjectArray(unknown interface{}) (JSONObjectArray, bool)

func (JSONObjectArray) Hash

func (jd JSONObjectArray) Hash(jsonDesc string) (*Bytes32, error)

func (*JSONObjectArray) Scan

func (jd *JSONObjectArray) Scan(src interface{}) error

Scan implements sql.Scanner

func (JSONObjectArray) String

func (jd JSONObjectArray) String() string

func (JSONObjectArray) Value

func (jd JSONObjectArray) Value() (driver.Value, error)

type LocallySequenced

type LocallySequenced interface {
	LocalSequence() int64
}

type Member

type Member struct {
	Identity string `ffstruct:"Member" json:"identity,omitempty"`
	Node     *UUID  `ffstruct:"Member" json:"node,omitempty"`
}

type MemberInput

type MemberInput struct {
	Identity string `ffstruct:"MemberInput" json:"identity,omitempty"`
	Node     string `ffstruct:"MemberInput" json:"node,omitempty"`
}

type Members

type Members []*Member

func (Members) Len

func (m Members) Len() int

func (Members) Less

func (m Members) Less(i, j int) bool

func (Members) Swap

func (m Members) Swap(i, j int)

type Message

type Message struct {
	Header    MessageHeader `ffstruct:"Message" json:"header"`
	Hash      *Bytes32      `ffstruct:"Message" json:"hash,omitempty" ffexcludeinput:"true"`
	BatchID   *UUID         `ffstruct:"Message" json:"batch,omitempty" ffexcludeinput:"true"`
	State     MessageState  `ffstruct:"Message" json:"state,omitempty" ffenum:"messagestate"`
	Confirmed *FFTime       `ffstruct:"Message" json:"confirmed,omitempty" ffexcludeinput:"true"`
	Data      DataRefs      `ffstruct:"Message" json:"data" ffexcludeinput:"true"`
	Pins      FFStringArray `ffstruct:"Message" json:"pins,omitempty" ffexcludeinput:"true"`
	Sequence  int64         `ffstruct:"Message" json:"-"` // Local database sequence used internally for batch assembly
}

Message is the envelope by which coordinated data exchange can happen between parties in the network Data is passed by reference in these messages, and a chain of hashes covering the data and the details of the message, provides a verification against tampering.

func (*Message) BatchMessage added in v0.14.0

func (m *Message) BatchMessage() *Message

BatchMessage is the fields in a message record that are assured to be consistent on all parties. This is what is transferred and hashed in a batch payload between nodes.

func (*Message) DupDataCheck

func (m *Message) DupDataCheck(ctx context.Context) (err error)

func (*Message) EstimateSize added in v0.12.0

func (m *Message) EstimateSize(includeDataRefs bool) int64

func (*Message) LocalSequence

func (m *Message) LocalSequence() int64

func (*Message) Seal

func (m *Message) Seal(ctx context.Context) (err error)

func (*Message) Verify

func (m *Message) Verify(ctx context.Context) error

func (*Message) VerifyFields added in v0.14.0

func (m *Message) VerifyFields(ctx context.Context) error

type MessageFilter added in v0.14.0

type MessageFilter struct {
	Tag    string `ffstruct:"SubscriptionMessageFilter" json:"tag,omitempty"`
	Group  string `ffstruct:"SubscriptionMessageFilter" json:"group,omitempty"`
	Author string `ffstruct:"SubscriptionMessageFilter" json:"author,omitempty"`
}

type MessageHeader

type MessageHeader struct {
	ID     *UUID           `ffstruct:"MessageHeader" json:"id,omitempty" ffexcludeinput:"true"`
	CID    *UUID           `ffstruct:"MessageHeader" json:"cid,omitempty"`
	Type   MessageType     `ffstruct:"MessageHeader" json:"type" ffenum:"messagetype"`
	TxType TransactionType `ffstruct:"MessageHeader" json:"txtype,omitempty"`
	SignerRef
	Created   *FFTime       `ffstruct:"MessageHeader" json:"created,omitempty" ffexcludeinput:"true"`
	Namespace string        `ffstruct:"MessageHeader" json:"namespace,omitempty" ffexcludeinput:"true"`
	Group     *Bytes32      `ffstruct:"MessageHeader" json:"group,omitempty" ffexclude:"postNewMessageBroadcast"`
	Topics    FFStringArray `ffstruct:"MessageHeader" json:"topics,omitempty"`
	Tag       string        `ffstruct:"MessageHeader" json:"tag,omitempty"`
	DataHash  *Bytes32      `ffstruct:"MessageHeader" json:"datahash,omitempty" ffexcludeinput:"true"`
}

MessageHeader contains all fields that contribute to the hash The order of the serialization mut not change, once released

func (*MessageHeader) Hash

func (h *MessageHeader) Hash() *Bytes32

type MessageInOut

type MessageInOut struct {
	Message
	InlineData InlineData  `ffstruct:"MessageInOut" json:"data"`
	Group      *InputGroup `ffstruct:"MessageInOut" json:"group,omitempty" ffexclude:"postNewMessageBroadcast"`
}

MessageInOut allows API users to submit values in-line in the payload submitted, which will be broken out and stored separately during the call.

func (*MessageInOut) SetInlineData

func (m *MessageInOut) SetInlineData(data []*Data)

type MessageManifestEntry added in v0.14.0

type MessageManifestEntry struct {
	MessageRef
	Topics int `json:"topics"` // We only need the count, to be able to match up the pins
}

type MessageRef

type MessageRef struct {
	ID   *UUID    `ffstruct:"MessageRef" json:"id,omitempty"`
	Hash *Bytes32 `ffstruct:"MessageRef" json:"hash,omitempty"`
}

MessageRef is a lightweight data structure that can be used to refer to a message

type MessageState added in v0.11.0

type MessageState = FFEnum

MessageState is the current transmission/confirmation state of a message

type MessageType

type MessageType = FFEnum

MessageType is the fundamental type of a message

type Multipart

type Multipart struct {
	Filename string
	Mimetype string
	Data     io.Reader
}

Multipart represents streaming data in a multi-part upload

type Named

type Named interface {
	Name() string
}

type Namespace

type Namespace struct {
	ID          *UUID         `ffstruct:"Namespace" json:"id" ffexcludeinput:"true"`
	Message     *UUID         `ffstruct:"Namespace" json:"message,omitempty" ffexcludeinput:"true"`
	Name        string        `ffstruct:"Namespace" json:"name"`
	Description string        `ffstruct:"Namespace" json:"description"`
	Type        NamespaceType `ffstruct:"Namespace" json:"type" ffenum:"namespacetype" ffexcludeinput:"true"`
	Created     *FFTime       `ffstruct:"Namespace" json:"created" ffexcludeinput:"true"`
}

Namespace is a isolate set of named resources, to allow multiple applications to co-exist in the same network, with the same named objects. Can be used for use case segregation, or multi-tenancy.

func (*Namespace) SetBroadcastMessage

func (ns *Namespace) SetBroadcastMessage(msgID *UUID)

func (*Namespace) Topic

func (ns *Namespace) Topic() string

func (*Namespace) Validate

func (ns *Namespace) Validate(ctx context.Context, existing bool) (err error)

type NamespaceType

type NamespaceType = FFEnum

NamespaceType describes when the namespace was created from local configuration, or broadcast through the network

type NextPin

type NextPin struct {
	Context  *Bytes32 `json:"context"`
	Identity string   `json:"identity"`
	Hash     *Bytes32 `json:"hash"`
	Nonce    int64    `json:"nonce"`
	Sequence int64    `json:"_"` // Local database sequence used internally for update efficiency
}

type NodeStatus

type NodeStatus struct {
	Node     NodeStatusNode     `ffstruct:"NodeStatus" json:"node"`
	Org      NodeStatusOrg      `ffstruct:"NodeStatus" json:"org"`
	Defaults NodeStatusDefaults `ffstruct:"NodeStatus" json:"defaults"`
	Plugins  NodeStatusPlugins  `ffstruct:"NodeStatus" json:"plugins"`
}

NodeStatus is a set of information that represents the health, and identity of a node

type NodeStatusDefaults

type NodeStatusDefaults struct {
	Namespace string `ffstruct:"NodeStatusDefaults" json:"namespace"`
}

NodeStatusDefaults is information about core configuration th

type NodeStatusNode

type NodeStatusNode struct {
	Name       string `ffstruct:"NodeStatusNode" json:"name"`
	Registered bool   `ffstruct:"NodeStatusNode" json:"registered"`
	ID         *UUID  `ffstruct:"NodeStatusNode" json:"id,omitempty"`
}

NodeStatusNode is the information about the local node, returned in the node status

type NodeStatusOrg

type NodeStatusOrg struct {
	Name       string         `ffstruct:"NodeStatusOrg" json:"name"`
	Registered bool           `ffstruct:"NodeStatusOrg" json:"registered"`
	DID        string         `ffstruct:"NodeStatusOrg" json:"did,omitempty"`
	ID         *UUID          `ffstruct:"NodeStatusOrg" json:"id,omitempty"`
	Verifiers  []*VerifierRef `ffstruct:"NodeStatusOrg" json:"verifiers,omitempty"`
}

NodeStatusOrg is the information about the node owning org, returned in the node status

type NodeStatusPlugin added in v1.0.0

type NodeStatusPlugin struct {
	Name       string `ffstruct:"NodeStatusPlugin" json:"name,omitempty"`
	PluginType string `ffstruct:"NodeStatusPlugin" json:"pluginType"`
}

NodeStatusPlugin is information about a plugin

type NodeStatusPlugins added in v1.0.0

type NodeStatusPlugins struct {
	Blockchain    []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"blockchain"`
	Database      []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"database"`
	DataExchange  []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"dataExchange"`
	Events        []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"events"`
	Identity      []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"identity"`
	SharedStorage []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"sharedStorage"`
	Tokens        []*NodeStatusPlugin `ffstruct:"NodeStatusPlugins" json:"tokens"`
}

NodeStatusPlugins is a map of plugins configured on the node

type Nonce

type Nonce struct {
	Hash  *Bytes32 `json:"hash"`
	Nonce int64    `json:"nonce"`
}

Nonce is this local node's state record for the context of a group+topic+author combination. The Hash is the state of the hash before the nonce is added on to make it unique to the message.

type Offset

type Offset struct {
	Type    OffsetType `json:"type" ffenum:"offsettype"`
	Name    string     `json:"name"`
	Current int64      `json:"current,omitempty"`

	RowID int64 `json:"-"`
}

Offset is a simple stored data structure that records a sequence position within another collection

type OffsetType

type OffsetType = FFEnum

type OpStatus

type OpStatus string

OpStatus is the current status of an operation

const (
	// OpStatusPending indicates the operation has been submitted, but is not yet confirmed as successful or failed
	OpStatusPending OpStatus = "Pending"
	// OpStatusSucceeded the infrastructure runtime has returned success for the operation
	OpStatusSucceeded OpStatus = "Succeeded"
	// OpStatusFailed happens when an error is reported by the infrastructure runtime
	OpStatusFailed OpStatus = "Failed"
)

type OpType

type OpType = FFEnum

OpType describes mechanical steps in the process that have to be performed, might be asynchronous, and have results in the back-end systems that might need to be correlated with messages by operators.

type Operation

type Operation struct {
	ID          *UUID      `ffstruct:"Operation" json:"id" ffexcludeinput:"true"`
	Namespace   string     `ffstruct:"Operation" json:"namespace" ffexcludeinput:"true"`
	Transaction *UUID      `ffstruct:"Operation" json:"tx" ffexcludeinput:"true"`
	Type        OpType     `ffstruct:"Operation" json:"type" ffenum:"optype" ffexcludeinput:"true"`
	Status      OpStatus   `ffstruct:"Operation" json:"status"`
	Plugin      string     `ffstruct:"Operation" json:"plugin" ffexcludeinput:"true"`
	Input       JSONObject `ffstruct:"Operation" json:"input,omitempty" ffexcludeinput:"true"`
	Output      JSONObject `ffstruct:"Operation" json:"output,omitempty"`
	Error       string     `ffstruct:"Operation" json:"error,omitempty"`
	Created     *FFTime    `ffstruct:"Operation" json:"created,omitempty" ffexcludeinput:"true"`
	Updated     *FFTime    `ffstruct:"Operation" json:"updated,omitempty" ffexcludeinput:"true"`
	Retry       *UUID      `ffstruct:"Operation" json:"retry,omitempty" ffexcludeinput:"true"`
}

Operation is a description of an action performed as part of a transaction submitted by this node

func NewOperation added in v0.13.0

func NewOperation(plugin Named, namespace string, tx *UUID, opType OpType) *Operation

NewOperation creates a new operation in a transaction

type Pin

type Pin struct {
	Sequence   int64    `ffstruct:"Pin" json:"sequence"`
	Masked     bool     `ffstruct:"Pin" json:"masked,omitempty"`
	Hash       *Bytes32 `ffstruct:"Pin" json:"hash,omitempty"`
	Batch      *UUID    `ffstruct:"Pin" json:"batch,omitempty"`
	BatchHash  *Bytes32 `ffstruct:"Pin" json:"batchHash,omitempty"`
	Index      int64    `ffstruct:"Pin" json:"index"`
	Dispatched bool     `ffstruct:"Pin" json:"dispatched,omitempty"`
	Signer     string   `ffstruct:"Pin" json:"signer,omitempty"`
	Created    *FFTime  `ffstruct:"Pin" json:"created,omitempty"`
}

Pin represents a ledger-pinning event that has been detected from the blockchain, in the sequence that it was detected.

A batch contains many messages, and each of those messages can be on a different topic (or topics) All messages on the same topic must be processed in the order that the batch pinning events arrive from the blockchain.

As we need to correlate the on-chain events, with off-chain data that might arrive at a different time (or never), we "park" all pinned sequences first, then only complete them (and generate the associated events) once all the data has been assembled for all messages on that sequence, within that batch.

We might park the pin first (from the blockchain), or park the batch first (if it arrived first off-chain). There's a third part as well that can block a message, which is large blob data moving separately to the batch. If we get the private message, then the batch, before receiving the blob data - we have to upgrade a batch-park, to a pin-park. This is because the sequence must be in the order the pins arrive.

func (*Pin) LocalSequence

func (p *Pin) LocalSequence() int64

type PreparedOperation added in v0.14.0

type PreparedOperation struct {
	ID        *UUID       `json:"id"`
	Namespace string      `json:"namespace"`
	Type      OpType      `json:"type" ffenum:"optype"`
	Data      interface{} `json:"data"`
}

PreparedOperation is an operation that has gathered all the raw data ready to send to a plugin It is never stored, but it should always be possible for the owning Manager to generate a PreparedOperation from an Operation. Data is defined by the Manager, but should be JSON-serializable to support inspection and debugging.

type RESTError

type RESTError struct {
	Error string `json:"error"`
}

type SignerRef added in v0.14.0

type SignerRef struct {
	Author string `ffstruct:"SignerRef" json:"author,omitempty"`
	Key    string `ffstruct:"SignerRef" json:"key,omitempty"`
}

SignerRef is the nested structure representing the identity that signed a message. It might comprise a resolvable by FireFly identity DID, a blockchain signing key, or both.

type SubOptsFirstEvent

type SubOptsFirstEvent string

SubOptsFirstEvent picks the first event that should be dispatched on the subscription, and can be a string containing an exact sequence as well as one of the enum values

const (
	// SubOptsFirstEventOldest indicates all events should be dispatched to the subscription
	SubOptsFirstEventOldest SubOptsFirstEvent = "oldest"
	// SubOptsFirstEventNewest indicates only newly received events should be dispatched to the subscription
	SubOptsFirstEventNewest SubOptsFirstEvent = "newest"
)

type Subscription

type Subscription struct {
	SubscriptionRef

	Transport string              `ffstruct:"Subscription" json:"transport"`
	Filter    SubscriptionFilter  `ffstruct:"Subscription" json:"filter"`
	Options   SubscriptionOptions `ffstruct:"Subscription" json:"options"`
	Ephemeral bool                `ffstruct:"Subscription" json:"ephemeral,omitempty" ffexcludeinput:"true"`
	Created   *FFTime             `ffstruct:"Subscription" json:"created" ffexcludeinput:"true"`
	Updated   *FFTime             `ffstruct:"Subscription" json:"updated" ffexcludeinput:"true"`
}

Subscription is a binding between the stream of events within a namespace, and an event interface - such as an application listening on websockets

type SubscriptionCoreOptions

type SubscriptionCoreOptions struct {
	FirstEvent *SubOptsFirstEvent `ffstruct:"SubscriptionCoreOptions" json:"firstEvent,omitempty"`
	ReadAhead  *uint16            `ffstruct:"SubscriptionCoreOptions" json:"readAhead,omitempty"`
	WithData   *bool              `ffstruct:"SubscriptionCoreOptions" json:"withData,omitempty"`
}

SubscriptionCoreOptions are the core options that apply across all transports

type SubscriptionFilter

type SubscriptionFilter struct {
	Events           string                `ffstruct:"SubscriptionFilter" json:"events,omitempty"`
	Message          MessageFilter         `ffstruct:"SubscriptionFilter" json:"message,omitempty"`
	Transaction      TransactionFilter     `ffstruct:"SubscriptionFilter" json:"transaction,omitempty"`
	BlockchainEvent  BlockchainEventFilter `ffstruct:"SubscriptionFilter" json:"blockchainevent,omitempty"`
	Topic            string                `ffstruct:"SubscriptionFilter" json:"topic,omitempty"`
	DeprecatedTopics string                `ffstruct:"SubscriptionFilter" json:"topics,omitempty"`
	DeprecatedTag    string                `ffstruct:"SubscriptionFilter" json:"tag,omitempty"`
	DeprecatedGroup  string                `ffstruct:"SubscriptionFilter" json:"group,omitempty"`
	DeprecatedAuthor string                `ffstruct:"SubscriptionFilter" json:"author,omitempty"`
}

SubscriptionFilter contains regular expressions to match against events. All must match for an event to be dispatched to a subscription

func NewSubscriptionFilterFromQuery added in v0.14.0

func NewSubscriptionFilterFromQuery(query url.Values) SubscriptionFilter

func (*SubscriptionFilter) Scan added in v0.14.0

func (sf *SubscriptionFilter) Scan(src interface{}) error

func (SubscriptionFilter) Value added in v0.14.0

func (sf SubscriptionFilter) Value() (driver.Value, error)

type SubscriptionOptions

type SubscriptionOptions struct {
	SubscriptionCoreOptions
	// contains filtered or unexported fields
}

SubscriptionOptions customize the behavior of subscriptions

func (SubscriptionOptions) MarshalJSON

func (so SubscriptionOptions) MarshalJSON() ([]byte, error)

func (*SubscriptionOptions) Scan

func (so *SubscriptionOptions) Scan(src interface{}) error

Scan implements sql.Scanner

func (*SubscriptionOptions) TransportOptions

func (so *SubscriptionOptions) TransportOptions() JSONObject

func (*SubscriptionOptions) UnmarshalJSON

func (so *SubscriptionOptions) UnmarshalJSON(b []byte) error

func (SubscriptionOptions) Value

func (so SubscriptionOptions) Value() (driver.Value, error)

Value implements sql.Valuer

type SubscriptionRef

type SubscriptionRef struct {
	ID        *UUID  `ffstruct:"Subscription" json:"id" ffexcludeinput:"true"`
	Namespace string `ffstruct:"Subscription" json:"namespace"`
	Name      string `ffstruct:"Subscription" json:"name"`
}

SubscriptionRef are the fields that can be used to refer to a subscription

type TokenAccount

type TokenAccount struct {
	Key string `ffstruct:"TokenBalance" json:"key,omitempty"`
}

Currently these types are just filtered views of TokenBalance. If more fields/aggregation become needed, they might merit a new table in the database.

type TokenAccountPool added in v0.11.0

type TokenAccountPool struct {
	Pool *UUID `ffstruct:"TokenBalance" json:"pool,omitempty"`
}

type TokenApproval added in v0.13.1

type TokenApproval struct {
	LocalID         *UUID          `ffstruct:"TokenApproval" json:"localId,omitempty" ffexcludeinput:"true"`
	Pool            *UUID          `ffstruct:"TokenApproval" json:"pool,omitempty"`
	Connector       string         `ffstruct:"TokenApproval" json:"connector,omitempty" ffexcludeinput:"true"`
	Key             string         `ffstruct:"TokenApproval" json:"key,omitempty"`
	Operator        string         `ffstruct:"TokenApproval" json:"operator,omitempty"`
	Approved        bool           `ffstruct:"TokenApproval" json:"approved"`
	Info            JSONObject     `ffstruct:"TokenApproval" json:"info,omitempty" ffexcludeinput:"true"`
	Namespace       string         `ffstruct:"TokenApproval" json:"namespace,omitempty" ffexcludeinput:"true"`
	ProtocolID      string         `ffstruct:"TokenApproval" json:"protocolId,omitempty" ffexcludeinput:"true"`
	Subject         string         `ffstruct:"TokenApproval" json:"subject,omitempty" ffexcludeinput:"true"`
	Active          bool           `ffstruct:"TokenApproval" json:"active,omitempty" ffexcludeinput:"true"`
	Created         *FFTime        `ffstruct:"TokenApproval" json:"created,omitempty" ffexcludeinput:"true"`
	TX              TransactionRef `ffstruct:"TokenApproval" json:"tx" ffexcludeinput:"true"`
	BlockchainEvent *UUID          `ffstruct:"TokenApproval" json:"blockchainEvent,omitempty" ffexcludeinput:"true"`
	Config          JSONObject     `ffstruct:"TokenApproval" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
}

type TokenApprovalInput added in v0.13.1

type TokenApprovalInput struct {
	TokenApproval
	Pool string `ffstruct:"TokenApprovalInput" json:"pool,omitempty"`
}

type TokenBalance added in v0.11.0

type TokenBalance struct {
	Pool       *UUID    `ffstruct:"TokenBalance" json:"pool,omitempty"`
	TokenIndex string   `ffstruct:"TokenBalance" json:"tokenIndex,omitempty"`
	URI        string   `ffstruct:"TokenBalance" json:"uri,omitempty"`
	Connector  string   `ffstruct:"TokenBalance" json:"connector,omitempty"`
	Namespace  string   `ffstruct:"TokenBalance" json:"namespace,omitempty"`
	Key        string   `ffstruct:"TokenBalance" json:"key,omitempty"`
	Balance    FFBigInt `ffstruct:"TokenBalance" json:"balance"`
	Updated    *FFTime  `ffstruct:"TokenBalance" json:"updated,omitempty"`
}

func (*TokenBalance) Identifier added in v0.11.0

func (t *TokenBalance) Identifier() string

type TokenConnector added in v0.11.0

type TokenConnector struct {
	Name string `ffstruct:"TokenConnector" json:"name,omitempty"`
}

type TokenPool

type TokenPool struct {
	ID        *UUID          `ffstruct:"TokenPool" json:"id,omitempty" ffexcludeinput:"true"`
	Type      TokenType      `ffstruct:"TokenPool" json:"type" ffenum:"tokentype"`
	Namespace string         `ffstruct:"TokenPool" json:"namespace,omitempty" ffexcludeinput:"true"`
	Name      string         `ffstruct:"TokenPool" json:"name,omitempty"`
	Standard  string         `ffstruct:"TokenPool" json:"standard,omitempty" ffexcludeinput:"true"`
	Locator   string         `ffstruct:"TokenPool" json:"locator,omitempty" ffexcludeinput:"true"`
	Key       string         `ffstruct:"TokenPool" json:"key,omitempty"`
	Symbol    string         `ffstruct:"TokenPool" json:"symbol,omitempty"`
	Decimals  int            `ffstruct:"TokenPool" json:"decimals,omitempty" ffexcludeinput:"true"`
	Connector string         `ffstruct:"TokenPool" json:"connector,omitempty"`
	Message   *UUID          `ffstruct:"TokenPool" json:"message,omitempty" ffexcludeinput:"true"`
	State     TokenPoolState `ffstruct:"TokenPool" json:"state,omitempty" ffenum:"tokenpoolstate" ffexcludeinput:"true"`
	Created   *FFTime        `ffstruct:"TokenPool" json:"created,omitempty" ffexcludeinput:"true"`
	Config    JSONObject     `ffstruct:"TokenPool" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
	Info      JSONObject     `ffstruct:"TokenPool" json:"info,omitempty" ffexcludeinput:"true"`
	TX        TransactionRef `ffstruct:"TokenPool" json:"tx,omitempty" ffexcludeinput:"true"`
}

func (*TokenPool) Validate

func (t *TokenPool) Validate(ctx context.Context) (err error)

type TokenPoolAnnouncement

type TokenPoolAnnouncement struct {
	Pool *TokenPool `json:"pool"`
}

func (*TokenPoolAnnouncement) SetBroadcastMessage added in v0.11.0

func (t *TokenPoolAnnouncement) SetBroadcastMessage(msgID *UUID)

func (*TokenPoolAnnouncement) Topic added in v0.11.0

func (t *TokenPoolAnnouncement) Topic() string

type TokenPoolState added in v0.11.0

type TokenPoolState = FFEnum

TokenPoolState is the current confirmation state of a token pool

type TokenTransfer

type TokenTransfer struct {
	Type            TokenTransferType `ffstruct:"TokenTransfer" json:"type" ffenum:"tokentransfertype" ffexcludeinput:"true"`
	LocalID         *UUID             `ffstruct:"TokenTransfer" json:"localId,omitempty" ffexcludeinput:"true"`
	Pool            *UUID             `ffstruct:"TokenTransfer" json:"pool,omitempty"`
	TokenIndex      string            `ffstruct:"TokenTransfer" json:"tokenIndex,omitempty"`
	URI             string            `ffstruct:"TokenTransfer" json:"uri,omitempty"`
	Connector       string            `ffstruct:"TokenTransfer" json:"connector,omitempty" ffexcludeinput:"true"`
	Namespace       string            `ffstruct:"TokenTransfer" json:"namespace,omitempty" ffexcludeinput:"true"`
	Key             string            `ffstruct:"TokenTransfer" json:"key,omitempty"`
	From            string            `ffstruct:"TokenTransfer" json:"from,omitempty" ffexcludeinput:"postTokenMint"`
	To              string            `ffstruct:"TokenTransfer" json:"to,omitempty" ffexcludeinput:"postTokenBurn"`
	Amount          FFBigInt          `ffstruct:"TokenTransfer" json:"amount"`
	ProtocolID      string            `ffstruct:"TokenTransfer" json:"protocolId,omitempty" ffexcludeinput:"true"`
	Message         *UUID             `ffstruct:"TokenTransfer" json:"message,omitempty"`
	MessageHash     *Bytes32          `ffstruct:"TokenTransfer" json:"messageHash,omitempty" ffexcludeinput:"true"`
	Created         *FFTime           `ffstruct:"TokenTransfer" json:"created,omitempty" ffexcludeinput:"true"`
	TX              TransactionRef    `ffstruct:"TokenTransfer" json:"tx" ffexcludeinput:"true"`
	BlockchainEvent *UUID             `ffstruct:"TokenTransfer" json:"blockchainEvent,omitempty" ffexcludeinput:"true"`
	Config          JSONObject        `ffstruct:"TokenTransfer" json:"config,omitempty" ffexcludeoutput:"true"` // for REST calls only (not stored)
}

type TokenTransferInput added in v0.10.1

type TokenTransferInput struct {
	TokenTransfer
	Message *MessageInOut `ffstruct:"TokenTransferInput" json:"message,omitempty"`
	Pool    string        `ffstruct:"TokenTransferInput" json:"pool,omitempty"`
}

type TokenTransferType

type TokenTransferType = FFEnum

type TokenType

type TokenType = FFEnum

type Transaction

type Transaction struct {
	ID            *UUID           `ffstruct:"Transaction" json:"id,omitempty"`
	Namespace     string          `ffstruct:"Transaction" json:"namespace,omitempty"`
	Type          TransactionType `ffstruct:"Transaction" json:"type" ffenum:"txtype"`
	Created       *FFTime         `ffstruct:"Transaction" json:"created"`
	BlockchainIDs FFStringArray   `ffstruct:"Transaction" json:"blockchainIds,omitempty"`
}

Transaction is a unit of work sent or received by this node It serves as a container for one or more Operations, BlockchainEvents, and other related objects

func (*Transaction) Size added in v0.14.0

func (tx *Transaction) Size() int64

type TransactionFilter added in v0.14.0

type TransactionFilter struct {
	Type string `ffstruct:"SubscriptionTransactionFilter" json:"type,omitempty"`
}

type TransactionRef

type TransactionRef struct {
	Type TransactionType `ffstruct:"Transaction" json:"type"`
	ID   *UUID           `ffstruct:"Transaction" json:"id,omitempty"`
}

TransactionRef refers to a transaction, in other types

type TransactionStatus added in v0.12.0

type TransactionStatus struct {
	Status  OpStatus                    `ffstruct:"TransactionStatus" json:"status"`
	Details []*TransactionStatusDetails `ffstruct:"TransactionStatus" json:"details"`
}

type TransactionStatusDetails added in v0.12.0

type TransactionStatusDetails struct {
	Type      TransactionStatusType `ffstruct:"TransactionStatusDetails" json:"type"`
	SubType   string                `ffstruct:"TransactionStatusDetails" json:"subtype,omitempty"`
	Status    OpStatus              `ffstruct:"TransactionStatusDetails" json:"status"`
	Timestamp *FFTime               `ffstruct:"TransactionStatusDetails" json:"timestamp,omitempty"`
	ID        *UUID                 `ffstruct:"TransactionStatusDetails" json:"id,omitempty"`
	Error     string                `ffstruct:"TransactionStatusDetails" json:"error,omitempty"`
	Info      JSONObject            `ffstruct:"TransactionStatusDetails" json:"info,omitempty"`
}

type TransactionStatusType added in v0.12.0

type TransactionStatusType string
var (
	TransactionStatusTypeOperation       TransactionStatusType = "Operation"
	TransactionStatusTypeBlockchainEvent TransactionStatusType = "BlockchainEvent"
	TransactionStatusTypeBatch           TransactionStatusType = "Batch"
	TransactionStatusTypeTokenPool       TransactionStatusType = "TokenPool"
	TransactionStatusTypeTokenTransfer   TransactionStatusType = "TokenTransfer"
	TransactionStatusTypeTokenApproval   TransactionStatusType = "TokenApproval"
)

type TransactionType

type TransactionType = FFEnum

type TransportPayloadType

type TransportPayloadType = FFEnum

type TransportStatusUpdate added in v0.12.0

type TransportStatusUpdate struct {
	Error    string     `json:"error,omitempty"`
	Manifest string     `json:"manifest,omitempty"`
	Info     JSONObject `json:"info,omitempty"`
	Hash     string     `json:"hash,omitempty"`
}

type TransportWrapper

type TransportWrapper struct {
	Group *Group `json:"group,omitempty"`
	Batch *Batch `json:"batch,omitempty"`
}

TransportWrapper wraps paylaods over data exchange transfers, for easy deserialization at target

type UUID

type UUID uuid.UUID

UUID is a wrapper on a UUID implementation, ensuring Value handles nil

func MustParseUUID

func MustParseUUID(uuidStr string) *UUID

func NewUUID

func NewUUID() *UUID

func ParseUUID

func ParseUUID(ctx context.Context, uuidStr string) (*UUID, error)

func (*UUID) Equals

func (u *UUID) Equals(u2 *UUID) bool

func (*UUID) HashBucket added in v1.0.0

func (u *UUID) HashBucket(buckets int) int

func (UUID) MarshalBinary

func (u UUID) MarshalBinary() ([]byte, error)

func (UUID) MarshalText

func (u UUID) MarshalText() ([]byte, error)

func (*UUID) Scan

func (u *UUID) Scan(src interface{}) error

func (*UUID) String

func (u *UUID) String() string

func (*UUID) UnmarshalBinary

func (u *UUID) UnmarshalBinary(b []byte) error

func (*UUID) UnmarshalText

func (u *UUID) UnmarshalText(b []byte) error

func (*UUID) Value

func (u *UUID) Value() (driver.Value, error)

type ValidatorType

type ValidatorType = FFEnum

type Verifier added in v0.14.0

type Verifier struct {
	Hash      *Bytes32 `ffstruct:"Verifier" json:"hash"` // Used to ensure the same ID is generated on each node, but not critical for verification. In v0.13 migration was set to the ID of the parent.
	Identity  *UUID    `ffstruct:"Verifier" json:"identity,omitempty"`
	Namespace string   `ffstruct:"Verifier" json:"namespace,omitempty"`
	VerifierRef
	Created *FFTime `ffstruct:"Verifier" json:"created,omitempty"`
}

Verifier is an identity verification system that has been established for this identity, such as a blockchain signing key identifier

func (*Verifier) Seal added in v0.14.0

func (v *Verifier) Seal() *Verifier

Seal updates the hash to be deterministically generated from the namespace+type+value, such that it will be the same on every node, and unique.

type VerifierRef added in v0.14.0

type VerifierRef struct {
	Type  VerifierType `ffstruct:"Verifier" json:"type" ffenum:"verifiertype"`
	Value string       `ffstruct:"Verifier" json:"value"`
}

VerifierRef is just the type + value (public key identifier etc.) from the verifier

type VerifierType added in v0.14.0

type VerifierType = FFEnum

VerifierType is the type of an identity verifier. Where possible we use established DID verifier type strings

type WSChangeEventCommand added in v1.0.0

type WSChangeEventCommand struct {
	Type        WSChangeEventCommandType `json:"type" ffenum:"changeevent_cmd_type"`
	Collections []string                 `json:"collections"`
	Filter      ChangeEventFilter        `json:"filter"`
}

WSChangeEventCommand is the WebSocket command to send to start listening for change events. Replaces any previous start requests.

type WSChangeEventCommandType added in v1.0.0

type WSChangeEventCommandType = FFEnum

type WSClientActionAckPayload

type WSClientActionAckPayload struct {
	WSClientActionBase

	ID           *UUID            `json:"id,omitempty"`
	Subscription *SubscriptionRef `json:"subscription,omitempty"`
}

WSClientActionAckPayload acknowldges a received event (not applicable in AutoAck mode)

type WSClientActionBase

type WSClientActionBase struct {
	Type WSClientPayloadType `json:"type,omitempty"`
}

WSClientActionBase is the base fields of all client actions sent on the websocket

type WSClientActionStartPayload

type WSClientActionStartPayload struct {
	WSClientActionBase

	AutoAck   *bool               `json:"autoack"`
	Namespace string              `json:"namespace"`
	Name      string              `json:"name"`
	Ephemeral bool                `json:"ephemeral"`
	Filter    SubscriptionFilter  `json:"filter"`
	Options   SubscriptionOptions `json:"options"`
}

WSClientActionStartPayload starts a subscription on this socket - either an existing one, or creating an ephemeral one

type WSClientPayloadType

type WSClientPayloadType = FFEnum

WSClientPayloadType actions go from client->server

type WSConnectionStatus added in v1.0.0

type WSConnectionStatus struct {
	ID            string                  `ffstruct:"WSConnectionStatus" json:"id"`
	RemoteAddress string                  `ffstruct:"WSConnectionStatus" json:"remoteAddress"`
	UserAgent     string                  `ffstruct:"WSConnectionStatus" json:"userAgent"`
	Subscriptions []*WSSubscriptionStatus `ffstruct:"WSConnectionStatus" json:"subscriptions"`
}

type WSProtocolErrorPayload

type WSProtocolErrorPayload struct {
	Type  WSClientPayloadType `json:"type" ffenum:"wstype"`
	Error string              `json:"error"`
}

WSProtocolErrorPayload is sent to the client by the server in the case of a protocol error

type WSSubscriptionStatus added in v1.0.0

type WSSubscriptionStatus struct {
	Ephemeral bool   `ffstruct:"WSSubscriptionStatus" json:"ephemeral"`
	Namespace string `ffstruct:"WSSubscriptionStatus" json:"namespace"`
	Name      string `ffstruct:"WSSubscriptionStatus" json:"name,omitempty"`
}

type WebSocketStatus added in v1.0.0

type WebSocketStatus struct {
	Enabled     bool                  `ffstruct:"WebSocketStatus" json:"enabled"`
	Connections []*WSConnectionStatus `ffstruct:"WebSocketStatus" json:"connections"`
}

Jump to

Keyboard shortcuts

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