libs5-go/config/config.go

35 lines
851 B
Go
Raw Normal View History

package config
2024-01-06 11:33:46 +00:00
import (
"git.lumeweb.com/LumeWeb/libs5-go/ed25519"
bolt "go.etcd.io/bbolt"
"go.uber.org/zap"
)
type NodeConfig struct {
2024-02-27 08:11:00 +00:00
P2P P2PConfig `mapstructure:"p2p"`
2024-01-06 18:15:29 +00:00
KeyPair *ed25519.KeyPairEd25519
DB *bolt.DB
2024-01-06 11:33:46 +00:00
Logger *zap.Logger
2024-02-27 08:11:00 +00:00
HTTP HTTPConfig `mapstructure:"http"`
2024-01-06 11:33:46 +00:00
}
type P2PConfig struct {
2024-02-27 08:11:00 +00:00
Network string `mapstructure:"network"`
Peers PeersConfig `mapstructure:"peers"`
MaxOutgoingPeerFailures uint `mapstructure:"max_outgoing_peer_failures"`
MaxConnectionAttempts uint `mapstructure:"max_connection_attempts"`
2024-01-06 11:33:46 +00:00
}
type PeersConfig struct {
2024-02-23 12:23:33 +00:00
Initial []string `mapstructure:"initial"`
2024-01-06 11:33:46 +00:00
}
2024-01-10 14:35:47 +00:00
type HTTPAPIConfig struct {
2024-02-23 12:23:33 +00:00
Domain string `mapstructure:"domain"`
Port uint `mapstructure:"port"`
2024-01-10 14:35:47 +00:00
}
type HTTPConfig struct {
2024-02-27 08:11:00 +00:00
API HTTPAPIConfig `mapstructure:"api"`
2024-01-10 14:35:47 +00:00
}