Documentation ¶
Overview ¶
Package service defines a service that manages the number of connections kept open.
Index ¶
- type Config
- type Service
- func (s *Service) Config() interface{}
- func (s *Service) Desc() string
- func (s *Service) Expose() interface{}
- func (s *Service) ID() string
- func (s *Service) Name() string
- func (s *Service) Run(ctx context.Context, running, stopping func()) error
- func (s *Service) SetConfig(config interface{}) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // LowWater is the minimum number of connections to keep open. LowWater int `toml:"low_water" comment:"Minimum number of connections to keep open (0 = disabled)."` // HighWater is the maximum number of connections to keep open. HighWater int `toml:"high_water" comment:"Maximum number of connections to keep open (0 = disabled)."` // GracePeriod is how long to keep a connection before it can be closed. GracePeriod string `toml:"grace_period" comment:"How long to keep a connection before it can be closed."` }
Config contains configuration options for the Connection Manager service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Connection Manager service.
func (*Service) Config ¶
func (s *Service) Config() interface{}
Config returns the current service configuration or creates one with good default values.
func (*Service) Expose ¶
func (s *Service) Expose() interface{}
Expose exposes the connection manager to other services.
It exposes the type:
github.com/libp2p/*go-libp2p-connmgr.BasicConnMgr
Click to show internal directories.
Click to hide internal directories.