reputation

package
v1.111.3-rc Latest Latest
Warning

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

Go to latest
Published: Aug 16, 2024 License: AGPL-3.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (

	// Error is an error class for reputation service error.
	Error = errs.Class("reputation")
	// ErrorNoStats is an error class for reputation is not found error.
	ErrorNoStats = errs.Class("reputation stats not found")
)

Functions

This section is empty.

Types

type Audit

type Audit struct {
	TotalCount      int64         `json:"totalCount"`
	SuccessCount    int64         `json:"successCount"`
	Alpha           float64       `json:"alpha"`
	Beta            float64       `json:"beta"`
	UnknownAlpha    float64       `json:"unknownAlpha"`
	UnknownBeta     float64       `json:"unknownBeta"`
	Score           float64       `json:"score"`
	SuspensionScore float64       `json:"suspensionScore"`
	History         []AuditWindow `json:"history"`
}

Audit contains audit reputation metrics.

type AuditWindow

type AuditWindow struct {
	WindowStart time.Time `json:"windowStart"`
	TotalCount  int32     `json:"totalCount"`
	OnlineCount int32     `json:"onlineCount"`
}

AuditWindow contains audit count for particular time frame.

type Service

type Service struct {
	// contains filtered or unexported fields
}

Service exposes all reputation related logic.

architecture: Service

func NewService

func NewService(log *zap.Logger, dialer rpc.Dialer, nodes nodes.DB) *Service

NewService creates new instance of reputation Service.

func (*Service) Stats

func (service *Service) Stats(ctx context.Context, satelliteID storj.NodeID) (_ []Stats, err error)

Stats retrieves node reputation stats list for satellite.

type Stats

type Stats struct {
	NodeID               storj.NodeID `json:"nodeId"`
	NodeName             string       `json:"nodeName"`
	Audit                Audit        `json:"audit"`
	OnlineScore          float64      `json:"onlineScore"`
	DisqualifiedAt       *time.Time   `json:"disqualifiedAt"`
	SuspendedAt          *time.Time   `json:"suspendedAt"`
	OfflineSuspendedAt   *time.Time   `json:"offlineSuspendedAt"`
	OfflineUnderReviewAt *time.Time   `json:"offlineUnderReviewAt"`
	VettedAt             *time.Time   `json:"vettedAt"`
	UpdatedAt            time.Time    `json:"updatedAt"`
	JoinedAt             time.Time    `json:"joinedAt"`
}

Stats encapsulates node reputation data.

Jump to

Keyboard shortcuts

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