Documentation ¶
Overview ¶
Package service defines a service that routes transport protocols to stream multiplexers.
Index ¶
- Variables
- 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) 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 ( // ErrNoStreamMuxers is returned when no stream muxers were specified. ErrNoStreamMuxers = errors.New("at least one stream muxer is required") // ErrNotStreamMuxer is returned when a specified service is not a stream muxer. ErrNotStreamMuxer = errors.New("connected service is not a stream muxer") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Routes maps protocols to stream muxer services. Routes map[string]string `toml:"routes" comment:"A map of protocols to stream muxers (protocol = service)."` }
Config contains configuration options for the Stream Muxer Router service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Stream Muxer Router 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 stream muxer to other services.
It exposes the type:
github.com/libp2p/go-stream-muxer.Transport
Click to show internal directories.
Click to hide internal directories.