service

package
v0.0.0-...-755f579 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2022 License: CC0-1.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Auth

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

func NewAuth

func NewAuth(db AuthDB) *Auth

func (*Auth) SignUpUserByTelegram

func (a *Auth) SignUpUserByTelegram(ctx context.Context,
	data core.ServiceSignUpUserByTelegramData) error

func (*Auth) ValidateUserByChatId

func (a *Auth) ValidateUserByChatId(ctx context.Context, chatId int) (int, error)

type AuthDB

type AuthDB interface {
	AddUser(ctx context.Context, user core.AddUser) (int, error)
	ValidateUser(ctx context.Context, chatId int) (int, error)
}

type Converter

type Converter struct {
	UserDb ConverterUserDb
	// contains filtered or unexported fields
}

func NewConverter

func NewConverter(binanceApi ConverterBinanceApi, userDb ConverterUserDb) *Converter

func (*Converter) GetAvailableConverterPairs

func (c *Converter) GetAvailableConverterPairs(ctx context.Context) ([]core.ConverterPair, error)

func (*Converter) GetCurrentExchange

func (c *Converter) GetCurrentExchange(ctx context.Context,
	converterPair core.ConverterPair) (core.Exchange, error)

func (*Converter) GetMyConvertPairs

func (c *Converter) GetMyConvertPairs(ctx context.Context) ([]core.ConverterPair, error)

func (*Converter) GetMyThresholdsConvertPairs

func (c *Converter) GetMyThresholdsConvertPairs(ctx context.Context) ([]core.ThresholdConvertPair,
	error)

func (*Converter) SetConvertPair

func (c *Converter) SetConvertPair(ctx context.Context, converterPair core.ConverterPair) error

func (*Converter) SetThresholdConvertPair

func (c *Converter) SetThresholdConvertPair(ctx context.Context,
	threshold core.ThresholdConvertPair) error

type ConverterBinanceApi

type ConverterBinanceApi interface {
	GetExchange(ctx context.Context, converterPair core.ConverterPair) (core.Exchange, error)
}

type ConverterUserDb

type ConverterUserDb interface {
	SetUserConverterPair(ctx context.Context, userId int, converterPair core.ConverterPair) (
		int, error)
	GetUserConverterPairs(ctx context.Context, userId int) ([]core.ConverterPair, error)
	GetConverterPairs(ctx context.Context) ([]core.ConverterPair, error)
	SetThresholdConvertPair(ctx context.Context, userId int,
		threshold core.ThresholdConvertPair) error
	GetThresholdConvertPair(ctx context.Context, userId int) ([]core.ThresholdConvertPair, error)
}

type Currency

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

func NewCurrency

func NewCurrency(userDb CurrencyUserDb) *Currency

func (Currency) DeleteCurrency

func (c Currency) DeleteCurrency(ctx context.Context, currency core.CurrencyCode) error

func (Currency) GetAvailableBankByCurrency

func (c Currency) GetAvailableBankByCurrency(ctx context.Context,
	currencyCode core.CurrencyCode) (banks []core.CurrencyBank, err error)

func (Currency) GetAvailableCurrencies

func (c Currency) GetAvailableCurrencies(ctx context.Context,
	currencyType core.CurrencyType) (currencies []core.CurrencyCode, err error)

func (Currency) GetMyCurrencies

func (c Currency) GetMyCurrencies(ctx context.Context,
	currencyType *core.CurrencyType) ([]core.FullCurrency, error)

func (Currency) SetCurrency

func (c Currency) SetCurrency(ctx context.Context, currency core.FullCurrency) error

type CurrencyUserDb

type CurrencyUserDb interface {
	AddUserCurrency(ctx context.Context, userId int, currency core.FullCurrency) (int, error)
	GetUserCurrencies(ctx context.Context, userId int, currencyType *core.CurrencyType) ([]core.
		FullCurrency, error)
	DeleteUserCurrency(ctx context.Context, userId int, currency core.CurrencyCode) error
	GetAvailableClassicCurrencies(ctx context.Context) ([]core.CurrencyCode, error)
	GetAvailableBanks(ctx context.Context, currency core.CurrencyCode) ([]core.CurrencyBank, error)
	GetAvailableCryptoCurrencies(ctx context.Context) ([]core.CurrencyCode, error)
}

Jump to

Keyboard shortcuts

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