profilesscore

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 28, 2023 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {
	profiles.Database
	SaveApplicationLinkScore(score *types.ProfileScore) error
}

type Module

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

func NewModule

func NewModule(scorers Scorers, db Database) *Module

NewModule returns a new Module instance

func (*Module) GetScorers

func (m *Module) GetScorers() Scorers

func (*Module) Name

func (m *Module) Name() string

Name implements modules.Module

func (*Module) RefreshApplicationLinksScores

func (m *Module) RefreshApplicationLinksScores() error

RefreshApplicationLinksScores reads all the applications links stored inside the database and refreshes their scores

func (*Module) RegisterPeriodicOperations

func (m *Module) RegisterPeriodicOperations(scheduler *gocron.Scheduler) error

RegisterPeriodicOperations implements modules.PeriodicOperationsModule

type ScoreRateLimit

type ScoreRateLimit struct {
	Duration  time.Duration
	RateLimit uint64
}

func NewScoreRateLimit

func NewScoreRateLimit(duration time.Duration, rateLimit uint64) *ScoreRateLimit

type Scorer

type Scorer interface {
	// GetRateLimit returns the rate limit for this scorer, if any
	GetRateLimit() *ScoreRateLimit

	// GetScoreDetails returns the score details for the user having the given address
	// and username on the specified application
	GetScoreDetails(address string, application string, username string) (types.ProfileScoreDetails, error)
}

Scorer represents a generic parses that gets data from an external application and converts it to a specific score

type Scorers

type Scorers []Scorer

func (Scorers) GetRateLimit

func (s Scorers) GetRateLimit() *ScoreRateLimit

Directories

Path Synopsis
scorers

Jump to

Keyboard shortcuts

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