{"modulePath":"github.com/GoPlugin/pluginV2Lib/pluginV2-relay","version":"v0.0.0-20230622090102-3f0f60f3c385","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package monitoring\n\nThis file contains data generators and utilities to simplify tests. The data generated here shouldn't be used to run OCR instances\n\n## Variables\n\n```go\nvar (\n\t// Avro schemas to sync with the registry\n\tTransmissionAvroSchema        string\n\tConfigSetSimplifiedAvroSchema string\n)\n```\n\n```go\nvar (\n\t// ErrNoUpdate is an error value interpreted by a Poller to mean that the\n\t// Fetch() was successful but a new value was not found.\n\t// The pollers will not report this as an error!\n\tErrNoUpdate = errors.New(\"no updates found\")\n)\n```\n\n## Functions\n\n```go\nfunc MakeConfigSetSimplifiedMapping(\n\tenvelope Envelope,\n\t_ ChainConfig,\n\tfeedConfig FeedConfig,\n) (map[string]interface{}, error)\n```\n\n```go\nfunc MakeTransmissionMapping(\n\tenvelope Envelope,\n\tchainConfig ChainConfig,\n\tfeedConfig FeedConfig,\n) (map[string]interface{}, error)\n```\n\n```go\nfunc SubjectFromTopic(topic string) string\n```\nSubjectFromTopic computes the associated AVRO schema subject name from a kafka topic name.\n\n## Types\n\n```go\ntype ChainConfig interface {\n\tGetRPCEndpoint() string\n\tGetNetworkName() string\n\tGetNetworkID() string\n\tGetChainID() string\n\tGetReadTimeout() time.Duration\n\tGetPollInterval() time.Duration\n\t// Useful for serializing to avro.\n\t// Check the latest version of the transmission schema to see what the exact return format should be.\n\tToMapping() map[string]interface{}\n}\n```\nChainConfig contains chain-specific configuration. It is an interface so that implementations can add extra fields as long as they provide data from these methods which are required by the framework.\n\n```go\ntype ChainMetrics interface {\n\tSetNewFeedConfigsDetected(numFeeds float64)\n\n\tIncSendMessageToKafkaFailed(topic string)\n\tIncSendMessageToKafkaSucceeded(topic string)\n\tAddSendMessageToKafkaBytes(bytes float64, topic string)\n}\n```\n\n```go\nfunc NewChainMetrics(chainConfig ChainConfig) ChainMetrics\n```\n\n```go\ntype Envelope struct {\n\t// latest transmission details\n\tConfigDigest    types.ConfigDigest\n\tEpoch           uint32\n\tRound           uint8\n\tLatestAnswer    *big.Int\n\tLatestTimestamp time.Time\n\n\t// latest contract config\n\tContractConfig types.ContractConfig\n\n\t// extra\n\tBlockNumber             uint64\n\tTransmitter             types.Account\n\tLinkBalance             *big.Int\n\tLinkAvailableForPayment *big.Int\n\n\t// The \"fee coin\" is different for each chain.\n\tJuelsPerFeeCoin   *big.Int\n\tAggregatorRoundID uint32\n}\n```\nEnvelope contains data that is required from all the chain integrations. Integrators usually create an EnvelopeSource to produce Envelope instances.\n\n```go\ntype Exporter interface {\n\t// Export is executed on each update on a monitored feed\n\tExport(ctx context.Context, data interface{})\n\t// Cleanup is executed once a monitor for a specific feed is terminated.\n\tCleanup(ctx context.Context)\n}\n```\nExporter methods can be executed out of order and should be thread safe.\n\n```go\ntype ExporterFactory interface {\n\tNewExporter(ExporterParams) (Exporter, error)\n}\n```\nExporterFactory is used to create a new exporter for each feed that needs to be monitored.\n\n```go\nfunc NewKafkaExporterFactory(\n\tlog Logger,\n\tproducer Producer,\n\tpipelines []Pipeline,\n) (ExporterFactory, error)\n```\nNewKafkaExporterFactory produces Kafka exporters which consume, format and publish source outputs to kafka.\n\n```go\nfunc NewPrometheusExporterFactory(\n\tlog Logger,\n\tmetrics Metrics,\n) ExporterFactory\n```\n\n```go\ntype ExporterFactoryMock struct {\n\tmock.Mock\n}\n```\nExporterFactoryMock is an autogenerated mock type for the ExporterFactory type\n\n```go\nfunc (_m *ExporterFactoryMock) NewExporter(_a0 ExporterParams) (Exporter, error)\n```\nNewExporter provides a mock function with given fields: \\_a0\n\n```go\ntype ExporterMock struct {\n\tmock.Mock\n}\n```\nExporterMock is an autogenerated mock type for the Exporter type\n\n```go\nfunc (_m *ExporterMock) Cleanup(ctx context.Context)\n```\nCleanup provides a mock function with given fields: ctx\n\n```go\nfunc (_m *ExporterMock) Export(ctx context.Context, data interface{})\n```\nExport provides a mock function with given fields: ctx, data\n\n```go\ntype ExporterParams struct {\n\tChainConfig ChainConfig\n\tFeedConfig  FeedConfig\n\tNodes       []NodeConfig\n}\n```\n\n```go\ntype FeedConfig interface {\n\t// This functions as a feed identifier.\n\tGetID() string\n\tGetName() string\n\tGetPath() string\n\tGetSymbol() string\n\tGetHeartbeatSec() int64\n\tGetContractType() string\n\tGetContractStatus() string\n\tGetContractAddress() string\n\tGetContractAddressBytes() []byte\n\t// GetMultiply() returns the multiply parameter of a feed.\n\t// This is a misnomer kept for historical reasons. Multiply is used as divisor\n\t// for the big integers read from on-chain - think balances, observations,\n\t// etc. - into prometheus-friendly float64s.\n\tGetMultiply() *big.Int\n\t// ToMapping() is useful when encoding kafka messages.\n\tToMapping() map[string]interface{}\n}\n```\nFeedConfig is the interface for feed configurations extracted from the RDD. Implementation can add more fields as needed, but this subset is required by the framework.\n\n```go\ntype FeedMetrics interface {\n\tIncFetchFromSourceFailed(sourceName string)\n\tIncFetchFromSourceSucceeded(sourceName string)\n\tObserveFetchFromSourceDuraction(duration time.Duration, sourceName string)\n}\n```\n\n```go\nfunc NewFeedMetrics(chainConfig ChainConfig, feedConfig FeedConfig) FeedMetrics\n```\n\n```go\ntype FeedMonitor interface {\n\tRun(ctx context.Context)\n}\n```\n\n```go\nfunc NewFeedMonitor(\n\tlog Logger,\n\tpollers []Poller,\n\texporters []Exporter,\n) FeedMonitor\n```\n\n```go\ntype FeedsParser func(buf io.ReadCloser) ([]FeedConfig, error)\n```\nFeedParser is the interface for deserializing feed configuration data for each chain integration.\n\n```go\ntype HTTPServer interface {\n\tHandle(path string, handler http.Handler)\n\tRun(ctx context.Context)\n}\n```\nHTTPServer is the HTTP interface exposed by every monitoring. It's used to export metrics to prometheus, to query the node for configurations, etc.\n\n```go\nfunc NewHTTPServer(baseCtx context.Context, addr string, log Logger) HTTPServer\n```\n\n```go\ntype Logger = logger.Logger\n```\nLogger is a type alias for backwards compatibility.\n\n```go\ntype ManagedFunc func(localCtx context.Context, data RDDData)\n```\n\n```go\ntype Manager interface {\n\tRun(backgroundCtx context.Context, managed ManagedFunc)\n\tHTTPHandler() http.Handler\n}\n```\nManager restarts the multi-feed monitor whenever the feed configuration list has changed. In order to not be coupled with the MultiFeedMonitor component, it simply runs a function every time the feed configuration has changed. This is hooked up to the MultiFeedMonitor.Run method in the Monitor.\n\n```go\nfunc NewManager(\n\tlog Logger,\n\trddPoller Poller,\n) Manager\n```\n\n```go\ntype Mapper func(Envelope, ChainConfig, FeedConfig) (map[string]interface{}, error)\n```\nMapper is an interface for converting Envelopes into data structures that can be encoded in AVRO and sent to Kafka.\n\n```go\ntype Metrics interface {\n\tSetHeadTrackerCurrentHead(blockNumber float64, networkName, chainID, networkID string)\n\tSetFeedContractMetadata(chainID, contractAddress, feedID, contractStatus, contractType, feedName, feedPath, networkID, networkName, symbol string)\n\tSetFeedContractLinkBalance(balance float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetLinkAvailableForPayment(amount float64, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetFeedContractTransactionsSucceeded(numSucceeded float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetFeedContractTransactionsFailed(numFailed float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetNodeMetadata(chainID, networkID, networkName, oracleName, sender string)\n\t// Deprecated: use SetOffchainAggregatorAnswers\n\tSetOffchainAggregatorAnswersRaw(answer float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorAnswers(answer float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tIncOffchainAggregatorAnswersTotal(contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\t// Deprecated: use SetOffchainAggregatorJuelsPerFeeCoin\n\tSetOffchainAggregatorJuelsPerFeeCoinRaw(juelsPerFeeCoin float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorJuelsPerFeeCoin(juelsPerFeeCoin float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorSubmissionReceivedValues(value float64, contractAddress, feedID, sender, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorJuelsPerFeeCoinReceivedValues(value float64, contractAddress, feedID, sender, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorAnswerStalled(isSet bool, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\tSetOffchainAggregatorRoundID(aggregatorRoundID float64, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName string)\n\t// Cleanup deletes all the metrics\n\tCleanup(networkName, networkID, chainID, oracleName, sender, feedName, feedPath, symbol, contractType, contractStatus, contractAddress, feedID string)\n\t// Exposes the accumulated metrics to HTTP in the prometheus format, ready for scraping.\n\tHTTPHandler() http.Handler\n}\n```\nMetrics is a thin interface on top of the prometheus API. As such there should be little logic in the implementation of these methods.\n\n```go\nfunc NewMetrics(log Logger) Metrics\n```\n\n```go\ntype MetricsMock struct {\n\tmock.Mock\n}\n```\nMetricsMock is an autogenerated mock type for the Metrics type\n\n```go\nfunc (_m *MetricsMock) Cleanup(networkName string, networkID string, chainID string, oracleName string, sender string, feedName string, feedPath string, symbol string, contractType string, contractStatus string, contractAddress string, feedID string)\n```\nCleanup provides a mock function with given fields: networkName, networkID, chainID, oracleName, sender, feedName, feedPath, symbol, contractType, contractStatus, contractAddress, feedID\n\n```go\nfunc (_m *MetricsMock) HTTPHandler() http.Handler\n```\nHTTPHandler provides a mock function with given fields:\n\n```go\nfunc (_m *MetricsMock) IncOffchainAggregatorAnswersTotal(contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nIncOffchainAggregatorAnswersTotal provides a mock function with given fields: contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetFeedContractLinkBalance(balance float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetFeedContractLinkBalance provides a mock function with given fields: balance, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetFeedContractMetadata(chainID string, contractAddress string, feedID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string, symbol string)\n```\nSetFeedContractMetadata provides a mock function with given fields: chainID, contractAddress, feedID, contractStatus, contractType, feedName, feedPath, networkID, networkName, symbol\n\n```go\nfunc (_m *MetricsMock) SetFeedContractTransactionsFailed(numFailed float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetFeedContractTransactionsFailed provides a mock function with given fields: numFailed, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetFeedContractTransactionsSucceeded(numSucceeded float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetFeedContractTransactionsSucceeded provides a mock function with given fields: numSucceeded, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetHeadTrackerCurrentHead(blockNumber float64, networkName string, chainID string, networkID string)\n```\nSetHeadTrackerCurrentHead provides a mock function with given fields: blockNumber, networkName, chainID, networkID\n\n```go\nfunc (_m *MetricsMock) SetLinkAvailableForPayment(amount float64, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetLinkAvailableForPayment provides a mock function with given fields: amount, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetNodeMetadata(chainID string, networkID string, networkName string, oracleName string, sender string)\n```\nSetNodeMetadata provides a mock function with given fields: chainID, networkID, networkName, oracleName, sender\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorAnswerStalled(isSet bool, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorAnswerStalled provides a mock function with given fields: isSet, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorAnswers(answer float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorAnswers provides a mock function with given fields: answer, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorAnswersRaw(answer float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorAnswersRaw provides a mock function with given fields: answer, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorJuelsPerFeeCoin(juelsPerFeeCoin float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorJuelsPerFeeCoin provides a mock function with given fields: juelsPerFeeCoin, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorJuelsPerFeeCoinRaw(juelsPerFeeCoin float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorJuelsPerFeeCoinRaw provides a mock function with given fields: juelsPerFeeCoin, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorJuelsPerFeeCoinReceivedValues(value float64, contractAddress string, feedID string, sender string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorJuelsPerFeeCoinReceivedValues provides a mock function with given fields: value, contractAddress, feedID, sender, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorRoundID(aggregatorRoundID float64, contractAddress string, feedID string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorRoundID provides a mock function with given fields: aggregatorRoundID, contractAddress, feedID, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\nfunc (_m *MetricsMock) SetOffchainAggregatorSubmissionReceivedValues(value float64, contractAddress string, feedID string, sender string, chainID string, contractStatus string, contractType string, feedName string, feedPath string, networkID string, networkName string)\n```\nSetOffchainAggregatorSubmissionReceivedValues provides a mock function with given fields: value, contractAddress, feedID, sender, chainID, contractStatus, contractType, feedName, feedPath, networkID, networkName\n\n```go\ntype Monitor struct {\n\tRootContext context.Context\n\n\tChainConfig ChainConfig\n\tConfig      config.Config\n\n\tLog            Logger\n\tProducer       Producer\n\tMetrics        Metrics\n\tChainMetrics   ChainMetrics\n\tSchemaRegistry SchemaRegistry\n\n\tSourceFactories   []SourceFactory\n\tExporterFactories []ExporterFactory\n\n\tRDDSource Source\n\tRDDPoller Poller\n\n\tManager Manager\n\n\tHTTPServer HTTPServer\n}\n```\nMonitor is the entrypoint for an on-chain monitor integration. Monitors should only be created via NewMonitor()\n\n```go\nfunc NewMonitor(\n\trootCtx context.Context,\n\tlog Logger,\n\tchainConfig ChainConfig,\n\tenvelopeSourceFactory SourceFactory,\n\ttxResultsSourceFactory SourceFactory,\n\tfeedsParser FeedsParser,\n\tnodesParser NodesParser,\n) (*Monitor, error)\n```\nNewMonitor builds a new Monitor instance using dependency injection. If advanced configurations of the Monitor are required - for instance, adding a custom third party service to send data to - this method should provide a good starting template to do that.\n\n```go\nfunc (m Monitor) Run()\n```\nRun() starts all the goroutines needed by a Monitor. The lifecycle of these routines is controlled by the context passed to the NewMonitor constructor.\n\n```go\ntype MultiFeedMonitor interface {\n\tRun(ctx context.Context, data RDDData)\n}\n```\nMultiFeedMonitor manages the flow of data from multiple sources to multiple exporters for each feed in the configuration.\n\n```go\nfunc NewMultiFeedMonitor(\n\tchainConfig ChainConfig,\n\tlog Logger,\n\n\tsourceFactories []SourceFactory,\n\texporterFactories []ExporterFactory,\n\n\tbufferCapacity uint32,\n) MultiFeedMonitor\n```\n\n```go\ntype NodeConfig interface {\n\tGetName() string\n\tGetAccount() types.Account\n}\n```\nNodeConfig is the subset of on-chain node operator's configuration required by the OM framework.\n\n```go\ntype NodesParser func(buf io.ReadCloser) ([]NodeConfig, error)\n```\nNodesParser extracts multiple nodes' configurations from the configuration server, eg. weiwatchers.com\n\n```go\ntype Pipeline struct {\n\tTopic  string\n\tMapper Mapper\n\tSchema Schema\n}\n```\nPipeline represents a succession of transformations on the data coming from a source: source output -\u003e adapt to a map -\u003e encode to AVRO -\u003e send to Kafka\n\n```go\ntype Poller interface {\n\tUpdater // Poller is just another name for updater.\n}\n```\nPoller implements Updater by periodically invoking a Source's Fetch() method.\n\n```go\nfunc NewSourcePoller(\n\tsource Source,\n\tlog Logger,\n\tpollInterval time.Duration,\n\tfetchTimeout time.Duration,\n\tbufferCapacity uint32,\n) Poller\n```\nNewSourcePoller builds Pollers for Sources. If the Source's Fetch() returns an error it will be reported. If it panics, the panic will be recovered and reported as an error and the program will resume operation. If the error is ErrNoUpdate, it will not be reported and the Poller will skip this round.\n\n```go\ntype Producer interface {\n\tProduce(key, value []byte, topic string) error\n}\n```\nProducer is an abstraction on top of Kafka to aid with tests.\n\n```go\nfunc NewInstrumentedProducer(producer Producer, chainMetrics ChainMetrics) Producer\n```\n\n```go\nfunc NewProducer(ctx context.Context, log Logger, cfg config.Kafka) (Producer, error)\n```\n\n```go\ntype RDDData struct {\n\tFeeds []FeedConfig `json:\"feeds,omitempty\"`\n\tNodes []NodeConfig `json:\"nodes,omitempty\"`\n}\n```\n\n```go\ntype Schema interface {\n\tID() int\n\tVersion() int\n\tSubject() string\n\tEncode(interface{}) ([]byte, error)\n\tDecode([]byte) (interface{}, error)\n}\n```\nSchema is an interface for encoding/decoding data structures into the AVRO format. The data structures need to conform with a predefined AVRO schema, encoding will fail otherwise. The schemas are maintained in a central repository called a \\[schema registry]([https://github.com/confluentinc/schema-registry](https://github.com/confluentinc/schema-registry))\n\n```go\ntype SchemaRegistry interface {\n\t// EnsureSchema handles three cases when pushing a schema spec to the SchemaRegistry:\n\t// 1. when the schema with a given subject does not exist, it will create it.\n\t// 2. if a schema with the given subject already exists but the spec is different, it will update it and bump the version.\n\t// 3. if the schema exists and the spec is the same, it will not do anything.\n\tEnsureSchema(subject, spec string) (Schema, error)\n}\n```\n\n```go\nfunc NewSchemaRegistry(cfg config.SchemaRegistry, log Logger) SchemaRegistry\n```\n\n```go\ntype Source interface {\n\t// Fetch must be thread-safe!\n\t// There is no guarantee on the ordering of Fetch() calls for the same source instance.\n\tFetch(context.Context) (interface{}, error)\n}\n```\nSource is an abstraction for reading data from a remote API, usually a chain RPC endpoint.\n\n```go\nfunc NewFakeRDDSource(minFeeds, maxFeeds uint8) Source\n```\n\n```go\nfunc NewRDDSource(\n\tfeedsURL string,\n\tfeedsParser FeedsParser,\n\tfeedsIgnoreIDs []string,\n\tnodesURL string,\n\tnodesParser NodesParser,\n\tlog Logger,\n) Source\n```\n\n```go\ntype SourceFactory interface {\n\tNewSource(chainConfig ChainConfig, feedConfig FeedConfig) (Source, error)\n\t// GetType should return a namespace for all the source instances produced by this factory.\n\tGetType() string\n}\n```\n\n```go\nfunc NewInstrumentedSourceFactory(sourceFactory SourceFactory, chainMetrics ChainMetrics) SourceFactory\n```\nNewInstrumentedSourceFactory wraps a Source and transparently monitors it.\n\n```go\ntype SourceFactoryMock struct {\n\tmock.Mock\n}\n```\nSourceFactoryMock is an autogenerated mock type for the SourceFactory type\n\n```go\nfunc (_m *SourceFactoryMock) GetType() string\n```\nGetType provides a mock function with given fields:\n\n```go\nfunc (_m *SourceFactoryMock) NewSource(chainConfig ChainConfig, feedConfig FeedConfig) (Source, error)\n```\nNewSource provides a mock function with given fields: chainConfig, feedConfig\n\n```go\ntype SourceMock struct {\n\tmock.Mock\n}\n```\nSourceMock is an autogenerated mock type for the Source type\n\n```go\nfunc (_m *SourceMock) Fetch(_a0 context.Context) (interface{}, error)\n```\nFetch provides a mock function with given fields: \\_a0\n\n```go\ntype TxResults struct {\n\tNumSucceeded, NumFailed uint64\n}\n```\nTxResults counts the number of successful and failed transactions in a predetermined window of time. Integrators usually create an TxResultsSource to produce TxResults instances.\n\n```go\ntype Updater interface {\n\t// Run should be executed as a goroutine otherwise it will block.\n\tRun(context.Context)\n\t// You should never close the channel returned by Updates()!\n\t// You should always read from the channel returned by Updates() in a\n\t// select statement with the same context you passed to Run()\n\tUpdates() \u003c-chan interface{}\n}\n```\nUpdater is a generic interface implemented by either polling or subscribing.\n\n","path":"github.com/GoPlugin/pluginV2Lib/pluginV2-relay/pkg/monitoring","name":"monitoring","synopsis":"This file contains data generators and utilities to simplify tests.","isRedistributable":true}
