github.com/status-im/status-go@v1.1.0/services/permissions/service.go (about) 1 package permissions 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 type Service struct { 14 db *Database 15 } 16 17 // Start a service. 18 func (s *Service) Start() error { 19 return nil 20 } 21 22 // Stop a service. 23 func (s *Service) Stop() error { 24 return nil 25 } 26 27 // APIs returns list of available RPC APIs. 28 func (s *Service) APIs() []rpc.API { 29 return []rpc.API{ 30 { 31 Namespace: "permissions", 32 Version: "0.1.0", 33 Service: NewAPI(s.db), 34 }, 35 } 36 } 37 38 // Protocols returns list of p2p protocols. 39 func (s *Service) Protocols() []p2p.Protocol { 40 return nil 41 }