github.com/status-im/status-go@v1.1.0/services/browsers/service.go (about) 1 package browsers 2 3 import ( 4 "github.com/ethereum/go-ethereum/p2p" 5 "github.com/ethereum/go-ethereum/rpc" 6 ) 7 8 // NewService initializes service instance. 9 func NewService(db *Database) *Service { 10 return &Service{db: db} 11 } 12 13 // Service is a browsers service. 14 type Service struct { 15 db *Database 16 } 17 18 // Start a service. 19 func (s *Service) Start() error { 20 return nil 21 } 22 23 // Stop a service. 24 func (s *Service) Stop() error { 25 return nil 26 } 27 28 // APIs returns list of available RPC APIs. 29 func (s *Service) APIs() []rpc.API { 30 return []rpc.API{ 31 { 32 Namespace: "browsers", 33 Version: "0.1.0", 34 Service: NewAPI(s.db), 35 }, 36 } 37 } 38 39 // Protocols returns list of p2p protocols. 40 func (s *Service) Protocols() []p2p.Protocol { 41 return nil 42 }