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

     1  package chat
     2  
     3  import (
     4  	"github.com/ethereum/go-ethereum/p2p"
     5  	gethrpc "github.com/ethereum/go-ethereum/rpc"
     6  
     7  	"github.com/status-im/status-go/multiaccounts/accounts"
     8  	"github.com/status-im/status-go/protocol"
     9  )
    10  
    11  func NewService(accountsDB *accounts.Database) *Service {
    12  	return &Service{
    13  		accountsDB: accountsDB,
    14  	}
    15  }
    16  
    17  type Service struct {
    18  	messenger  *protocol.Messenger
    19  	accountsDB *accounts.Database
    20  }
    21  
    22  func (s *Service) Init(messenger *protocol.Messenger) {
    23  	s.messenger = messenger
    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: "chat",
    38  			Version:   "0.1.0",
    39  			Service:   NewAPI(s),
    40  		},
    41  	}
    42  }
    43  
    44  func (s *Service) Protocols() []p2p.Protocol {
    45  	return nil
    46  }