storage/memorybysubnet: clarify subnet bits _set_
This commit is contained in:
parent
9ce6c31021
commit
370004a9f5
1 changed files with 7 additions and 7 deletions
|
@ -73,11 +73,11 @@ var ErrInvalidGCInterval = errors.New("invalid garbage collection interval")
|
||||||
|
|
||||||
// Config holds the configuration of a memory PeerStore.
|
// Config holds the configuration of a memory PeerStore.
|
||||||
type Config struct {
|
type Config struct {
|
||||||
GarbageCollectionInterval time.Duration `yaml:"gc_interval"`
|
GarbageCollectionInterval time.Duration `yaml:"gc_interval"`
|
||||||
PeerLifetime time.Duration `yaml:"peer_lifetime"`
|
PeerLifetime time.Duration `yaml:"peer_lifetime"`
|
||||||
ShardCount int `yaml:"shard_count"`
|
ShardCount int `yaml:"shard_count"`
|
||||||
PreferredIPv4SubnetMaskBits int `yaml:"preferred_ipv4_subnet_mask_bits"`
|
PreferredIPv4SubnetMaskBitsSet int `yaml:"preferred_ipv4_subnet_mask_bits_set"`
|
||||||
PreferredIPv6SubnetMaskBits int `yaml:"preferred_ipv6_subnet_mask_bits"`
|
PreferredIPv6SubnetMaskBitsSet int `yaml:"preferred_ipv6_subnet_mask_bits_set"`
|
||||||
}
|
}
|
||||||
|
|
||||||
// New creates a new PeerStore backed by memory.
|
// New creates a new PeerStore backed by memory.
|
||||||
|
@ -94,8 +94,8 @@ func New(cfg Config) (storage.PeerStore, error) {
|
||||||
ps := &peerStore{
|
ps := &peerStore{
|
||||||
shards: make([]*peerShard, shardCount*2),
|
shards: make([]*peerShard, shardCount*2),
|
||||||
closed: make(chan struct{}),
|
closed: make(chan struct{}),
|
||||||
ipv4Mask: net.CIDRMask(cfg.PreferredIPv4SubnetMaskBits, 32),
|
ipv4Mask: net.CIDRMask(cfg.PreferredIPv4SubnetMaskBitsSet, 32),
|
||||||
ipv6Mask: net.CIDRMask(cfg.PreferredIPv6SubnetMaskBits, 128),
|
ipv6Mask: net.CIDRMask(cfg.PreferredIPv6SubnetMaskBitsSet, 128),
|
||||||
}
|
}
|
||||||
|
|
||||||
for i := 0; i < shardCount*2; i++ {
|
for i := 0; i < shardCount*2; i++ {
|
||||||
|
|
Loading…
Reference in a new issue