refactor: interfaces should not be pointers

This commit is contained in:
Derrick Hammer 2024-01-07 03:54:32 -05:00
parent bd8c14e53e
commit b8cb37f99e
Signed by: pcfreak30
GPG Key ID: C997C339BE476FF2
3 changed files with 8 additions and 8 deletions

View File

@ -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
}

View File

@ -8,8 +8,8 @@ import (
)
type P2PService interface {
Node() *Node
Peers() *structs.Map
Node() Node
Peers() structs.Map
Start() error
Stop() error
Init() error

View File

@ -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
}