github.com/status-im/status-go@v1.1.0/services/connector/service.go (about)

     1  package connector
     2  
     3  import (
     4  	"database/sql"
     5  
     6  	"github.com/ethereum/go-ethereum/p2p"
     7  
     8  	gethrpc "github.com/ethereum/go-ethereum/rpc"
     9  	"github.com/status-im/status-go/services/connector/commands"
    10  )
    11  
    12  func NewService(db *sql.DB, rpc commands.RPCClientInterface, nm commands.NetworkManagerInterface) *Service {
    13  	return &Service{
    14  		db:  db,
    15  		rpc: rpc,
    16  		nm:  nm,
    17  	}
    18  }
    19  
    20  type Service struct {
    21  	db  *sql.DB
    22  	rpc commands.RPCClientInterface
    23  	nm  commands.NetworkManagerInterface
    24  }
    25  
    26  func (s *Service) Start() error {
    27  	return nil
    28  }
    29  
    30  func (s *Service) Stop() error {
    31  	return nil
    32  }
    33  
    34  func (s *Service) APIs() []gethrpc.API {
    35  	return []gethrpc.API{
    36  		{
    37  			Namespace: "connector",
    38  			Version:   "0.1.0",
    39  			Service:   NewAPI(s),
    40  		},
    41  	}
    42  }
    43  
    44  func (s *Service) Protocols() []p2p.Protocol {
    45  	return nil
    46  }