Documentation ¶
Index ¶
- Constants
- Variables
- func ContextAddUserId(ctx context.Context, userId int) context.Context
- func ContextGetUserId(ctx context.Context) (int, error)
- func LogContext(ctx context.Context) *logrus.Fields
- type AddUser
- type ConverterPair
- type CurrencyBank
- type CurrencyCode
- type CurrencyType
- type Exchange
- type FullCurrency
- type Plot
- type PlotParams
- type ServiceSignUpUserByTelegramData
- type ThresholdConvertPair
- type TimeInterval
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 ¶
Types ¶
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 FullCurrency ¶
type FullCurrency struct { CurrencyType CurrencyType CurrencyCode CurrencyCode BankCode CurrencyBank }
type PlotParams ¶
type PlotParams struct { ConverterPair ConverterPair TimeInterval TimeInterval }
type ThresholdConvertPair ¶
type ThresholdConvertPair struct { ConverterPair ConverterPair Exchange Exchange }
type TimeInterval ¶
type TimeInterval timeInterval.Span
Click to show internal directories.
Click to hide internal directories.