Documentation ¶
Index ¶
- Constants
- func CalculateComponentCount(config *File) int
- func CalculateWorkerCount(config *File) int
- func EvmAddressHookFunc() mapstructure.DecodeHookFuncType
- func HasOneWorker(config *File) error
- func IsRSSComponentOnly(config *File) bool
- type Component
- type Database
- type Discovery
- type Endpoint
- type File
- type Module
- type OpenTelemetryConfig
- type OpenTelemetryMetricsConfig
- type OpenTelemetryTracesConfig
- type Operator
- type Parameters
- type Redis
- type RedisTLS
- type Server
- type Stream
- type Telemetry
Constants ¶
View Source
const ( EnvPrefix = "NODE" Environment = "environment" EnvironmentDevelopment = "development" EnvironmentProduction = "production" EnvironmentPyroscopeEndpoint = EnvPrefix + "_PYROSCOPE_ENDPOINT" )
Variables ¶
This section is empty.
Functions ¶
func CalculateComponentCount ¶ added in v1.1.2
CalculateComponentCount returns the number of components deployed
func CalculateWorkerCount ¶ added in v1.1.2
CalculateWorkerCount returns the number of workers deployed
func EvmAddressHookFunc ¶
func EvmAddressHookFunc() mapstructure.DecodeHookFuncType
func HasOneWorker ¶ added in v1.1.2
HasOneWorker Check if there is at least one worker deployed
func IsRSSComponentOnly ¶ added in v1.1.2
IsRSSComponentOnly Check if the configuration contains an RSS component only
Types ¶
type Database ¶
type Database struct { CoveragePeriod int `mapstructure:"coverage_period" validate:"min=3,max=12" default:"3"` Driver database.Driver `mapstructure:"driver" validate:"required" default:"postgres"` Partition *bool `mapstructure:"partition" validate:"required" default:"true"` URI string `mapstructure:"uri" validate:"required" default:"postgres://postgres@localhost:5432/postgres"` }
type Endpoint ¶ added in v0.4.20
type Endpoint struct { URL string `mapstructure:"url"` HTTPHeaders map[string]string `mapstructure:"http_headers"` HTTP2Disabled bool `mapstructure:"http2_disabled"` }
func (Endpoint) BuildEthereumOptions ¶ added in v0.4.20
BuildEthereumOptions builds the custom options to be supplied to an ethereum client.
type File ¶
type File struct { Environment string `mapstructure:"environment" validate:"required" default:"development"` Endpoints map[string]Endpoint `mapstructure:"endpoints"` Discovery *Discovery `mapstructure:"discovery" validate:"required"` Component *Component `mapstructure:"component" validate:"required"` Database *Database `mapstructure:"database" validate:"required"` Stream *Stream `mapstructure:"stream"` Redis *Redis `mapstructure:"redis"` Observability *Telemetry `mapstructure:"observability"` }
func (*File) LoadModulesEndpoint ¶ added in v0.4.20
LoadModulesEndpoint loads the endpoint url and headers for each module. If the endpoint id is not found in the endpoints list, it will use the endpoint id as the url.
type Module ¶
type Module struct { ID string `mapstructure:"id"` Network network.Network `mapstructure:"network" validate:"required"` EndpointID string `mapstructure:"endpoint"` IPFSGateways []string `mapstructure:"ipfs_gateways"` Worker worker.Worker `mapstructure:"worker"` Parameters *Parameters `mapstructure:"parameters"` Endpoint Endpoint `mapstructure:"-"` }
type OpenTelemetryConfig ¶
type OpenTelemetryConfig struct { Metrics *OpenTelemetryMetricsConfig `mapstructure:"metrics" validate:"required"` Traces *OpenTelemetryTracesConfig `mapstructure:"traces" validate:"required"` }
type Parameters ¶ added in v0.4.13
func (*Parameters) Decode ¶ added in v0.4.13
func (p *Parameters) Decode(v interface{}) error
func (*Parameters) String ¶ added in v0.4.13
func (p *Parameters) String() string
type Stream ¶
type Stream struct { Enable *bool `mapstructure:"enable" validate:"required" default:"false"` Driver stream.Driver `mapstructure:"driver" validate:"required" default:"kafka"` Topic string `mapstructure:"topic" validate:"required" default:"rss3.node.activities"` URI string `mapstructure:"uri" validate:"required" default:"localhost:9092"` }
type Telemetry ¶
type Telemetry struct {
OpenTelemetry *OpenTelemetryConfig `mapstructure:"opentelemetry" validate:"required"`
}
Click to show internal directories.
Click to hide internal directories.