console

package
v0.19.6 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 2, 2019 License: AGPL-3.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
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

type DiskSpaceInfo struct {
	Used      float64 `json:"used"`
	Available float64 `json:"available"`
}

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 Ingress

type Ingress struct {
	Repair int64 `json:"repair"`
	Usage  int64 `json:"usage"`
}

Ingress stores info about storage node ingress 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

func (s *Service) GetDashboardData(ctx context.Context) (_ *Dashboard, err error)

GetDashboardData returns stale dashboard data.

func (*Service) GetSatelliteData added in v0.18.0

func (s *Service) GetSatelliteData(ctx context.Context, satelliteID storj.NodeID) (_ *Satellite, err error)

GetSatelliteData returns satellite related data.

func (*Service) VerifySatelliteID added in v0.18.0

func (s *Service) VerifySatelliteID(ctx context.Context, satelliteID storj.NodeID) (err error)

VerifySatelliteID verifies if the satellite belongs to the trust pool.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL