Skip to content

Commit

Permalink
update struct tags
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronc committed Sep 17, 2024
1 parent 5459a26 commit c967f78
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions schema/indexer/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,43 +10,43 @@ 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.
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."`
}

0 comments on commit c967f78

Please sign in to comment.