base

package
v0.7.3 Latest Latest
Warning

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

Go to latest
Published: Jun 25, 2024 License: MIT Imports: 11 Imported by: 0

Documentation

Overview

Package base provides a base store for the screener-api.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func GetAllModels

func GetAllModels() (allModels []interface{})

GetAllModels gets all models to migrate. see: https://medium.com/@SaifAbid/slice-interfaces-8c78f8b6345d for an explanation of why we can't do this at initialization time

Types

type Store

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

Store is a store that implements an underlying gorm db.

func NewStore

func NewStore(db *gorm.DB, metrics metrics.Handler) *Store

NewStore creates a new store.

func (*Store) DeleteBlacklistedAddress added in v0.4.0

func (s *Store) DeleteBlacklistedAddress(ctx context.Context, id string) error

DeleteBlacklistedAddress deletes the blacklisted address from the underlying db.

func (*Store) GetAddressIndicators

func (s *Store) GetAddressIndicators(ctx context.Context, address string, since time.Time) ([]trmlabs.AddressRiskIndicator, error)

GetAddressIndicators gets the address indicators for the given address.

func (*Store) GetBlacklistedAddress added in v0.4.0

func (s *Store) GetBlacklistedAddress(ctx context.Context, address string) (*db.BlacklistedAddress, error)

GetBlacklistedAddress queries the db for the blacklisted address. Returns true if the address is blacklisted, false otherwise. Not used currently.

func (*Store) PutAddressIndicators

func (s *Store) PutAddressIndicators(ctx context.Context, address string, riskIndicator []trmlabs.AddressRiskIndicator) error

PutAddressIndicators puts the address indicators for the given address.

func (*Store) PutBlacklistedAddress added in v0.4.0

func (s *Store) PutBlacklistedAddress(ctx context.Context, body db.BlacklistedAddress) error

PutBlacklistedAddress puts the blacklisted address in the underlying db.

func (*Store) UpdateBlacklistedAddress added in v0.4.0

func (s *Store) UpdateBlacklistedAddress(ctx context.Context, id string, body db.BlacklistedAddress) error

UpdateBlacklistedAddress updates the blacklisted address in the underlying db.

Jump to

Keyboard shortcuts

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