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