Documentation ¶
Index ¶
- type Driver
- type EntityManager
- type EntityManagerInterface
- type Repository
- func (r Repository) GetAllowedFiByDomain(domain string) (*entities.AllowedFi, error)
- func (r Repository) GetAllowedUserByDomainAndUserID(domain, userID string) (*entities.AllowedUser, error)
- func (r Repository) GetAuthData(requestID string) (*entities.AuthData, error)
- func (r Repository) GetAuthorizedTransactionByMemo(memo string) (*entities.AuthorizedTransaction, error)
- func (r Repository) GetLastCursorValue() (cursor *string, err error)
- func (r Repository) GetReceivedPaymentByOperationID(operationID int64) (*entities.ReceivedPayment, error)
- func (r Repository) GetReceivedPayments(page, limit int) ([]*entities.ReceivedPayment, error)
- func (r Repository) GetSentTransactionByPaymentID(paymentID string) (*entities.SentTransaction, error)
- func (r Repository) GetSentTransactions(page, limit int) ([]*entities.SentTransaction, error)
- type RepositoryInterface
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Driver ¶
type Driver interface { Init(url string) (err error) DB() *sqlx.DB MigrateUp(component string) (migrationsApplied int, err error) Insert(object entities.Entity) (id int64, err error) Update(object entities.Entity) (err error) Delete(object entities.Entity) (err error) GetOne(object entities.Entity, where string, params ...interface{}) (entities.Entity, error) GetMany(slice interface{}, where, order, offset, limit *string, params ...interface{}) (err error) }
Driver interface allows mocking database driver
type EntityManager ¶
type EntityManager struct {
// contains filtered or unexported fields
}
EntityManager is responsible for persisting object to DB
func NewEntityManager ¶
func NewEntityManager(driver Driver) (em EntityManager)
NewEntityManager creates a new EntityManager using driver
type EntityManagerInterface ¶
type EntityManagerInterface interface { Delete(object entities.Entity) (err error) Persist(object entities.Entity) error }
EntityManagerInterface allows mocking EntityManager
type Repository ¶
type Repository struct {
// contains filtered or unexported fields
}
Repository helps getting data from DB
func NewRepository ¶
func NewRepository(driver Driver) (r Repository)
NewRepository creates a new Repository using driver
func (Repository) GetAllowedFiByDomain ¶
func (r Repository) GetAllowedFiByDomain(domain string) (*entities.AllowedFi, error)
GetAllowedFiByDomain returns allowed FI by a domain
func (Repository) GetAllowedUserByDomainAndUserID ¶
func (r Repository) GetAllowedUserByDomainAndUserID(domain, userID string) (*entities.AllowedUser, error)
GetAllowedUserByDomainAndUserID returns allowed user by domain and userID
func (Repository) GetAuthData ¶
func (r Repository) GetAuthData(requestID string) (*entities.AuthData, error)
GetAuthData returns received auth data by request_id
func (Repository) GetAuthorizedTransactionByMemo ¶
func (r Repository) GetAuthorizedTransactionByMemo(memo string) (*entities.AuthorizedTransaction, error)
GetAuthorizedTransactionByMemo returns authorized transaction searching by memo
func (Repository) GetLastCursorValue ¶
func (r Repository) GetLastCursorValue() (cursor *string, err error)
GetLastCursorValue returns last cursor value from a DB
func (Repository) GetReceivedPaymentByOperationID ¶
func (r Repository) GetReceivedPaymentByOperationID(operationID int64) (*entities.ReceivedPayment, error)
GetReceivedPaymentByOperationID returns received payment by operation_id
func (Repository) GetReceivedPayments ¶
func (r Repository) GetReceivedPayments(page, limit int) ([]*entities.ReceivedPayment, error)
GetReceivedPayments returns received payments
func (Repository) GetSentTransactionByPaymentID ¶
func (r Repository) GetSentTransactionByPaymentID(paymentID string) (*entities.SentTransaction, error)
GetSentTransactionByPaymentID returns sent transaction searching by payment ID
func (Repository) GetSentTransactions ¶
func (r Repository) GetSentTransactions(page, limit int) ([]*entities.SentTransaction, error)
GetSentTransactions returns received payments
type RepositoryInterface ¶
type RepositoryInterface interface { GetLastCursorValue() (cursor *string, err error) GetAuthorizedTransactionByMemo(memo string) (*entities.AuthorizedTransaction, error) GetSentTransactionByPaymentID(paymentID string) (*entities.SentTransaction, error) GetAllowedFiByDomain(domain string) (*entities.AllowedFi, error) GetAllowedUserByDomainAndUserID(domain, userID string) (*entities.AllowedUser, error) GetAuthData(requestID string) (*entities.AuthData, error) GetReceivedPaymentByOperationID(operationID int64) (*entities.ReceivedPayment, error) GetReceivedPayments(page, limit int) ([]*entities.ReceivedPayment, error) GetSentTransactions(page, limit int) ([]*entities.SentTransaction, error) }
RepositoryInterface helps mocking Repository