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

View File

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

View File

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