Sergey Cherepanov 5d3e79e506
commonfile
2022-12-12 20:49:43 +03:00

27 lines
562 B
Go

package config
type NodeType string
const (
NodeTypeTree NodeType = "tree"
NodeTypeConsensus NodeType = "consensus"
NodeTypeFile NodeType = "file"
)
type Node struct {
PeerId string `yaml:"peerId"`
Address string `yaml:"address"`
SigningKey string `yaml:"signingKey,omitempty"`
EncryptionKey string `yaml:"encryptionKey,omitempty"`
Types []NodeType `yaml:"types,omitempty"`
}
func (n Node) HasType(t NodeType) bool {
for _, nt := range n.Types {
if nt == t {
return true
}
}
return false
}