Documentation ¶
Index ¶
- Constants
- Variables
- func Init(ctx context.Context, service string) trace.Tracer
- func NewBalanceTracker() *model.BalanceTracker
- func ProcessWebhook(ctx context.Context, task *asynq.Task) error
- func SendWebhook(newWebhook NewWebhook) error
- type Blnk
- func (l Blnk) CommitInflightTransaction(ctx context.Context, transactionID string, amount int64) (*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) 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(cxt 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 (b Blnk) Search(collection string, query map[string]interface{}) (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 Queue
- type TransactionTypePayload
- type TypesenseClient
- func (client *TypesenseClient) CreateCollection(ctx context.Context, schema interface{}) (*resty.Response, error)
- func (client *TypesenseClient) IndexDocument(ctx context.Context, collection string, document interface{}) (*resty.Response, error)
- func (client *TypesenseClient) Search(ctx context.Context, collection string, searchParams map[string]interface{}) (*resty.Response, error)
- type TypesenseError
Constants ¶
View Source
const ( StatusQueued = "QUEUED" StatusApplied = "APPLIED" StatusScheduled = "SCHEDULED" StatusInflight = "INFLIGHT" StatusVoid = "VOID" )
View Source
const (
GeneralLedgerID = "general_ledger_id"
)
View Source
const NumberOfQueues = 5
View Source
const TRANSACTION_QUEUE = "new:transaction"
View Source
const WEBHOOK_QUEUE = "new:webhoook"
Variables ¶
View Source
var SQLFiles embed.FS
Functions ¶
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 ¶ added in v0.6.0
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 ¶
GetAccount retrieves an account from the database by ID.
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) 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(cxt 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) UpdateMonitor ¶
func (l Blnk) UpdateMonitor(monitor *model.BalanceMonitor) error
func (Blnk) UpdateTransactionStatus ¶
func (Blnk) VoidInflightTransaction ¶ added in v0.6.0
type NewWebhook ¶
type NewWebhook struct { Event string `json:"event"` Payload interface{} `json:"data"` }
type TransactionTypePayload ¶
type TransactionTypePayload struct {
Data model.Transaction
}
type TypesenseClient ¶ added in v0.6.0
func NewTypesenseClient ¶ added in v0.6.0
func NewTypesenseClient(apiKey string, hosts []string) *TypesenseClient
func (*TypesenseClient) CreateCollection ¶ added in v0.6.0
func (client *TypesenseClient) CreateCollection(ctx context.Context, schema interface{}) (*resty.Response, error)
func (*TypesenseClient) IndexDocument ¶ added in v0.6.0
func (client *TypesenseClient) IndexDocument(ctx context.Context, collection string, document interface{}) (*resty.Response, error)
type TypesenseError ¶ added in v0.6.0
type TypesenseError struct {
Message string `json:"message"`
}
Source Files ¶
Click to show internal directories.
Click to hide internal directories.