Documentation ¶
Index ¶
- Variables
- type BandwidthInfo
- type BandwidthUsed
- type DB
- type DiskSpaceInfo
- type Egress
- type Ingress
- type Service
- func (s *Service) CheckVersion(ctx context.Context) (err error)
- func (s *Service) GetBandwidthBySatellite(ctx context.Context, satelliteID storj.NodeID) (_ *BandwidthInfo, err error)
- func (s *Service) GetDailyBandwidthUsed(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []BandwidthUsed, err error)
- func (s *Service) GetDailyStorageUsedForSatellite(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []nodestats.SpaceUsageStamp, err error)
- func (s *Service) GetDailyTotalBandwidthUsed(ctx context.Context, from, to time.Time) (_ []BandwidthUsed, err error)
- func (s *Service) GetNodeID(ctx context.Context) storj.NodeID
- func (s *Service) GetSatellites(ctx context.Context) (_ storj.NodeIDList, err error)
- func (s *Service) GetStatsFromSatellite(ctx context.Context, satelliteID storj.NodeID) (_ *nodestats.Stats, err error)
- func (s *Service) GetUptime(ctx context.Context) time.Duration
- func (s *Service) GetUsedBandwidthTotal(ctx context.Context) (_ *BandwidthInfo, err error)
- func (s *Service) GetUsedStorageBySatellite(ctx context.Context, satelliteID storj.NodeID) (_ *DiskSpaceInfo, err error)
- func (s *Service) GetUsedStorageTotal(ctx context.Context) (_ *DiskSpaceInfo, err error)
- func (s *Service) GetVersion(ctx context.Context) version.Info
- func (s *Service) GetWalletAddress(ctx context.Context) string
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 BandwidthInfo ¶
type BandwidthInfo struct { Egress Egress `json:"egress"` Ingress Ingress `json:"ingress"` Used int64 `json:"used"` Remaining int64 `json:"remaining"` }
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, To time.Time }
BandwidthUsed stores bandwidth usage information over the period of time
type DB ¶
type DB interface { // GetSatelliteIDs returns list of satelliteIDs that storagenode has interacted with // at least once GetSatelliteIDs(ctx context.Context, from, to time.Time) (storj.NodeIDList, error) // GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range, // sorted in ascending order GetDailyTotalBandwidthUsed(ctx context.Context, from, to time.Time) ([]BandwidthUsed, error) // GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range, // sorted in ascending order for particular satellite GetDailyBandwidthUsed(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) ([]BandwidthUsed, error) }
DB exposes methods for managing SNO dashboard related 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 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, pieceInfo pieces.DB, kademlia *kademlia.Kademlia, version *version.Service, nodestats *nodestats.Service, allocatedBandwidth, allocatedDiskSpace memory.Size, walletAddress string, versionInfo version.Info) (*Service, error)
NewService returns new instance of Service
func (*Service) CheckVersion ¶
CheckVersion checks to make sure the version is still okay, returning an error if not
func (*Service) GetBandwidthBySatellite ¶
func (s *Service) GetBandwidthBySatellite(ctx context.Context, satelliteID storj.NodeID) (_ *BandwidthInfo, err error)
GetBandwidthBySatellite returns all info about storage node bandwidth usage by satellite
func (*Service) GetDailyBandwidthUsed ¶ added in v0.15.0
func (s *Service) GetDailyBandwidthUsed(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []BandwidthUsed, err error)
GetDailyBandwidthUsed returns slice of daily bandwidth usage for provided time range, sorted in ascending order for particular satellite
func (*Service) GetDailyStorageUsedForSatellite ¶ added in v0.15.0
func (s *Service) GetDailyStorageUsedForSatellite(ctx context.Context, satelliteID storj.NodeID, from, to time.Time) (_ []nodestats.SpaceUsageStamp, err error)
GetDailyStorageUsedForSatellite returns daily SpaceUsageStamps for a particular satellite
func (*Service) GetDailyTotalBandwidthUsed ¶ added in v0.15.0
func (s *Service) GetDailyTotalBandwidthUsed(ctx context.Context, from, to time.Time) (_ []BandwidthUsed, err error)
GetDailyTotalBandwidthUsed returns slice of daily bandwidth usage for provided time range, sorted in ascending order
func (*Service) GetSatellites ¶
GetSatellites used to retrieve satellites list
func (*Service) GetStatsFromSatellite ¶ added in v0.15.0
func (s *Service) GetStatsFromSatellite(ctx context.Context, satelliteID storj.NodeID) (_ *nodestats.Stats, err error)
GetStatsFromSatellite returns storagenode stats from the satellite
func (*Service) GetUsedBandwidthTotal ¶
func (s *Service) GetUsedBandwidthTotal(ctx context.Context) (_ *BandwidthInfo, err error)
GetUsedBandwidthTotal returns all info about storage node bandwidth usage
func (*Service) GetUsedStorageBySatellite ¶
func (s *Service) GetUsedStorageBySatellite(ctx context.Context, satelliteID storj.NodeID) (_ *DiskSpaceInfo, err error)
GetUsedStorageBySatellite returns all info about storagenode disk space usage
func (*Service) GetUsedStorageTotal ¶
func (s *Service) GetUsedStorageTotal(ctx context.Context) (_ *DiskSpaceInfo, err error)
GetUsedStorageTotal returns all info about storagenode disk space usage
func (*Service) GetVersion ¶
GetVersion return current node version