Skip to content
This repository has been archived by the owner on Apr 21, 2022. It is now read-only.

Commit

Permalink
Merge pull request #90 from libp2p/unexport-config
Browse files Browse the repository at this point in the history
unexport the config
  • Loading branch information
marten-seemann authored Nov 26, 2021
2 parents 6239e03 + e65e558 commit b10199b
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 7 deletions.
4 changes: 2 additions & 2 deletions connmgr.go
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ var log = logging.Logger("connmgr")
type BasicConnMgr struct {
*decayer

cfg *BasicConnManagerConfig
cfg *config
segments segments

plk sync.RWMutex
Expand Down Expand Up @@ -100,7 +100,7 @@ func (s *segment) tagInfoFor(p peer.ID) *peerInfo {
func NewConnManager(low, hi int, grace time.Duration, opts ...Option) *BasicConnMgr {
ctx, cancel := context.WithCancel(context.Background())

cfg := &BasicConnManagerConfig{
cfg := &config{
highWater: hi,
lowWater: low,
gracePeriod: grace,
Expand Down
9 changes: 4 additions & 5 deletions options.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,8 @@ package connmgr

import "time"

// BasicConnManagerConfig is the configuration struct for the basic connection
// manager.
type BasicConnManagerConfig struct {
// config is the configuration struct for the basic connection manager.
type config struct {
highWater int
lowWater int
gracePeriod time.Duration
Expand All @@ -13,11 +12,11 @@ type BasicConnManagerConfig struct {
}

// Option represents an option for the basic connection manager.
type Option func(*BasicConnManagerConfig) error
type Option func(*config) error

// DecayerConfig applies a configuration for the decayer.
func DecayerConfig(opts *DecayerCfg) Option {
return func(cfg *BasicConnManagerConfig) error {
return func(cfg *config) error {
cfg.decayer = opts
return nil
}
Expand Down

0 comments on commit b10199b

Please sign in to comment.