Documentation ¶
Index ¶
- Variables
- type Bandwidth
- type BandwidthInfo
- type BandwidthUsed
- type DB
- type Dashboard
- type DiskSpaceInfo
- type Egress
- type Ingress
- type Satellite
- type Satellites
- type Service
- func (s *Service) GetAllSatellitesData(ctx context.Context) (_ *Satellites, err error)
- func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error)
- func (s *Service) GetSatelliteData(ctx context.Context, satelliteID storj.NodeID) (_ *Satellite, err error)
- func (s *Service) VerifySatelliteID(ctx context.Context, satelliteID storj.NodeID) (err error)
Constants ¶
This section is empty.
Variables ¶
var ( // SNOServiceErr defines sno service error. SNOServiceErr = errs.Class("storage node dashboard service error") )
Functions ¶
This section is empty.
Types ¶
type Bandwidth ¶ added in v0.18.0
type Bandwidth interface { // GetDaily returns slice of daily bandwidth usage for provided time range, // sorted in ascending order for particular satellite GetDaily(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) ([]BandwidthUsed, error) // GetDailyTotal returns slice of daily bandwidth usage for provided time range, // sorted in ascending order GetDailyTotal(ctx context.Context, from, to time.Time) ([]BandwidthUsed, error) }
Bandwidth is interface for querying bandwidth from the db
type BandwidthInfo ¶
type BandwidthInfo struct { Egress Egress `json:"egress"` Ingress Ingress `json:"ingress"` Used float64 `json:"used"` Available float64 `json:"available"` }
BandwidthInfo stores all info about storage node bandwidth usage
type BandwidthUsed ¶ added in v0.15.0
type BandwidthUsed struct { Egress Egress `json:"egress"` Ingress Ingress `json:"ingress"` From time.Time `json:"from"` To time.Time `json:"to"` }
BandwidthUsed stores bandwidth usage information over the period of time
type DB ¶
type DB interface { // Bandwidth is a getter for Bandwidth db. Bandwidth() Bandwidth }
DB exposes methods for managing SNO dashboard related data.
type Dashboard ¶ added in v0.18.0
type Dashboard struct { NodeID storj.NodeID `json:"nodeID"` Wallet string `json:"wallet"` Satellites storj.NodeIDList `json:"satellites"` DiskSpace DiskSpaceInfo `json:"diskSpace"` Bandwidth BandwidthInfo `json:"bandwidth"` Version version.SemVer `json:"version"` UpToDate bool `json:"upToDate"` }
Dashboard encapsulates dashboard stale data.
type DiskSpaceInfo ¶
DiskSpaceInfo stores all info about storagenode disk space usage
type Egress ¶
type Egress struct { Repair int64 `json:"repair"` Audit int64 `json:"audit"` Usage int64 `json:"usage"` }
Egress stores info about storage node egress usage
type Satellite ¶ added in v0.18.0
type Satellite struct { ID storj.NodeID `json:"id"` StorageDaily []storageusage.Stamp `json:"storageDaily"` BandwidthDaily []BandwidthUsed `json:"bandwidthDaily"` Audit reputation.Metric `json:"audit"` Uptime reputation.Metric `json:"uptime"` }
Satellite encapsulates satellite related data.
type Satellites ¶ added in v0.18.0
type Satellites struct { StorageDaily []storageusage.Stamp `json:"storageDaily"` BandwidthDaily []BandwidthUsed `json:"bandwidthDaily"` }
Satellites represents consolidated data across all satellites.
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
Service is handling storage node operator related logic.
func NewService ¶
func NewService(log *zap.Logger, consoleDB DB, bandwidth bandwidth.DB, pieceStore *pieces.Store, kademlia *kademlia.Kademlia, version *version.Service, allocatedBandwidth, allocatedDiskSpace memory.Size, walletAddress string, versionInfo version.Info, trust *trust.Pool, reputationDB reputation.DB, storageUsageDB storageusage.DB) (*Service, error)
NewService returns new instance of Service.
func (*Service) GetAllSatellitesData ¶ added in v0.18.0
func (s *Service) GetAllSatellitesData(ctx context.Context) (_ *Satellites, err error)
GetAllSatellitesData returns bandwidth and storage daily usage consolidate among all satellites from the node's trust pool.
func (*Service) GetDashboardData ¶ added in v0.18.0
GetDashboardData returns stale dashboard data.