Documentation ¶
Index ¶
- Variables
- type BananoConversionFlow
- func (f *BananoConversionFlow) Converted() event.Event[BananoConvertedEventArgs]
- func (f *BananoConversionFlow) Destroyed() event.NoArgEvent
- func (f *BananoConversionFlow) Expiration() time.Time
- func (f *BananoConversionFlow) Expired() event.NoArgEvent
- func (f *BananoConversionFlow) PaymentAddress() string
- func (f *BananoConversionFlow) SessionBananoTotal() payment.Amount
- func (f *BananoConversionFlow) SessionPointsTotal() int
- type BananoConvertedEventArgs
- type Manager
- func (m *Manager) CreateOrRecoverBananoConversionFlow(user auth.User) (*BananoConversionFlow, error)
- func (m *Manager) CreateTransaction(ctxCtx context.Context, forUser auth.User, txType types.PointsTxType, ...) (*types.PointsTx, error)
- func (m *Manager) GetCurrentUserSubscription(ctxCtx context.Context, user auth.User) (*types.Subscription, error)
- func (m *Manager) IsUserCurrentlySubscribed(ctxCtx context.Context, user auth.User) (bool, error)
- func (m *Manager) OnTransactionCreated() event.Event[*types.PointsTx]
- func (m *Manager) OnTransactionUpdated() event.Event[TransactionUpdatedEventArgs]
- func (m *Manager) SubscribeOrExtendSubscription(ctxCtx context.Context, user auth.User) (*types.Subscription, error)
- type TransactionUpdatedEventArgs
- type TxExtraField
Constants ¶
This section is empty.
Variables ¶
BananoCostPerPoint is the cost of each point in Banano
Functions ¶
This section is empty.
Types ¶
type BananoConversionFlow ¶
type BananoConversionFlow struct {
// contains filtered or unexported fields
}
BananoConversionFlow represents a Banano to points conversion flow for one user
func (*BananoConversionFlow) Converted ¶
func (f *BananoConversionFlow) Converted() event.Event[BananoConvertedEventArgs]
func (*BananoConversionFlow) Destroyed ¶
func (f *BananoConversionFlow) Destroyed() event.NoArgEvent
func (*BananoConversionFlow) Expiration ¶
func (f *BananoConversionFlow) Expiration() time.Time
func (*BananoConversionFlow) Expired ¶
func (f *BananoConversionFlow) Expired() event.NoArgEvent
func (*BananoConversionFlow) PaymentAddress ¶
func (f *BananoConversionFlow) PaymentAddress() string
func (*BananoConversionFlow) SessionBananoTotal ¶
func (f *BananoConversionFlow) SessionBananoTotal() payment.Amount
func (*BananoConversionFlow) SessionPointsTotal ¶
func (f *BananoConversionFlow) SessionPointsTotal() int
type Manager ¶
type Manager struct {
// contains filtered or unexported fields
}
Manager manages user points
func New ¶
func New(workerContext context.Context, log *log.Logger, snowflakeNode *snowflake.Node, paymentAccountPool *payment.PaymentAccountPool) (*Manager, error)
New returns a new initialized Manager
func (*Manager) CreateOrRecoverBananoConversionFlow ¶
func (m *Manager) CreateOrRecoverBananoConversionFlow(user auth.User) (*BananoConversionFlow, error)
func (*Manager) CreateTransaction ¶
func (m *Manager) CreateTransaction(ctxCtx context.Context, forUser auth.User, txType types.PointsTxType, value int, extraFields ...TxExtraField) (*types.PointsTx, error)
CreateTransaction creates a points transaction
func (*Manager) GetCurrentUserSubscription ¶
func (*Manager) IsUserCurrentlySubscribed ¶
func (*Manager) OnTransactionCreated ¶
OnTransactionCreated returns the event that is fired when a points transaction is committed
func (*Manager) OnTransactionUpdated ¶
func (m *Manager) OnTransactionUpdated() event.Event[TransactionUpdatedEventArgs]
OnTransactionUpdated returns the event that is fired when a points transaction is updated (due to transaction collapsing)
func (*Manager) SubscribeOrExtendSubscription ¶
type TransactionUpdatedEventArgs ¶
TransactionUpdatedEventArgs are the arguments to the OnTransactionUpdated event
type TxExtraField ¶
TxExtraField represents an extra field for a transaction
Click to show internal directories.
Click to hide internal directories.