orchestrator

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Apr 25, 2024 License: Apache-2.0 Imports: 41 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Purge added in v1.3.0

func Purge(ctx context.Context, ns *core.Namespace, plugins *Plugins, dxNodeName string)

Types

type AuthPlugin added in v1.1.0

type AuthPlugin struct {
	Name   string
	Plugin auth.Plugin
}

type BlockchainPlugin added in v1.1.0

type BlockchainPlugin struct {
	Name   string
	Plugin blockchain.Plugin
}

type Config added in v1.1.0

type Config struct {
	DefaultKey                  string
	KeyNormalization            string
	Multiparty                  multiparty.Config
	TokenBroadcastNames         map[string]string
	MaxHistoricalEventScanLimit int
}

type DataExchangePlugin added in v1.1.0

type DataExchangePlugin struct {
	Name   string
	Plugin dataexchange.Plugin
}

type DatabasePlugin added in v1.1.0

type DatabasePlugin struct {
	Name   string
	Plugin database.Plugin
}

type IdentityPlugin added in v1.1.0

type IdentityPlugin struct {
	Name   string
	Plugin idplugin.Plugin
}

type Orchestrator

type Orchestrator interface {
	PreInit(ctx context.Context, cancelCtx context.CancelFunc)
	Init() error
	Start() error
	WaitStop() // The close itself is performed by canceling the context

	MultiParty() multiparty.Manager             // only for multiparty
	BatchManager() batch.Manager                // only for multiparty
	Broadcast() broadcast.Manager               // only for multiparty
	PrivateMessaging() privatemessaging.Manager // only for multiparty
	Assets() assets.Manager
	DefinitionSender() definitions.Sender
	Contracts() contracts.Manager
	Data() data.Manager
	Events() events.EventManager
	NetworkMap() networkmap.Manager
	Operations() operations.Manager
	Identity() identity.Manager

	// Status
	GetStatus(ctx context.Context) (*core.NamespaceStatus, error)

	// Subscription management
	GetSubscriptions(ctx context.Context, filter ffapi.AndFilter) ([]*core.Subscription, *ffapi.FilterResult, error)
	GetSubscriptionByID(ctx context.Context, id string) (*core.Subscription, error)
	GetSubscriptionByIDWithStatus(ctx context.Context, id string) (*core.SubscriptionWithStatus, error)
	GetSubscriptionEventsHistorical(ctx context.Context, subscription *core.Subscription, filter ffapi.AndFilter, startSequence int, endSequence int) ([]*core.EnrichedEvent, *ffapi.FilterResult, error)
	CreateSubscription(ctx context.Context, subDef *core.Subscription) (*core.Subscription, error)
	CreateUpdateSubscription(ctx context.Context, subDef *core.Subscription) (*core.Subscription, error)
	DeleteSubscription(ctx context.Context, id string) error

	// Data Query
	GetNamespace(ctx context.Context) *core.Namespace
	GetTransactionByID(ctx context.Context, id string) (*core.Transaction, error)
	GetTransactionOperations(ctx context.Context, id string) ([]*core.Operation, *ffapi.FilterResult, error)
	GetTransactionBlockchainEvents(ctx context.Context, id string) ([]*core.BlockchainEvent, *ffapi.FilterResult, error)
	GetTransactionStatus(ctx context.Context, id string) (*core.TransactionStatus, error)
	GetTransactions(ctx context.Context, filter ffapi.AndFilter) ([]*core.Transaction, *ffapi.FilterResult, error)
	GetMessageByID(ctx context.Context, id string) (*core.Message, error)
	GetMessageByIDWithData(ctx context.Context, id string) (*core.MessageInOut, error)
	GetMessages(ctx context.Context, filter ffapi.AndFilter) ([]*core.Message, *ffapi.FilterResult, error)
	GetMessagesWithData(ctx context.Context, filter ffapi.AndFilter) ([]*core.MessageInOut, *ffapi.FilterResult, error)
	GetMessageTransaction(ctx context.Context, id string) (*core.Transaction, error)
	GetMessageEvents(ctx context.Context, id string, filter ffapi.AndFilter) ([]*core.Event, *ffapi.FilterResult, error)
	GetMessageData(ctx context.Context, id string) (core.DataArray, error)
	GetMessagesForData(ctx context.Context, dataID string, filter ffapi.AndFilter) ([]*core.Message, *ffapi.FilterResult, error)
	GetBatchByID(ctx context.Context, id string) (*core.BatchPersisted, error)
	GetBatches(ctx context.Context, filter ffapi.AndFilter) ([]*core.BatchPersisted, *ffapi.FilterResult, error)
	GetDataByID(ctx context.Context, id string) (*core.Data, error)
	GetData(ctx context.Context, filter ffapi.AndFilter) (core.DataArray, *ffapi.FilterResult, error)
	GetDataSubPaths(ctx context.Context, path string) ([]string, error)
	GetDatatypeByID(ctx context.Context, id string) (*core.Datatype, error)
	GetDatatypeByName(ctx context.Context, name, version string) (*core.Datatype, error)
	GetDatatypes(ctx context.Context, filter ffapi.AndFilter) ([]*core.Datatype, *ffapi.FilterResult, error)
	GetOperationByID(ctx context.Context, id string) (*core.Operation, error)
	GetOperationByIDWithStatus(ctx context.Context, id string) (*core.OperationWithDetail, error)
	GetOperations(ctx context.Context, filter ffapi.AndFilter) ([]*core.Operation, *ffapi.FilterResult, error)
	GetEventByID(ctx context.Context, id string) (*core.Event, error)
	GetEventByIDWithReference(ctx context.Context, id string) (*core.EnrichedEvent, error)
	GetEvents(ctx context.Context, filter ffapi.AndFilter) ([]*core.Event, *ffapi.FilterResult, error)
	GetEventsWithReferences(ctx context.Context, filter ffapi.AndFilter) ([]*core.EnrichedEvent, *ffapi.FilterResult, error)
	GetBlockchainEventByID(ctx context.Context, id string) (*core.BlockchainEvent, error)
	GetBlockchainEvents(ctx context.Context, filter ffapi.AndFilter) ([]*core.BlockchainEvent, *ffapi.FilterResult, error)
	GetPins(ctx context.Context, filter ffapi.AndFilter) ([]*core.Pin, *ffapi.FilterResult, error)
	GetNextPins(ctx context.Context, filter ffapi.AndFilter) ([]*core.NextPin, *ffapi.FilterResult, error)
	RewindPins(ctx context.Context, rewind *core.PinRewind) (*core.PinRewind, error)

	// Charts
	GetChartHistogram(ctx context.Context, startTime int64, endTime int64, buckets int64, tableName database.CollectionName) ([]*core.ChartHistogram, error)

	// Message Routing
	RequestReply(ctx context.Context, msg *core.MessageInOut) (reply *core.MessageInOut, err error)

	// Network Operations
	SubmitNetworkAction(ctx context.Context, action *core.NetworkAction) error

	// Authorizer
	Authorize(ctx context.Context, authReq *fftypes.AuthReq) error
}

Orchestrator is the main interface behind the API, implementing the actions

func NewOrchestrator

func NewOrchestrator(ns *core.Namespace, config Config, plugins *Plugins, metrics metrics.Manager, cacheManager cache.Manager) Orchestrator

type Plugins added in v1.1.0

type Plugins struct {
	Blockchain    BlockchainPlugin
	Identity      IdentityPlugin
	SharedStorage SharedStoragePlugin
	DataExchange  DataExchangePlugin
	Database      DatabasePlugin
	Tokens        []TokensPlugin
	Events        map[string]eventsplugin.Plugin
	Auth          AuthPlugin
}

type SharedStoragePlugin added in v1.1.0

type SharedStoragePlugin struct {
	Name   string
	Plugin sharedstorage.Plugin
}

type TokensPlugin added in v1.1.0

type TokensPlugin struct {
	Name   string
	Plugin tokens.Plugin
}

Jump to

Keyboard shortcuts

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