refactor: interfaces should not be pointers
This commit is contained in:
parent
bd8c14e53e
commit
b8cb37f99e
|
@ -9,13 +9,13 @@ import (
|
|||
)
|
||||
|
||||
type Node interface {
|
||||
Services() *Services
|
||||
HashQueryRoutingTable() *structs.Map
|
||||
Services() Services
|
||||
HashQueryRoutingTable() structs.Map
|
||||
IsStarted() bool
|
||||
Config() *config.NodeConfig
|
||||
Logger() *zap.Logger
|
||||
Db() *bolt.DB
|
||||
Start() error
|
||||
GetCachedStorageLocations(hash *encoding.Multihash, types []int) (map[string]*StorageLocation, error)
|
||||
AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, location *StorageLocation, message []byte, config *config.NodeConfig) error
|
||||
GetCachedStorageLocations(hash *encoding.Multihash, types []int) (map[string]StorageLocation, error)
|
||||
AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, location StorageLocation, message []byte, config *config.NodeConfig) error
|
||||
}
|
||||
|
|
|
@ -8,8 +8,8 @@ import (
|
|||
)
|
||||
|
||||
type P2PService interface {
|
||||
Node() *Node
|
||||
Peers() *structs.Map
|
||||
Node() Node
|
||||
Peers() structs.Map
|
||||
Start() error
|
||||
Stop() error
|
||||
Init() error
|
||||
|
|
|
@ -1,11 +1,11 @@
|
|||
package interfaces
|
||||
|
||||
type Service interface {
|
||||
Node() *Node
|
||||
Node() Node
|
||||
Start() error
|
||||
Stop() error
|
||||
Init() error
|
||||
}
|
||||
type Services interface {
|
||||
P2P() *P2PService
|
||||
P2P() P2PService
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue