internal

package
v0.4.1 Latest Latest
Warning

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

Go to latest
Published: May 9, 2024 License: MIT Imports: 5 Imported by: 0

Documentation

Overview

Package internal provides internal functionality for the screener-api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func MakeParam added in v0.0.4

func MakeParam(category string, riskType string) string

MakeParam creates a risk param from the given category and risk type in a standardized format.

Types

type CallerRuler

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

CallerRuler implements the RuleSet interface for a specific caller type.

func NewRuleset

func NewRuleset(riskRules map[string]bool) *CallerRuler

NewRuleset creates a new CallerRuler with the given risk rules.

func (*CallerRuler) HasAddressIndicators

func (cr *CallerRuler) HasAddressIndicators(thresholds []config.VolumeThreshold, riskIndicators ...trmlabs.AddressRiskIndicator) (bool, error)

HasAddressIndicators returns a list of addressRiskIndicator.

func (*CallerRuler) HasRisk

func (cr *CallerRuler) HasRisk(riskType string) bool

HasRisk checks if the specified risk type is present.

type RuleSet

type RuleSet interface {
	HasRisk(riskType string) bool
	HasAddressIndicators(thresholds []config.VolumeThreshold, riskIndicators ...trmlabs.AddressRiskIndicator) (bool, error)
}

RuleSet interface defines methods to work with risk rules.

type RulesetManager

type RulesetManager interface {
	// GetRuleset returns a RuleSet for the specified caller type.
	GetRuleset(rulesetName string) RuleSet
	// AddRuleset adds a new ruleset to the manager.
	AddRuleset(rulesetName string, rules map[string]bool) error
}

RulesetManager interface defines methods to work with rulesets.

func NewRulesetManager

func NewRulesetManager(rulesets map[string]map[string]bool) RulesetManager

NewRulesetManager creates a new rulesetManager with the given rulesets.

Jump to

Keyboard shortcuts

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