config

package
v0.4.14 Latest Latest
Warning

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

Go to latest
Published: Apr 29, 2024 License: MIT Imports: 16 Imported by: 2

Documentation

Index

Constants

View Source
const (
	EnvPrefix = "NODE"

	Environment = "environment"

	EnvironmentDevelopment = "development"
	EnvironmentProduction  = "production"

	EnvironmentPyroscopeEndpoint = EnvPrefix + "_PYROSCOPE_ENDPOINT"
)

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"`
	Redis         *Redis     `mapstructure:"redis" 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      network.Network `mapstructure:"network" validate:"required"`
	Endpoint     string          `mapstructure:"endpoint" validate:"required"`
	IPFSGateways []string        `mapstructure:"ipfs_gateways"`
	Worker       worker.Worker   `mapstructure:"worker"`
	Parameters   *Parameters     `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 Parameters added in v0.4.13

type Parameters map[string]any

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 Redis added in v0.3.11

type Redis struct {
	Enable       *bool    `mapstructure:"enable" validate:"required" default:"false"`
	Endpoints    []string `mapstructure:"endpoints" default:"['localhost:6379']" validate:"required"`
	Username     string   `mapstructure:"username"`
	Password     string   `mapstructure:"password"`
	DisableCache bool     `mapstructure:"disable_cache" default:"true"`
	TLS          RedisTLS `mapstructure:"tls"`
}

type RedisTLS added in v0.3.11

type RedisTLS struct {
	Enabled            bool   `mapstructure:"enabled" default:"false"`
	CAFile             string `mapstructure:"ca_file"`
	CertFile           string `mapstructure:"cert_file"`
	KeyFile            string `mapstructure:"key_file"`
	InsecureSkipVerify bool   `mapstructure:"insecure_skip_verify" default:"false"`
}

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.activities"`
	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