diff --git a/schema/indexer/config.go b/schema/indexer/config.go index dcc6b9211792..2b2ea13485bd 100644 --- a/schema/indexer/config.go +++ b/schema/indexer/config.go @@ -10,32 +10,32 @@ package indexer // could result in an inconsistent state. type Config struct { // Type is the name of the indexer type as registered with Register. - Type string `json:"type"` + Type string `mapstructure:"type" toml:"type" json:"type" comment:"The name of the registered indexer type."` // Config are the indexer specific config options specified by the user. - Config interface{} `json:"config,omitempty"` + Config interface{} `mapstructure:"config" toml:"config" json:"config,omitempty" comment:"Indexer specific configuration options."` // Filter is the filter configuration for the indexer. - Filter *FilterConfig `json:"filter,omitempty"` + Filter *FilterConfig `mapstructure:"filter" toml:"filter" json:"filter,omitempty" comment:"Filter configuration for the indexer. Currently UNSUPPORTED!"` } // FilterConfig specifies the configuration for filtering the data stream type FilterConfig struct { // ExcludeState specifies that the indexer will not receive state updates. - ExcludeState bool `json:"exclude_state"` + ExcludeState bool `mapstructure:"exclude_state" toml:"exclude_state" json:"exclude_state" comment:"Exclude all state updates."` // ExcludeEvents specifies that the indexer will not receive events. - ExcludeEvents bool `json:"exclude_events"` + ExcludeEvents bool `mapstructure:"exclude_events" toml:"exclude_events" json:"exclude_events" comment:"Exclude all events."` // ExcludeTxs specifies that the indexer will not receive transaction's. - ExcludeTxs bool `json:"exclude_txs"` + ExcludeTxs bool `mapstructure:"exclude_txs" toml:"exclude_txs" json:"exclude_txs" comment:"Exclude all transactions."` // ExcludeBlockHeaders specifies that the indexer will not receive block headers, // although it will still receive StartBlock and Commit callbacks, just without // the header data. - ExcludeBlockHeaders bool `json:"exclude_block_headers"` + ExcludeBlockHeaders bool `mapstructure:"exclude_block_headers" toml:"exclude_block_headers" json:"exclude_block_headers" comment:"Exclude all block headers."` - Modules *ModuleFilterConfig `json:"modules"` + Modules *ModuleFilterConfig `mapstructure:"modules" toml:"modules" json:"modules,omitempty" comment:"Module filter configuration."` } // ModuleFilterConfig specifies the configuration for filtering modules. @@ -43,10 +43,10 @@ type ModuleFilterConfig struct { // Include specifies a list of modules whose state the indexer will // receive state updates for. // Only one of include or exclude modules should be specified. - Include []string `json:"include"` + Include []string `mapstructure:"include" toml:"include" json:"include" comment:"List of modules to include. Only one of include or exclude should be specified."` // Exclude specifies a list of modules whose state the indexer will not // receive state updates for. // Only one of include or exclude modules should be specified. - Exclude []string `json:"exclude"` + Exclude []string `mapstructure:"exclude" toml:"exclude" json:"exclude" comment:"List of modules to exclude. Only one of include or exclude should be specified."` }