Documentation ¶
Overview ¶
Package configuration holds configuration for all components in Insolar host binary It allows also helps to manage config resources using Holder
Usage:
package main import ( "github.com/insolar/assured-ledger/ledger-core/configuration" "fmt" ) func main() { holder := configuration.NewHolder("insolar.yml") holder.MustLoad() fmt.Printf("Default configuration:\n %+v\n", holder.Configuration) }
Index ¶
- Constants
- func ToString(in interface{}) string
- type APIRunner
- type AvailabilityChecker
- type BaseCloudConfig
- type CommonAppConfig
- type CommonConfig
- type Configuration
- type GoPlugin
- type HeavyNodeConfig
- type Holder
- type HostNetwork
- type Introspection
- type JaegerConfig
- type Ledger
- type LightNodeConfig
- type Log
- type LogicRunner
- type Metrics
- type NetworkConfig
- type Pulsar
- type PulsarConfiguration
- type PulsarNodeAddress
- type PulseDistributor
- type PulseWatcherConfig
- type PulseWatcherOutputFormat
- type ServiceNetwork
- type StringPathGetter
- type TestWalletAPI
- type Tracer
- type Transport
- type Virtual
- type VirtualNodeConfig
Constants ¶
const InsolarEnvPrefix = "insolar"
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIRunner ¶
type APIRunner struct { Address string RPC string // IsAdmin indicates status of api (internal or external) IsAdmin bool SwaggerPath string }
APIRunner holds configuration for api
type AvailabilityChecker ¶
type AvailabilityChecker struct { Enabled bool KeeperURL string RequestTimeout uint CheckPeriod uint }
AvailabilityChecker holds configuration for checking is network available for process API calls
func NewAvailabilityChecker ¶
func NewAvailabilityChecker() AvailabilityChecker
type BaseCloudConfig ¶
type BaseCloudConfig struct { Log Log PulsarConfiguration PulsarConfiguration NodeConfigPaths []string }
type CommonAppConfig ¶
type CommonAppConfig struct {
CommonConfig
}
type CommonConfig ¶
type CommonConfig struct { Log Log Metrics Metrics Tracer Tracer Introspection Introspection KeysPath string }
общий конфиг для Net и App в режиме full-node --single-process запускается один инстанс компонентов проблема идентичности CommonConfig в режиме full-node --independent. Решили дублировать эту секцию для Net и App, в режиме --single-process берется CommonConfig из секции Network
type Configuration ¶
type Configuration struct { Host HostNetwork Service ServiceNetwork Ledger Ledger Log Log Metrics Metrics LogicRunner LogicRunner Virtual Virtual APIRunner APIRunner AdminAPIRunner APIRunner TestWalletAPI TestWalletAPI AvailabilityChecker AvailabilityChecker KeysPath string CertificatePath string Tracer Tracer Introspection Introspection }
Configuration contains configuration params for all Insolar components
func NewConfiguration ¶
func NewConfiguration() Configuration
NewConfiguration creates new default configuration
type GoPlugin ¶
type GoPlugin struct { // RunnerListen - address Go plugins executor listens to RunnerListen string // RunnerProtocol - protocol (network) of above address, // e.g. "tcp", "unix"... see `net.Dial` RunnerProtocol string }
GoPlugin configuration
type HeavyNodeConfig ¶
type HeavyNodeConfig struct { CommonAppConfig LogicRunner LogicRunner }
type Holder ¶
type Holder struct { Configuration *Configuration Params insconfig.Params }
Holder provides methods to manage configuration
type HostNetwork ¶
type HostNetwork struct { Transport Transport MinTimeout int // bootstrap timeout min MaxTimeout int // bootstrap timeout max TimeoutMult int // bootstrap timout multiplier SignMessages bool // signing a messages if true HandshakeSessionTTL int32 // ms PulseWatchdogTimeout int32 // seconds }
HostNetwork holds configuration for HostNetwork
func NewHostNetwork ¶
func NewHostNetwork() HostNetwork
NewHostNetwork creates new default HostNetwork configuration
type Introspection ¶
type Introspection struct { // Addr specifies address where introspection server starts Addr string }
Introspection holds introspection configuration.
func NewIntrospection ¶
func NewIntrospection() Introspection
NewIntrospection creates new default configuration for introspection.
type JaegerConfig ¶
JaegerConfig holds Jaeger settings.
type Ledger ¶
type Ledger struct { // LightChainLimit is maximum pulse difference (NOT number of pulses) // between current and the latest replicated on heavy. // // IMPORTANT: It should be the same on ALL nodes. // deprecated LightChainLimit int }
Ledger holds configuration for ledger.
type LightNodeConfig ¶
type LightNodeConfig struct { CommonAppConfig LogicRunner LogicRunner }
type Log ¶
type Log struct { // Default level for logger Level string // Logging adapter - zerolog (json, text) or bilog (json, text, pbuf) Adapter string // Log output format - e.g. json or text Formatter string // Log output type - e.g. stderr, syslog OutputType string // Write-parallel limit for the output OutputParallelLimit string // Parameter for output - depends on OutputType OutputParams string // Number of regular log events that can be buffered, =0 to disable BufferSize int // Number of low-latency log events that can be buffered, =-1 to disable, =0 - default size LLBufferSize int }
Log holds configuration for logging
type LogicRunner ¶
type LogicRunner struct { // RPCListen - address logic runner binds RPC API to RPCListen string // RPCProtoco - protocol (network) of above address, // e.g. "tcp", "unix"... see `net.Dial` RPCProtocol string // GoPlugin - configuration of executor based on Go plugins GoPlugin *GoPlugin // PulseLRUSize - configuration of size of a pulse's cache PulseLRUSize int }
LogicRunner configuration
func NewLogicRunner ¶
func NewLogicRunner() LogicRunner
NewLogicRunner - returns default config of the logic runner
type Metrics ¶
type Metrics struct { ListenAddress string Namespace string ZpagesEnabled bool // ReportingPeriod defines exporter reporting period // if zero, exporter uses default value (1s) ReportingPeriod time.Duration }
Metrics holds configuration for metrics publishing.
func NewMetrics ¶
func NewMetrics() Metrics
NewMetrics creates new default configuration for metrics publishing.
type NetworkConfig ¶
type NetworkConfig struct { CommonConfig CertificatePath string Host HostNetwork Service ServiceNetwork }
type Pulsar ¶
type Pulsar struct { PulseTime int32 // ms NumberDelta uint32 DistributionTransport Transport PulseDistributor PulseDistributor }
Pulsar holds configuration for pulsar node.
type PulsarConfiguration ¶
type PulsarConfiguration struct { Log Log Pulsar Pulsar Tracer Tracer KeysPath string Metrics Metrics OneShot bool }
PulsarConfiguration contains configuration params for the pulsar node
func NewPulsarConfiguration ¶
func NewPulsarConfiguration() PulsarConfiguration
NewPulsarConfiguration creates new default configuration for pulsar
type PulsarNodeAddress ¶
type PulseDistributor ¶
type PulseWatcherConfig ¶
type PulseWatcherConfig struct { Nodes []string Interval time.Duration Timeout time.Duration Log Log Format PulseWatcherOutputFormat ShowEmoji bool OneShot bool }
func NewPulseWatcherConfiguration ¶
func NewPulseWatcherConfiguration() PulseWatcherConfig
type PulseWatcherOutputFormat ¶
type PulseWatcherOutputFormat string
const ( PulseWatcherOutputTxt PulseWatcherOutputFormat = "text" PulseWatcherOutputJSON PulseWatcherOutputFormat = "json" )
type ServiceNetwork ¶
type ServiceNetwork struct {
CacheDirectory string
}
ServiceNetwork is configuration for ServiceNetwork.
func NewServiceNetwork ¶
func NewServiceNetwork() ServiceNetwork
NewServiceNetwork creates a new ServiceNetwork configuration.
type StringPathGetter ¶
type StringPathGetter struct {
Path string
}
func (*StringPathGetter) GetConfigPath ¶
func (g *StringPathGetter) GetConfigPath() string
type TestWalletAPI ¶
type TestWalletAPI struct {
Address string
}
func NewTestWalletAPI ¶
func NewTestWalletAPI() TestWalletAPI
type Tracer ¶
type Tracer struct { Jaeger JaegerConfig // TODO: add SamplingRules configuration SamplingRules struct{} }
Tracer configures tracer.
type Transport ¶
type Transport struct { // protocol type Protocol string // Address to listen Address string // if not empty - this should be public address of instance (to connect from the "other" side to) FixedPublicAddress string }
Transport holds transport protocol configuration for HostNetwork
type Virtual ¶
type Virtual struct { // MaxRunners limits number of contract executions running in parallel. // If set to zero or a negative value, limit will be set automatically to // `( runtime.NumCPU() - 2 ) but not less then 4`. MaxRunners int }
Virtual holds configuration for virtual.
type VirtualNodeConfig ¶
type VirtualNodeConfig struct { CommonAppConfig LogicRunner LogicRunner Virtual Virtual }