reputation

package
v0.28.4 Latest Latest
Warning

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

Go to latest
Published: Jan 1, 2020 License: AGPL-3.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type DB

type DB interface {
	// Store inserts or updates reputation stats into the DB
	Store(ctx context.Context, stats Stats) error
	// Get retrieves stats for specific satellite
	Get(ctx context.Context, satelliteID storj.NodeID) (*Stats, error)
	// All retrieves all stats from DB
	All(ctx context.Context) ([]Stats, error)
}

DB works with reputation database

architecture: Database

type Metric

type Metric struct {
	TotalCount   int64 `json:"totalCount"`
	SuccessCount int64 `json:"successCount"`

	Alpha float64 `json:"alpha"`
	Beta  float64 `json:"beta"`
	Score float64 `json:"score"`
}

Metric encapsulates storagenode reputation metrics

type Stats

type Stats struct {
	SatelliteID storj.NodeID

	Uptime Metric
	Audit  Metric

	Disqualified *time.Time

	UpdatedAt time.Time
}

Stats consist of reputation metrics

Jump to

Keyboard shortcuts

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