2024-01-07 08:13:35 +00:00
|
|
|
package interfaces
|
|
|
|
|
2024-01-09 12:01:19 +00:00
|
|
|
import "git.lumeweb.com/LumeWeb/libs5-go/encoding"
|
|
|
|
|
2024-01-08 05:16:32 +00:00
|
|
|
//go:generate mockgen -source=storage.go -destination=../mocks/interfaces/storage.go -package=interfaces
|
|
|
|
|
2024-01-09 12:00:00 +00:00
|
|
|
type StorageLocationProvider interface {
|
|
|
|
Start() error
|
|
|
|
Next() (SignedStorageLocation, error)
|
|
|
|
Upvote(uri SignedStorageLocation) error
|
|
|
|
Downvote(uri SignedStorageLocation) error
|
|
|
|
}
|
|
|
|
|
2024-01-07 08:13:35 +00:00
|
|
|
type StorageLocation interface {
|
|
|
|
BytesURL() string
|
|
|
|
OutboardBytesURL() string
|
|
|
|
String() string
|
|
|
|
ProviderMessage() []byte
|
|
|
|
Type() int
|
|
|
|
Parts() []string
|
|
|
|
BinaryParts() [][]byte
|
|
|
|
Expiry() int64
|
|
|
|
SetProviderMessage(msg []byte)
|
|
|
|
SetType(t int)
|
|
|
|
SetParts(p []string)
|
|
|
|
SetBinaryParts(bp [][]byte)
|
|
|
|
SetExpiry(e int64)
|
|
|
|
}
|
|
|
|
type SignedStorageLocation interface {
|
|
|
|
String() string
|
2024-01-09 12:01:19 +00:00
|
|
|
NodeId() *encoding.NodeId
|
2024-01-09 13:15:13 +00:00
|
|
|
Location() StorageLocation
|
2024-01-07 08:13:35 +00:00
|
|
|
}
|