2024-01-07 08:13:35 +00:00
|
|
|
package interfaces
|
|
|
|
|
|
|
|
import (
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/config"
|
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
2024-01-09 13:20:19 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/metadata"
|
2024-01-07 08:13:35 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/structs"
|
2024-01-09 11:53:09 +00:00
|
|
|
"git.lumeweb.com/LumeWeb/libs5-go/types"
|
2024-01-07 08:13:35 +00:00
|
|
|
bolt "go.etcd.io/bbolt"
|
|
|
|
"go.uber.org/zap"
|
2024-01-09 14:11:36 +00:00
|
|
|
"sync"
|
2024-01-07 08:13:35 +00:00
|
|
|
)
|
|
|
|
|
2024-01-08 05:16:32 +00:00
|
|
|
//go:generate mockgen -source=node.go -destination=../mocks/interfaces/node.go -package=interfaces
|
|
|
|
|
2024-01-07 08:13:35 +00:00
|
|
|
type Node interface {
|
2024-01-07 08:54:32 +00:00
|
|
|
Services() Services
|
|
|
|
HashQueryRoutingTable() structs.Map
|
2024-01-07 08:13:35 +00:00
|
|
|
IsStarted() bool
|
|
|
|
Config() *config.NodeConfig
|
|
|
|
Logger() *zap.Logger
|
|
|
|
Db() *bolt.DB
|
|
|
|
Start() error
|
2024-01-09 11:53:09 +00:00
|
|
|
GetCachedStorageLocations(hash *encoding.Multihash, kinds []types.StorageLocationType) (map[string]StorageLocation, error)
|
2024-01-07 08:54:32 +00:00
|
|
|
AddStorageLocation(hash *encoding.Multihash, nodeId *encoding.NodeId, location StorageLocation, message []byte, config *config.NodeConfig) error
|
2024-01-07 14:02:39 +00:00
|
|
|
NetworkId() string
|
2024-01-09 13:20:19 +00:00
|
|
|
DownloadBytesByHash(hash *encoding.Multihash) ([]byte, error)
|
2024-01-09 21:18:49 +00:00
|
|
|
DownloadBytesByCID(cid *encoding.CID) (bytes []byte, err error)
|
2024-01-09 13:20:19 +00:00
|
|
|
GetMetadataByCID(cid *encoding.CID) (metadata.Metadata, error)
|
2024-01-09 14:11:36 +00:00
|
|
|
WaitOnConnectedPeers()
|
|
|
|
ConnectionTracker() *sync.WaitGroup
|
2024-01-07 08:13:35 +00:00
|
|
|
}
|