core

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: 5 Imported by: 0

Documentation

Index

Constants

View Source
const (
	UserIdCtx = "userId"
)

Variables

View Source
var (
	ErrorAuthServiceEmptyInputArg         = errors.New("empty input arguments")
	ErrorAuthServiceAuthUserAlreadyExists = errors.New("error user already exists")
	ErrorAuthServiceInternalError         = errors.New("internal error")
	ErrorAuthServiceUserNotFound          = errors.New("user not found")
)
View Source
var (
	ErrorConverterEmptyInputArg              = errors.New("empty input arguments")
	ErrorConverterInvalidConverterPair       = errors.New("invalid converter pair")
	ErrorConverterNotAuthorized              = errors.New("not authorized")
	ErrorConverterConverterPairAlreadyExists = errors.New("converter pair already exists")
	ErrorConverterConverterPairNotFound      = errors.New("converter pair not found")
)
View Source
var (
	ErrorCurrencyEmptyInputArg       = errors.New("empty input arguments")
	ErrorCurrencyInvalidCurrencyType = errors.New("invalid currency type")
	ErrorCurrencyInvalidCurrencyCode = errors.New("invalid currency code")
	ErrorCurrencyInvalidBankCode     = errors.New("invalid bank code")
	ErrorCurrencyInternal            = errors.New("internal error")
	ErrorCurrencyNotAuthorized       = errors.New("not authorized")
	ErrorCurrencyAlreadyHas          = errors.New("currency already has")
	ErrorCurrencyNotFound            = errors.New("currency not found")
)
View Source
var (
	ErrorExchangePlotEmptyInputArg          = errors.New("empty input arguments")
	ErrorExchangePlotInvalidTimeInterval    = errors.New("invalid time interval")
	ErrorExchangePlotNoDataForTimeInterval  = errors.New("no data for time interval")
	ErrorExchangePlotInvalidConverterPair   = errors.New("invalid converter pair")
	ErrorExchangePlotCovertPairNotSupported = errors.New("converter pair not supported")
)
View Source
var ConverterPairs = []ConverterPair{
	{
		Currencies: []FullCurrency{
			RUB_TINKOFF,
			USDT,
		},
	},
	{
		Currencies: []FullCurrency{
			USDT,
			KZT_KASPI,
		},
	},
}
View Source
var (
	ErrorBinanceApiInvalidConverterPair = errors.New("invalid converter pair")
)
View Source
var (
	ErrorContextErrorGettingUserIdFromContext = errors.New("error getting user id from context")
)
View Source
var (
	ErrorTransactionGetTransaction = errors.New("error get transaction")
)
View Source
var KZT_KASPI = FullCurrency{
	CurrencyType: CurrencyTypeClassic,
	CurrencyCode: "KZT",
	BankCode:     "KaspiBank",
}
View Source
var RUB_TINKOFF = FullCurrency{
	CurrencyType: CurrencyTypeClassic,
	CurrencyCode: "RUB",
	BankCode:     "TinkoffNew",
}
View Source
var USDT = FullCurrency{
	CurrencyType: CurrencyTypeCrypto,
	CurrencyCode: "USDT",
}

Functions

func ContextAddUserId

func ContextAddUserId(ctx context.Context, userId int) context.Context

func ContextGetUserId

func ContextGetUserId(ctx context.Context) (int, error)

func LogContext

func LogContext(ctx context.Context) *logrus.Fields

Types

type AddUser

type AddUser struct {
	ChatId       *int64
	UserName     *string
	FirstName    *string
	LastName     *string
	LanguageCode *string
}

type ConverterPair

type ConverterPair struct {
	Currencies []FullCurrency
}

type CurrencyBank

type CurrencyBank string

type CurrencyCode

type CurrencyCode string

type CurrencyType

type CurrencyType int32
const (
	CurrencyTypeCrypto  CurrencyType = 0
	CurrencyTypeClassic CurrencyType = 1
)

type Exchange

type Exchange float32

type FullCurrency

type FullCurrency struct {
	CurrencyType CurrencyType
	CurrencyCode CurrencyCode
	BankCode     CurrencyBank
}

type Plot

type Plot image.RGBA

type PlotParams

type PlotParams struct {
	ConverterPair ConverterPair
	TimeInterval  TimeInterval
}

type ServiceSignUpUserByTelegramData

type ServiceSignUpUserByTelegramData struct {
	ChatId       int64
	UserName     string
	FirstName    string
	LastName     string
	LanguageCode string
}

type ThresholdConvertPair

type ThresholdConvertPair struct {
	ConverterPair ConverterPair
	Exchange      Exchange
}

type TimeInterval

type TimeInterval timeInterval.Span

Jump to

Keyboard shortcuts

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