Documentation
¶
Index ¶
- Constants
- Variables
- func EnsureCollectionsExist(client *TypesenseClient, ctx context.Context) error
- func Init(ctx context.Context, service string) trace.Tracer
- func NewBalanceTracker() *model.BalanceTracker
- func ProcessWebhook(_ context.Context, task *asynq.Task) error
- func SendWebhook(newWebhook NewWebhook) error
- type Blnk
- func (l *Blnk) CommitInflightTransaction(ctx context.Context, transactionID string, amount float64) (*model.Transaction, error)
- func (l *Blnk) CreateAccount(account model.Account) (model.Account, error)
- func (l *Blnk) CreateBalance(balance model.Balance) (model.Balance, error)
- func (l *Blnk) CreateIdentity(identity model.Identity) (model.Identity, error)
- func (l *Blnk) CreateLedger(ledger model.Ledger) (model.Ledger, error)
- func (l *Blnk) CreateMonitor(monitor model.BalanceMonitor) (model.BalanceMonitor, error)
- func (l *Blnk) DeleteIdentity(id string) error
- func (l *Blnk) DeleteMonitor(id string) error
- func (l *Blnk) GetAccount(id string, include []string) (*model.Account, error)
- func (l *Blnk) GetAccountByNumber(id string) (*model.Account, error)
- func (l *Blnk) GetAllAccounts() ([]model.Account, error)
- func (l *Blnk) GetAllBalances() ([]model.Balance, error)
- func (l *Blnk) GetAllIdentities() ([]model.Identity, error)
- func (l *Blnk) GetAllLedgers() ([]model.Ledger, error)
- func (l *Blnk) GetAllMonitors() ([]model.BalanceMonitor, error)
- func (l *Blnk) GetAllTransactions() ([]model.Transaction, error)
- func (l *Blnk) GetBalanceByID(id string, include []string) (*model.Balance, error)
- func (l *Blnk) GetBalanceByIndicator(indicator, currency string) (*model.Balance, error)
- func (l *Blnk) GetBalanceMonitors(balanceId string) ([]model.BalanceMonitor, error)
- func (l *Blnk) GetIdentity(id string) (*model.Identity, error)
- func (l *Blnk) GetLedgerByID(id string) (*model.Ledger, error)
- func (l *Blnk) GetMonitorByID(id string) (*model.BalanceMonitor, error)
- func (l *Blnk) GetTransaction(TransactionID string) (*model.Transaction, error)
- func (l *Blnk) GetTransactionByRef(cxt context.Context, reference string) (model.Transaction, error)
- func (l *Blnk) QueueTransaction(ctx context.Context, transaction *model.Transaction) (*model.Transaction, error)
- func (l *Blnk) RecordTransaction(ctx context.Context, transaction *model.Transaction) (*model.Transaction, error)
- func (l *Blnk) RefundTransaction(transactionID string) (*model.Transaction, error)
- func (l *Blnk) RejectTransaction(ctx context.Context, transaction *model.Transaction, reason string) (*model.Transaction, error)
- func (l *Blnk) Search(collection string, query *api.SearchCollectionParams) (interface{}, error)
- func (l *Blnk) UpdateIdentity(identity *model.Identity) error
- func (l *Blnk) UpdateMonitor(monitor *model.BalanceMonitor) error
- func (l *Blnk) UpdateTransactionStatus(id string, status string) error
- func (l *Blnk) VoidInflightTransaction(ctx context.Context, transactionID string) (*model.Transaction, error)
- type NewWebhook
- type NotificationPayload
- type Queue
- type TransactionTypePayload
- type TypesenseClient
- func (t *TypesenseClient) CreateCollection(ctx context.Context, schema *api.CollectionSchema) (*api.CollectionResponse, error)
- func (t *TypesenseClient) HandleNotification(table string, data map[string]interface{}) error
- func (t *TypesenseClient) Search(ctx context.Context, collection string, ...) (*api.SearchResult, error)
- type TypesenseError
Constants ¶
View Source
const ( StatusQueued = "QUEUED" StatusApplied = "APPLIED" StatusScheduled = "SCHEDULED" StatusInflight = "INFLIGHT" StatusVoid = "VOID" StatusRejected = "REJECTED" )
View Source
const EXPIREDINFLIGHT_QUEUE = "new:inflight-expiry"
View Source
const (
GeneralLedgerID = "general_ledger_id"
)
View Source
const NumberOfQueues = 20
View Source
const TRANSACTION_QUEUE = "new:transaction"
View Source
const WEBHOOK_QUEUE = "new:webhoook"
Variables ¶
View Source
var SQLFiles embed.FS
Functions ¶
func EnsureCollectionsExist ¶
func EnsureCollectionsExist(client *TypesenseClient, ctx context.Context) error
func NewBalanceTracker ¶
func NewBalanceTracker() *model.BalanceTracker
func SendWebhook ¶
func SendWebhook(newWebhook NewWebhook) error
Types ¶
type Blnk ¶
type Blnk struct {
// contains filtered or unexported fields
}
func (*Blnk) CommitInflightTransaction ¶
func (*Blnk) CreateAccount ¶
CreateAccount creates a new account in the database.
func (*Blnk) CreateBalance ¶
func (*Blnk) CreateIdentity ¶
func (*Blnk) CreateMonitor ¶
func (l *Blnk) CreateMonitor(monitor model.BalanceMonitor) (model.BalanceMonitor, error)
func (*Blnk) DeleteIdentity ¶
func (*Blnk) DeleteMonitor ¶
func (*Blnk) GetAccount ¶
func (*Blnk) GetAccountByNumber ¶
GetAccountByNumber retrieves an account from the database by ID.
func (*Blnk) GetAllAccounts ¶
GetAllAccounts retrieves all accounts from the database.
func (*Blnk) GetAllMonitors ¶
func (l *Blnk) GetAllMonitors() ([]model.BalanceMonitor, error)
func (*Blnk) GetAllTransactions ¶
func (l *Blnk) GetAllTransactions() ([]model.Transaction, error)
func (*Blnk) GetBalanceByID ¶
func (*Blnk) GetBalanceByIndicator ¶
func (*Blnk) GetBalanceMonitors ¶
func (l *Blnk) GetBalanceMonitors(balanceId string) ([]model.BalanceMonitor, error)
func (*Blnk) GetMonitorByID ¶
func (l *Blnk) GetMonitorByID(id string) (*model.BalanceMonitor, error)
func (*Blnk) GetTransaction ¶
func (l *Blnk) GetTransaction(TransactionID string) (*model.Transaction, error)
func (*Blnk) GetTransactionByRef ¶
func (*Blnk) QueueTransaction ¶
func (l *Blnk) QueueTransaction(ctx context.Context, transaction *model.Transaction) (*model.Transaction, error)
func (*Blnk) RecordTransaction ¶
func (l *Blnk) RecordTransaction(ctx context.Context, transaction *model.Transaction) (*model.Transaction, error)
func (*Blnk) RefundTransaction ¶
func (l *Blnk) RefundTransaction(transactionID string) (*model.Transaction, error)
func (*Blnk) RejectTransaction ¶
func (l *Blnk) RejectTransaction(ctx context.Context, transaction *model.Transaction, reason string) (*model.Transaction, error)
func (*Blnk) Search ¶
func (l *Blnk) Search(collection string, query *api.SearchCollectionParams) (interface{}, error)
func (*Blnk) UpdateMonitor ¶
func (l *Blnk) UpdateMonitor(monitor *model.BalanceMonitor) error
func (*Blnk) UpdateTransactionStatus ¶
func (*Blnk) VoidInflightTransaction ¶
type NewWebhook ¶
type NewWebhook struct { Event string `json:"event"` Payload interface{} `json:"data"` }
type NotificationPayload ¶
type TransactionTypePayload ¶
type TransactionTypePayload struct {
Data model.Transaction
}
type TypesenseClient ¶
func NewTypesenseClient ¶
func NewTypesenseClient(apiKey string, hosts []string) *TypesenseClient
func (*TypesenseClient) CreateCollection ¶
func (t *TypesenseClient) CreateCollection(ctx context.Context, schema *api.CollectionSchema) (*api.CollectionResponse, error)
func (*TypesenseClient) HandleNotification ¶
func (t *TypesenseClient) HandleNotification(table string, data map[string]interface{}) error
func (*TypesenseClient) Search ¶
func (t *TypesenseClient) Search(ctx context.Context, collection string, searchParams *api.SearchCollectionParams) (*api.SearchResult, error)
type TypesenseError ¶
type TypesenseError struct {
Message string `json:"message"`
}
Source Files
¶
Click to show internal directories.
Click to hide internal directories.