-
Notifications
You must be signed in to change notification settings - Fork 95
RFC-0001: Rfc 0001 impl #1069
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
RFC-0001: Rfc 0001 impl #1069
Changes from 1 commit
5bca3f4
1baa216
aede594
b758ca7
5210f78
a65a7b3
437e691
95b0193
b601d9a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
- Loading branch information
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,27 @@ | ||||||
| package exporters | ||||||
|
|
||||||
| import "github.com/algorand/go-algorand/rpcs" | ||||||
|
|
||||||
| // ExporterConfig is a generic type providing serialization/deserialization for exporter config files | ||||||
| type ExporterConfig interface{} | ||||||
|
|
||||||
| // Exporter defines the interface for plugins | ||||||
| type Exporter interface { | ||||||
| // Connect will be called during initialization, before block data starts going through the pipeline. | ||||||
| // Typically used for things like initializing network connections. | ||||||
| // The ExporterConfig passed to Connect will contain the Unmarhsalled config file specific to this plugin. | ||||||
| // Should return an error if it fails--this will result in the Indexer process terminating. | ||||||
| Connect(cfg ExporterConfig) error | ||||||
|
|
||||||
| // Shutdown will be called during termination of the Indexer process. | ||||||
| // There is no guarantee that plugin lifecycle hooks will be invoked in any specific order in relation to one another. | ||||||
| // Returns an error if it fails which will be surfaced in the logs, but the process is already terminating. | ||||||
| Shutdown() error | ||||||
|
|
||||||
| // Receive is called for each block to be processed by the exporter. | ||||||
| // Should return an error on failure--retries are configurable. | ||||||
| Receive(blockData *rpcs.EncodedBlockCert) error | ||||||
|
||||||
| Receive(blockData *rpcs.EncodedBlockCert) error | |
| Receive(data ExportData) error |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I could be convinced otherwise, but I think this is a string.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ideally we would have some serde module fetching configs from disk. The objects fetched from disk may be strings, but then we're going to want to marshal them into an equivalent of
api.ExtraOptions, oridb.IndexerDbOptions.Once we've constructed those objects, we'll need to merge in/validate/override properties that were set via the command line. Then whatever is left should get passed into the Exporter.
Let me know what your thoughts are on the above process for resolving cfg values...I haven't done any serious work on the config parsing yet so maybe it is a string, but it seemed like it wouldn't be to me given the above framework.