services

package
v0.0.0-...-7af3340 Latest Latest
Warning

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

Go to latest
Published: Mar 13, 2026 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PoolInfo

type PoolInfo struct {
	Blockchain *blockchains.BlockchainInfo
	Host       string
	MinPayout  *uint64
}

type UserAction

type UserAction string
const (
	UserAddWalletAction                 UserAction = "add_wallet"
	ReportBugAction                     UserAction = "report_bug"
	UserAddWalletSelectBlockchainAction UserAction = "add_wallet_select_blockchain"
	ShowPoolStatsAction                 UserAction = "show_pool_stats"
	UserRemoveWalletAction              UserAction = "remove_wallet"
	UserSettingsAction                  UserAction = "settings"
	UserSettingsSelectLanguageAction    UserAction = "settings_select_language"
	UserRemoveWalletSelectWalletAction  UserAction = "remove_wallet_select_wallet"
)

func (*UserAction) Scan

func (ua *UserAction) Scan(val any) error

func (UserAction) Value

func (ua UserAction) Value() (driver.Value, error)

type UserActionDB

type UserActionDB struct {
	UserID  int64      `db:"user_id"`
	Action  UserAction `db:"action"`
	Payload *string    `db:"payload"`
}

type UserActionService

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

func NewUserActionService

func NewUserActionService(pgConn *pgxpool.Pool) *UserActionService

func (*UserActionService) Clear

func (a *UserActionService) Clear(ctx context.Context, userID int64) error

func (*UserActionService) Get

func (a *UserActionService) Get(ctx context.Context, userID int64) (*UserActionDB, error)

func (*UserActionService) Set

func (a *UserActionService) Set(ctx context.Context, userID int64, action UserAction, payload *string) error

type UserDB

type UserDB struct {
	ID            int64  `db:"id"`
	ChatID        int64  `db:"chat_id"`
	Lang          string `db:"lang"`
	PayoutsNotify bool   `db:"payouts_notify"`
	BlocksNotify  bool   `db:"blocks_notify"`
}

type UserPoolBalances

type UserPoolBalances struct {
	Coin     string
	Balances map[string]*pool_payouts_proto.MinerBalance
}

type UserPoolWallet

type UserPoolWallet struct {
	Pool    *PoolInfo
	Wallet  string
	Balance uint64
	AddedAt time.Time
}

type UserPoolWallets

type UserPoolWallets struct {
	Pool    *PoolInfo
	Wallets []UserWalletInfo
}

type UserPoolWorker

type UserPoolWorker struct {
	Pool        *PoolInfo
	Wallet      string
	Worker      string
	Region      string
	Solo        bool
	Hashrate    *big.Int
	ConnectedAt time.Time
}

type UserPoolWorkers

type UserPoolWorkers struct {
	Coin    string
	Workers map[string]*pool_miners_proto.MinerWorkers
}

type UserService

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

func NewUserService

func NewUserService(pgConn *pgxpool.Pool) *UserService

func (*UserService) Find

func (s *UserService) Find(ctx context.Context, id int64) (*UserDB, error)

func (*UserService) Init

func (s *UserService) Init(ctx context.Context, botUser *models.User, chatID int64) (*UserDB, error)

func (*UserService) SetBlocksNotify

func (s *UserService) SetBlocksNotify(ctx context.Context, id int64, value bool) error

func (*UserService) SetLang

func (s *UserService) SetLang(ctx context.Context, id int64, languageTag language.Tag) error

func (*UserService) SetPayoutsNotify

func (s *UserService) SetPayoutsNotify(ctx context.Context, id int64, value bool) error

type UserWalletInfo

type UserWalletInfo struct {
	ID      int64
	Wallet  string
	AddedAt time.Time
}

type UserWalletService

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

func NewUserWalletService

func NewUserWalletService(pgConn *pgxpool.Pool, blockchainsService *blockchains.Service) *UserWalletService

func (*UserWalletService) Add

func (w *UserWalletService) Add(ctx context.Context, userID int64, coin, wallet string) error

func (*UserWalletService) CheckDuplicates

func (w *UserWalletService) CheckDuplicates(ctx context.Context, userID int64, coin, wallet string) (bool, error)

func (*UserWalletService) Count

func (w *UserWalletService) Count(ctx context.Context, userID int64, coin string) (int, error)

func (*UserWalletService) FindBlockchainWallets

func (w *UserWalletService) FindBlockchainWallets(ctx context.Context, userID int64, coin string) ([]UserWalletInfo, error)

func (*UserWalletService) FindBlockchains

func (w *UserWalletService) FindBlockchains(ctx context.Context, userID int64) ([]blockchains.BlockchainInfo, error)

func (*UserWalletService) FindWallets

func (w *UserWalletService) FindWallets(ctx context.Context, userID int64) ([]UserPoolWallet, error)

func (*UserWalletService) FindWorkers

func (w *UserWalletService) FindWorkers(ctx context.Context, userID int64) ([]UserPoolWorker, error)

func (*UserWalletService) Remove

func (w *UserWalletService) Remove(ctx context.Context, id int64) error

Jump to

Keyboard shortcuts

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