libs5-go/config/config.go

34 lines
674 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 {
P2P P2PConfig
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-01-10 14:35:47 +00:00
HTTP HTTPConfig
2024-01-06 11:33:46 +00:00
}
type P2PConfig struct {
2024-02-23 12:23:33 +00:00
Network string `mapstructure:"network"`
Peers PeersConfig
2024-02-23 12:23:33 +00:00
MaxOutgoingPeerFailures uint `mapstructure:"max_outgoing_peer_failures"`
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 {
API HTTPAPIConfig
}