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/insolar/configuration" "fmt" ) func main() { holder := configuration.NewHolder() fmt.Printf("Default configuration:\n %+v\n", holder.Configuration) holder.SaveAs("insolar.yml") }
Index ¶
- func ToString(in interface{}) string
- type APIRunner
- type Bootstrap
- type BuiltIn
- type Configuration
- type ConnectionType
- type GoPlugin
- type Holder
- type HostNetwork
- type JetCoordinator
- type Ledger
- type Log
- type LogicRunner
- type Metrics
- type Node
- type NodeNetwork
- type Pulsar
- type PulsarNodeAddress
- type Service
- type ServiceNetwork
- type Storage
- type Transport
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
Types ¶
type APIRunner ¶ added in v0.2.0
APIRunner holds configuration for api
func NewAPIRunner ¶ added in v0.2.0
func NewAPIRunner() APIRunner
NewAPIRunner creates new api config
type Bootstrap ¶ added in v0.5.0
func NewBootstrap ¶ added in v0.5.0
func NewBootstrap() Bootstrap
type Configuration ¶
type Configuration struct { Host HostNetwork Node NodeNetwork Service ServiceNetwork Ledger Ledger Log Log Metrics Metrics LogicRunner LogicRunner APIRunner APIRunner Pulsar Pulsar Bootstrap Bootstrap KeysPath string }
Configuration contains configuration params for all Insolar components
func NewConfiguration ¶
func NewConfiguration() Configuration
NewConfiguration creates new default configuration
type ConnectionType ¶ added in v0.3.0
type ConnectionType string
const (
TCP ConnectionType = "tcp"
)
func (ConnectionType) String ¶ added in v0.3.0
func (ct ConnectionType) String() string
type GoPlugin ¶ added in v0.0.6
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 Holder ¶
type Holder struct { Configuration Configuration // contains filtered or unexported fields }
Holder provides methods to manage configuration
func (*Holder) Init ¶ added in v0.3.0
Init init all configuration data from config file and environment.
Does not fail on not found config file if the 'required' flag set to false.
func (*Holder) LoadFromFile ¶
LoadFromFile method reads configuration from particular file path
func (*Holder) MustInit ¶ added in v0.3.0
MustInit wrapper around Init function which panics on error.
type HostNetwork ¶
type HostNetwork struct { Transport Transport BootstrapHosts []string IsRelay bool // set if node must be relay explicit InfinityBootstrap bool // set true for infinity tries to bootstrap Timeout int // bootstrap reconnect timeout MajorityRule int // MajorityRule number SignMessages bool // signing a messages if true }
HostNetwork holds configuration for HostNetwork
func NewHostNetwork ¶
func NewHostNetwork() HostNetwork
NewHostNetwork creates new default HostNetwork configuration
type JetCoordinator ¶ added in v0.2.0
JetCoordinator holds configuration for JetCoordinator.
type Ledger ¶
type Ledger struct { // Storage defines storage configuration. Storage Storage // JetCoordinator defines jet coordinator configuration. JetCoordinator JetCoordinator }
Ledger holds configuration for ledger.
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 // BuiltIn - configuration of builtin executor BuiltIn *BuiltIn // GoPlugin - configuration of executor based on Go plugins GoPlugin *GoPlugin }
LogicRunner configuration
func NewLogicRunner ¶
func NewLogicRunner() LogicRunner
NewLogicRunner - returns default config of the logic runner
type Metrics ¶ added in v0.2.0
type Metrics struct {
ListenAddress string
}
Metrics holds configuration for metrics publishing.
func NewMetrics ¶ added in v0.2.0
func NewMetrics() Metrics
NewMetrics creates new default configuration for metrics publishing.
type NodeNetwork ¶
type NodeNetwork struct {
Node *Node
}
NodeNetwork holds configuration for NodeNetwork
func NewNodeNetwork ¶
func NewNodeNetwork() NodeNetwork
NewNodeNetwork creates new default NodeNetwork configuration
type Pulsar ¶ added in v0.0.6
type Pulsar struct { ConnectionType ConnectionType MainListenerAddress string Storage Storage PulseTime int32 // ms ReceivingSignTimeout int32 // ms ReceivingNumberTimeout int32 // ms ReceivingVectorTimeout int32 // ms ReceivingSignsForChosenTimeout int32 // ms Neighbours []PulsarNodeAddress NumberOfRandomHosts int NumberDelta uint32 BootstrapListener Transport BootstrapNodes []string }
Pulsar holds configuration for pulsar node.
type PulsarNodeAddress ¶ added in v0.3.0
type PulsarNodeAddress struct { Address string ConnectionType ConnectionType PublicKey string }
type ServiceNetwork ¶
type ServiceNetwork struct {
Service Service
}
ServiceNetwork is configuration for ServiceNetwork.
func NewServiceNetwork ¶
func NewServiceNetwork() ServiceNetwork
NewServiceNetwork creates a new ServiceNetwork configuration.
type Storage ¶ added in v0.2.0
type Storage struct { // DataDirectory is a directory where database's files live. DataDirectory string // TxRetriesOnConflict defines how many retries on transaction conflicts // storage update methods should do. TxRetriesOnConflict int }
Storage configures Ledger's storage.