Documentation ¶
Overview ¶
Package service defines a service that deals with setting NAT port mappings to allow nodes to connect to a node behind a firewall.
Index ¶
- Variables
- type Config
- type Host
- 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) Needs() map[string]struct{}
- func (s *Service) Plug(exposed map[string]interface{}) error
- func (s *Service) Run(ctx context.Context, running, stopping func()) error
- func (s *Service) SetConfig(config interface{}) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrNotHost is returned when the connected service is not a host. ErrNotHost = errors.New("connected service is not a host") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Host is the name of the host service. Host string `toml:"host" comment:"The name of the host service."` }
Config contains configuration options for the NAT Manager service.
type Host ¶
type Host interface { ihost.Host SetNATManager(bhost.NATManager) }
Host represents a Stratumn Node host.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the NAT 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 NAT manager to other services.
It exposes thhe type:
github.com/libp2p/go-libp2p/p2p/host/basic.NATManager
Directories ¶
Path | Synopsis |
---|---|
Package mockservice is a generated GoMock package.
|
Package mockservice is a generated GoMock package. |
Click to show internal directories.
Click to hide internal directories.