config

package
v0.2.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 7, 2024 License: MIT Imports: 15 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EnvPrefix = "NODE"

	Environment = "environment"

	EnvironmentDevelopment = "development"
	EnvironmentProduction  = "production"
)

Variables

This section is empty.

Functions

func EvmAddressHookFunc

func EvmAddressHookFunc() mapstructure.DecodeHookFuncType

Types

type Database

type Database struct {
	Driver    database.Driver `mapstructure:"driver" validate:"required" default:"cockroachdb"`
	Partition *bool           `mapstructure:"partition" validate:"required" default:"true"`
	URI       string          `mapstructure:"uri" validate:"required" default:"postgres://root@localhost:26257/defaultdb"`
}

type Discovery

type Discovery struct {
	Maintainer *Maintainer `mapstructure:"maintainer"`
	Server     *Server     `mapstructure:"server"`
}

type File

type File struct {
	Environment   string     `mapstructure:"environment" validate:"required" default:"development"`
	Discovery     *Discovery `mapstructure:"discovery" validate:"required"`
	Node          *Node      `mapstructure:"component" validate:"required"`
	Database      *Database  `mapstructure:"database" validate:"required"`
	Stream        *Stream    `mapstructure:"stream" validate:"required"`
	Observability *Telemetry `mapstructure:"observability" validate:"required"`
}

func Setup

func Setup(configName string) (*File, error)

type Maintainer

type Maintainer struct {
	EvmAddress common.Address `mapstructure:"evm_address"`
	Signature  string         `mapstructure:"signature"`
}

type Module

type Module struct {
	Network      filter.Network `mapstructure:"network" validate:"required"`
	Endpoint     string         `mapstructure:"endpoint" validate:"required"`
	IPFSGateways []string       `mapstructure:"ipfs_gateways"`
	Worker       filter.Name    `mapstructure:"worker"`
	Parameters   *Options       `mapstructure:"parameters"`
}

func (*Module) ID

func (c *Module) ID() string

ID returns the unique identifier of the configuration.

type Node

type Node struct {
	RSS           []*Module `mapstructure:"rss" validate:"dive"`
	Federated     []*Module `mapstructure:"federated" validate:"dive"`
	Decentralized []*Module `mapstructure:"decentralized" validate:"dive"`
}

type OpenTelemetryConfig

type OpenTelemetryConfig struct {
	Metrics *OpenTelemetryMetricsConfig `mapstructure:"metrics" validate:"required"`
	Traces  *OpenTelemetryTracesConfig  `mapstructure:"traces" validate:"required"`
}

type OpenTelemetryMetricsConfig

type OpenTelemetryMetricsConfig struct {
	Enable   bool   `mapstructure:"enable" default:"false"`
	Endpoint string `mapstructure:"endpoint" default:"0.0.0.0:9090"`
}

type OpenTelemetryTracesConfig

type OpenTelemetryTracesConfig struct {
	Enable   bool   `mapstructure:"enable" default:"false"`
	Insecure bool   `mapstructure:"insecure" default:"false"`
	Endpoint string `mapstructure:"endpoint" validate:"required" default:"0.0.0.0:4318"`
}

type Options

type Options map[string]any

func (*Options) Decode

func (o *Options) Decode(v interface{}) error

func (*Options) String

func (o *Options) String() string

type Server

type Server struct {
	Endpoint              string `mapstructure:"endpoint"`
	GlobalIndexerEndpoint string `mapstructure:"global_indexer_endpoint"`
}

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.feeds"`
	URI    string        `mapstructure:"uri" validate:"required" default:"localhost:9092"`
}

type Telemetry

type Telemetry struct {
	OpenTelemetry *OpenTelemetryConfig `mapstructure:"opentelemetry" validate:"required"`
}

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL