Documentation ¶
Overview ¶
Package service defines a service the wraps a P2P host.
Index ¶
- Variables
- type Config
- type Service
- func (s *Service) AddToGRPCServer(gs *grpc.Server)
- 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 ( // ErrNotNetwork is returned when a specified service is not a network. ErrNotNetwork = errors.New("connected service is not a network or swarm") // ErrNotConnManager is returned when a specified service is not a // connection manager. ErrNotConnManager = errors.New("connected service is not a connection manager") // available. ErrUnavailable = errors.New("the service is not available") )
Functions ¶
This section is empty.
Types ¶
type Config ¶
type Config struct { // Network is the name of the network or swarm service. Network string `toml:"network" comment:"The name of the network or swarm service."` // ConnectionManager is the name of the connection manager service. ConnectionManager string `toml:"connection_manager" comment:"The name of the connection manager service."` // NegotiationTimeout is the negotiation timeout. NegotiationTimeout string `toml:"negotiation_timeout" comment:"The negotiation timeout."` // AddressesNetmasks are CIDR netmasks to filter announced addresses. AddressesNetmasks []string `toml:"addresses_netmasks" comment:"CIDR netmasks to filter announced addresses."` }
Config contains configuration options for the Host service.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is the Host service.
func (*Service) AddToGRPCServer ¶
AddToGRPCServer adds the service to a gRPC server.
func (*Service) Config ¶
func (s *Service) Config() interface{}
Config returns the current service configuration or creates one with good default values.
It can panic but it can only happen during `stratumn-node init`.
func (*Service) Expose ¶
func (s *Service) Expose() interface{}
Expose exposes the service to other services.
It exposes the type:
github.com/stratumn/go-node/core/*p2p.Host
Click to show internal directories.
Click to hide internal directories.