Documentation
¶
Index ¶
- Variables
- func GetComplianceAuditLog(includeChangeNotes bool, signIt bool) (model *models.ComplianceAuditLog)
- func GetSampleAPIKey(includeNulls bool) (model *models.APIKey)
- func GetSampleAccount(includeNulls bool, addIvms101 bool, addCrypto bool) (account *models.Account)
- func GetSampleContact(email string) (model *models.Contact)
- func GetSampleCounterparty(includeNulls bool, includeContacts bool) (model *models.Counterparty)
- func GetSampleCryptoAddress(accountId ulid.ULID) (account *models.CryptoAddress)
- func GetSamplePermission(id int64) (model *models.Permission)
- func GetSampleResetPasswordLink(includeNulls bool) (model *models.ResetPasswordLink)
- func GetSampleRole(id int64, includePermissions bool) (model *models.Role)
- func GetSampleSecureEnvelope(includeNulls bool, includeTransaction bool) (model *models.SecureEnvelope)
- func GetSampleSunrise(includeNulls bool) (model *models.Sunrise)
- func GetSampleTransaction(includeNulls bool, includeEnvelopes bool, archived bool) (model *models.Transaction)
- func GetSampleUser(includeNulls bool) (model *models.User)
- type MockScanner
- func (m *MockScanner) AssertNotScanned(t testing.TB, expected int)
- func (m *MockScanner) AssertScanned(t testing.TB, expected int)
- func (m *MockScanner) Log(t testing.TB)
- func (m *MockScanner) Reset()
- func (m *MockScanner) Scan(dest ...any) (err error)
- func (m *MockScanner) SetData(data []any)
- func (m *MockScanner) SetError(err error)
- type PreparedTransaction
- func (p *PreparedTransaction) AddCounterparty(model *models.Counterparty) error
- func (p *PreparedTransaction) AddEnvelope(model *models.SecureEnvelope) error
- func (p *PreparedTransaction) AssertCalls(t testing.TB, method string, expected int)
- func (p *PreparedTransaction) AssertCommit(t testing.TB)
- func (p *PreparedTransaction) AssertNoCommit(t testing.TB)
- func (p *PreparedTransaction) AssertNoRollback(t testing.TB)
- func (p *PreparedTransaction) AssertRollback(t testing.TB)
- func (p *PreparedTransaction) Commit() error
- func (p *PreparedTransaction) CreateSunrise(sunrise *models.Sunrise) error
- func (p *PreparedTransaction) Created() bool
- func (p *PreparedTransaction) Fetch() (*models.Transaction, error)
- func (p *PreparedTransaction) LookupCounterparty(field, value string) (*models.Counterparty, error)
- func (p *PreparedTransaction) OnAddCounterparty(fn func(*models.Counterparty) error)
- func (p *PreparedTransaction) OnAddEnvelope(fn func(*models.SecureEnvelope) error)
- func (p *PreparedTransaction) OnCommit(fn func() error)
- func (p *PreparedTransaction) OnCreateSunrise(fn func(sunrise *models.Sunrise) error)
- func (p *PreparedTransaction) OnCreated(fn func() bool)
- func (p *PreparedTransaction) OnFetch(fn func() (*models.Transaction, error))
- func (p *PreparedTransaction) OnLookupCounterparty(fn func(field, value string) (*models.Counterparty, error))
- func (p *PreparedTransaction) OnRollback(fn func() error)
- func (p *PreparedTransaction) OnUpdate(fn func(*models.Transaction) error)
- func (p *PreparedTransaction) OnUpdateCounterparty(fn func(counterparty *models.Counterparty) error)
- func (p *PreparedTransaction) OnUpdateSunrise(fn func(sunrise *models.Sunrise) error)
- func (p *PreparedTransaction) OnUpdateSunriseStatus(fn func(id uuid.UUID, status enum.Status) error)
- func (p *PreparedTransaction) Reset()
- func (p *PreparedTransaction) Rollback() error
- func (p *PreparedTransaction) Update(model *models.Transaction) error
- func (p *PreparedTransaction) UpdateCounterparty(counterparty *models.Counterparty) error
- func (p *PreparedTransaction) UpdateSunrise(sunrise *models.Sunrise) error
- func (p *PreparedTransaction) UpdateSunriseStatus(id uuid.UUID, status enum.Status) error
- type Store
- func (s *Store) ArchiveTransaction(ctx context.Context, id uuid.UUID) error
- func (s *Store) AssertCalls(t testing.TB, method string, expected int)
- func (s *Store) Begin(ctx context.Context, opts *sql.TxOptions) (txn.Txn, error)
- func (s *Store) Close() error
- func (s *Store) CountTransactions(ctx context.Context) (*models.TransactionCounts, error)
- func (s *Store) CreateAPIKey(ctx context.Context, in *models.APIKey) error
- func (s *Store) CreateAccount(ctx context.Context, in *models.Account) error
- func (s *Store) CreateComplianceAuditLog(ctx context.Context, log *models.ComplianceAuditLog) error
- func (s *Store) CreateContact(ctx context.Context, in *models.Contact) error
- func (s *Store) CreateCounterparty(ctx context.Context, in *models.Counterparty) error
- func (s *Store) CreateCryptoAddress(ctx context.Context, in *models.CryptoAddress) error
- func (s *Store) CreateResetPasswordLink(ctx context.Context, link *models.ResetPasswordLink) error
- func (s *Store) CreateSecureEnvelope(ctx context.Context, in *models.SecureEnvelope) error
- func (s *Store) CreateSunrise(ctx context.Context, msg *models.Sunrise) error
- func (s *Store) CreateTransaction(ctx context.Context, in *models.Transaction) error
- func (s *Store) CreateUser(ctx context.Context, in *models.User) error
- func (s *Store) DeleteAPIKey(ctx context.Context, keyID ulid.ULID) error
- func (s *Store) DeleteAccount(ctx context.Context, id ulid.ULID) error
- func (s *Store) DeleteContact(ctx context.Context, contactID, counterparty any) error
- func (s *Store) DeleteCounterparty(ctx context.Context, counterpartyID ulid.ULID) error
- func (s *Store) DeleteCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) error
- func (s *Store) DeleteResetPasswordLink(ctx context.Context, linkID ulid.ULID) (err error)
- func (s *Store) DeleteSecureEnvelope(ctx context.Context, txID uuid.UUID, envID ulid.ULID) error
- func (s *Store) DeleteSunrise(ctx context.Context, id ulid.ULID) error
- func (s *Store) DeleteTransaction(ctx context.Context, id uuid.UUID) error
- func (s *Store) DeleteUser(ctx context.Context, userID ulid.ULID) error
- func (s *Store) GetOrCreateSunriseCounterparty(ctx context.Context, email, name string) (*models.Counterparty, error)
- func (s *Store) LatestPayloadEnvelope(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
- func (s *Store) LatestSecureEnvelope(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
- func (s *Store) ListAPIKeys(ctx context.Context, in *models.PageInfo) (*models.APIKeyPage, error)
- func (s *Store) ListAccountTransactions(ctx context.Context, accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error)
- func (s *Store) ListAccounts(ctx context.Context, in *models.PageInfo) (*models.AccountsPage, error)
- func (s *Store) ListComplianceAuditLogs(ctx context.Context, page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error)
- func (s *Store) ListContacts(ctx context.Context, counterparty any, page *models.PageInfo) (*models.ContactsPage, error)
- func (s *Store) ListCounterparties(ctx context.Context, page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error)
- func (s *Store) ListCounterpartySourceInfo(ctx context.Context, source enum.Source) ([]*models.CounterpartySourceInfo, error)
- func (s *Store) ListCryptoAddresses(ctx context.Context, accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error)
- func (s *Store) ListResetPasswordLinks(ctx context.Context, page *models.PageInfo) (*models.ResetPasswordLinkPage, error)
- func (s *Store) ListSecureEnvelopes(ctx context.Context, txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error)
- func (s *Store) ListSunrise(ctx context.Context, page *models.PageInfo) (*models.SunrisePage, error)
- func (s *Store) ListTransactions(ctx context.Context, in *models.TransactionPageInfo) (*models.TransactionPage, error)
- func (s *Store) ListUsers(ctx context.Context, page *models.UserPageInfo) (*models.UserPage, error)
- func (s *Store) LookupAccount(ctx context.Context, cryptoAddress string) (*models.Account, error)
- func (s *Store) LookupCounterparty(ctx context.Context, field, value string) (*models.Counterparty, error)
- func (s *Store) LookupRole(ctx context.Context, role string) (*models.Role, error)
- func (s *Store) PrepareTransaction(ctx context.Context, id uuid.UUID) (models.PreparedTransaction, error)
- func (s *Store) Reset()
- func (s *Store) RetrieveAPIKey(ctx context.Context, clientIDOrKeyID any) (*models.APIKey, error)
- func (s *Store) RetrieveAccount(ctx context.Context, id ulid.ULID) (*models.Account, error)
- func (s *Store) RetrieveComplianceAuditLog(ctx context.Context, id ulid.ULID) (*models.ComplianceAuditLog, error)
- func (s *Store) RetrieveContact(ctx context.Context, contactID, counterparty any) (*models.Contact, error)
- func (s *Store) RetrieveCounterparty(ctx context.Context, counterpartyID ulid.ULID) (*models.Counterparty, error)
- func (s *Store) RetrieveCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error)
- func (s *Store) RetrieveResetPasswordLink(ctx context.Context, linkID ulid.ULID) (*models.ResetPasswordLink, error)
- func (s *Store) RetrieveSecureEnvelope(ctx context.Context, txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error)
- func (s *Store) RetrieveSunrise(ctx context.Context, id ulid.ULID) (*models.Sunrise, error)
- func (s *Store) RetrieveTransaction(ctx context.Context, id uuid.UUID) (*models.Transaction, error)
- func (s *Store) RetrieveUser(ctx context.Context, emailOrUserID any) (*models.User, error)
- func (s *Store) SearchCounterparties(ctx context.Context, query *models.SearchQuery) (*models.CounterpartyPage, error)
- func (s *Store) SetUserLastLogin(ctx context.Context, userID ulid.ULID, lastLogin time.Time) (err error)
- func (s *Store) SetUserPassword(ctx context.Context, userID ulid.ULID, password string) (err error)
- func (s *Store) TransactionState(ctx context.Context, id uuid.UUID) (bool, enum.Status, error)
- func (s *Store) UnarchiveTransaction(ctx context.Context, id uuid.UUID) error
- func (s *Store) UpdateAPIKey(ctx context.Context, in *models.APIKey) error
- func (s *Store) UpdateAccount(ctx context.Context, in *models.Account) error
- func (s *Store) UpdateContact(ctx context.Context, in *models.Contact) error
- func (s *Store) UpdateCounterparty(ctx context.Context, in *models.Counterparty) error
- func (s *Store) UpdateCryptoAddress(ctx context.Context, in *models.CryptoAddress) error
- func (s *Store) UpdateResetPasswordLink(ctx context.Context, link *models.ResetPasswordLink) error
- func (s *Store) UpdateSecureEnvelope(ctx context.Context, in *models.SecureEnvelope) error
- func (s *Store) UpdateSunrise(ctx context.Context, msg *models.Sunrise) error
- func (s *Store) UpdateSunriseStatus(ctx context.Context, txID uuid.UUID, status enum.Status) error
- func (s *Store) UpdateTransaction(ctx context.Context, in *models.Transaction) error
- func (s *Store) UpdateUser(ctx context.Context, in *models.User) error
- func (s *Store) UseTravelAddressFactory(f models.TravelAddressFactory)
- type Tx
- func (tx *Tx) ArchiveTransaction(id uuid.UUID) error
- func (tx *Tx) AssertCalls(t testing.TB, method string, expected int)
- func (tx *Tx) AssertCommit(t testing.TB)
- func (tx *Tx) AssertNoCommit(t testing.TB)
- func (tx *Tx) AssertNoRollback(t testing.TB)
- func (tx *Tx) AssertRollback(t testing.TB)
- func (tx *Tx) Commit() error
- func (tx *Tx) CountTransactions() (*models.TransactionCounts, error)
- func (tx *Tx) CreateAPIKey(in *models.APIKey) error
- func (tx *Tx) CreateAccount(in *models.Account) error
- func (tx *Tx) CreateComplianceAuditLog(log *models.ComplianceAuditLog) error
- func (tx *Tx) CreateContact(in *models.Contact) error
- func (tx *Tx) CreateCounterparty(in *models.Counterparty) error
- func (tx *Tx) CreateCryptoAddress(in *models.CryptoAddress) error
- func (tx *Tx) CreateDaybreak(counterparty *models.Counterparty) error
- func (tx *Tx) CreateResetPasswordLink(in *models.ResetPasswordLink) error
- func (tx *Tx) CreateSecureEnvelope(in *models.SecureEnvelope) error
- func (tx *Tx) CreateSunrise(in *models.Sunrise) error
- func (tx *Tx) CreateTransaction(in *models.Transaction) error
- func (tx *Tx) CreateUser(in *models.User) error
- func (tx *Tx) DeleteAPIKey(keyID ulid.ULID) error
- func (tx *Tx) DeleteAccount(id ulid.ULID) error
- func (tx *Tx) DeleteContact(contactID, counterpartyID any) error
- func (tx *Tx) DeleteCounterparty(counterpartyID ulid.ULID) error
- func (tx *Tx) DeleteCryptoAddress(accountID, cryptoAddressID ulid.ULID) error
- func (tx *Tx) DeleteDaybreak(counterpartyID ulid.ULID, ignoreTxns bool) error
- func (tx *Tx) DeleteResetPasswordLink(id ulid.ULID) error
- func (tx *Tx) DeleteSecureEnvelope(txID uuid.UUID, envID ulid.ULID) error
- func (tx *Tx) DeleteSunrise(in ulid.ULID) error
- func (tx *Tx) DeleteTransaction(id uuid.UUID) error
- func (tx *Tx) DeleteUser(userID ulid.ULID) error
- func (tx *Tx) GetOrCreateSunriseCounterparty(email, name string) (*models.Counterparty, error)
- func (tx *Tx) LatestPayloadEnvelope(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
- func (tx *Tx) LatestSecureEnvelope(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
- func (tx *Tx) ListAPIKeys(page *models.PageInfo) (*models.APIKeyPage, error)
- func (tx *Tx) ListAccountTransactions(accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error)
- func (tx *Tx) ListAccounts(page *models.PageInfo) (*models.AccountsPage, error)
- func (tx *Tx) ListComplianceAuditLogs(page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error)
- func (tx *Tx) ListContacts(counterparty any, page *models.PageInfo) (*models.ContactsPage, error)
- func (tx *Tx) ListCounterparties(page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error)
- func (tx *Tx) ListCounterpartySourceInfo(source enum.Source) ([]*models.CounterpartySourceInfo, error)
- func (tx *Tx) ListCryptoAddresses(accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error)
- func (tx *Tx) ListDaybreak() (map[string]*models.CounterpartySourceInfo, error)
- func (tx *Tx) ListResetPasswordLinks(page *models.PageInfo) (*models.ResetPasswordLinkPage, error)
- func (tx *Tx) ListSecureEnvelopes(txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error)
- func (tx *Tx) ListSunrise(in *models.PageInfo) (*models.SunrisePage, error)
- func (tx *Tx) ListTransactions(in *models.TransactionPageInfo) (*models.TransactionPage, error)
- func (tx *Tx) ListUsers(page *models.UserPageInfo) (*models.UserPage, error)
- func (tx *Tx) LookupAccount(cryptoAddress string) (*models.Account, error)
- func (tx *Tx) LookupCounterparty(field, value string) (*models.Counterparty, error)
- func (tx *Tx) LookupRole(role string) (*models.Role, error)
- func (tx *Tx) OnArchiveTransaction(fn func(id uuid.UUID) error)
- func (tx *Tx) OnCommit(fn func() error)
- func (tx *Tx) OnCountTransactions(fn func() (*models.TransactionCounts, error))
- func (tx *Tx) OnCreateAPIKey(fn func(in *models.APIKey) error)
- func (tx *Tx) OnCreateAccount(fn func(in *models.Account) error)
- func (tx *Tx) OnCreateComplianceAuditLog(fn func(log *models.ComplianceAuditLog) error)
- func (tx *Tx) OnCreateContact(fn func(in *models.Contact) error)
- func (tx *Tx) OnCreateCounterparty(fn func(in *models.Counterparty) error)
- func (tx *Tx) OnCreateCryptoAddress(fn func(in *models.CryptoAddress) error)
- func (tx *Tx) OnCreateDaybreak(fn func(counterparty *models.Counterparty) error)
- func (tx *Tx) OnCreateResetPasswordLink(fn func(in *models.ResetPasswordLink) error)
- func (tx *Tx) OnCreateSecureEnvelope(fn func(in *models.SecureEnvelope) error)
- func (tx *Tx) OnCreateSunrise(fn func(in *models.Sunrise) error)
- func (tx *Tx) OnCreateTransaction(fn func(in *models.Transaction) error)
- func (tx *Tx) OnCreateUser(fn func(in *models.User) error)
- func (tx *Tx) OnDeleteAPIKey(fn func(keyID ulid.ULID) error)
- func (tx *Tx) OnDeleteAccount(fn func(id ulid.ULID) error)
- func (tx *Tx) OnDeleteContact(fn func(contactID, counterpartyID any) error)
- func (tx *Tx) OnDeleteCounterparty(fn func(counterpartyID ulid.ULID) error)
- func (tx *Tx) OnDeleteCryptoAddress(fn func(accountID, cryptoAddressID ulid.ULID) error)
- func (tx *Tx) OnDeleteDaybreak(fn func(counterpartyID ulid.ULID, ignoreTxns bool) error)
- func (tx *Tx) OnDeleteResetPasswordLink(fn func(id ulid.ULID) error)
- func (tx *Tx) OnDeleteSecureEnvelope(fn func(txID uuid.UUID, envID ulid.ULID) error)
- func (tx *Tx) OnDeleteSunrise(fn func(in ulid.ULID) error)
- func (tx *Tx) OnDeleteTransaction(fn func(id uuid.UUID) error)
- func (tx *Tx) OnDeleteUser(fn func(userID ulid.ULID) error)
- func (tx *Tx) OnGetOrCreateSunriseCounterparty(fn func(email, name string) (*models.Counterparty, error))
- func (tx *Tx) OnLatestPayloadEnvelope(...)
- func (tx *Tx) OnLatestSecureEnvelope(...)
- func (tx *Tx) OnListAPIKeys(fn func(page *models.PageInfo) (*models.APIKeyPage, error))
- func (tx *Tx) OnListAccountTransactions(...)
- func (tx *Tx) OnListAccounts(fn func(page *models.PageInfo) (*models.AccountsPage, error))
- func (tx *Tx) OnListComplianceAuditLogs(...)
- func (tx *Tx) OnListContacts(fn func(counterparty any, page *models.PageInfo) (*models.ContactsPage, error))
- func (tx *Tx) OnListCounterparties(fn func(page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error))
- func (tx *Tx) OnListCounterpartySourceInfo(fn func(source enum.Source) ([]*models.CounterpartySourceInfo, error))
- func (tx *Tx) OnListCryptoAddresses(...)
- func (tx *Tx) OnListDaybreak(fn func() (map[string]*models.CounterpartySourceInfo, error))
- func (tx *Tx) OnListResetPasswordLinks(fn func(page *models.PageInfo) (*models.ResetPasswordLinkPage, error))
- func (tx *Tx) OnListSecureEnvelopes(...)
- func (tx *Tx) OnListSunrise(fn func(in *models.PageInfo) (*models.SunrisePage, error))
- func (tx *Tx) OnListTransactions(fn func(in *models.TransactionPageInfo) (*models.TransactionPage, error))
- func (tx *Tx) OnListUsers(fn func(page *models.UserPageInfo) (*models.UserPage, error))
- func (tx *Tx) OnLookupAccount(fn func(cryptoAddress string) (*models.Account, error))
- func (tx *Tx) OnLookupCounterparty(fn func(field, value string) (*models.Counterparty, error))
- func (tx *Tx) OnLookupRole(fn func(role string) (*models.Role, error))
- func (tx *Tx) OnRetrieveAPIKey(fn func(clientIDOrKeyID any) (*models.APIKey, error))
- func (tx *Tx) OnRetrieveAccount(fn func(id ulid.ULID) (*models.Account, error))
- func (tx *Tx) OnRetrieveComplianceAuditLog(fn func(id ulid.ULID) (*models.ComplianceAuditLog, error))
- func (tx *Tx) OnRetrieveContact(fn func(contactID, counterpartyID any) (*models.Contact, error))
- func (tx *Tx) OnRetrieveCounterparty(fn func(counterpartyID ulid.ULID) (*models.Counterparty, error))
- func (tx *Tx) OnRetrieveCryptoAddress(fn func(accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error))
- func (tx *Tx) OnRetrieveResetPasswordLink(fn func(id ulid.ULID) (*models.ResetPasswordLink, error))
- func (tx *Tx) OnRetrieveSecureEnvelope(fn func(txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error))
- func (tx *Tx) OnRetrieveSunrise(fn func(id ulid.ULID) (*models.Sunrise, error))
- func (tx *Tx) OnRetrieveTransaction(fn func(id uuid.UUID) (*models.Transaction, error))
- func (tx *Tx) OnRetrieveUser(fn func(emailOrUserID any) (*models.User, error))
- func (tx *Tx) OnRollback(fn func() error)
- func (tx *Tx) OnSearchCounterparties(fn func(query *models.SearchQuery) (*models.CounterpartyPage, error))
- func (tx *Tx) OnSetUserLastLogin(fn func(userID ulid.ULID, lastLogin time.Time) error)
- func (tx *Tx) OnSetUserPassword(fn func(userID ulid.ULID, password string) error)
- func (tx *Tx) OnTransactionState(fn func(id uuid.UUID) (bool, enum.Status, error))
- func (tx *Tx) OnUnarchiveTransaction(fn func(id uuid.UUID) error)
- func (tx *Tx) OnUpdateAPIKey(fn func(in *models.APIKey) error)
- func (tx *Tx) OnUpdateAccount(fn func(in *models.Account) error)
- func (tx *Tx) OnUpdateContact(fn func(in *models.Contact) error)
- func (tx *Tx) OnUpdateCounterparty(fn func(in *models.Counterparty) error)
- func (tx *Tx) OnUpdateCryptoAddress(fn func(in *models.CryptoAddress) error)
- func (tx *Tx) OnUpdateDaybreak(fn func(counterparty *models.Counterparty) error)
- func (tx *Tx) OnUpdateResetPasswordLink(fn func(in *models.ResetPasswordLink) error)
- func (tx *Tx) OnUpdateSecureEnvelope(fn func(in *models.SecureEnvelope) error)
- func (tx *Tx) OnUpdateSunrise(fn func(in *models.Sunrise) error)
- func (tx *Tx) OnUpdateSunriseStatus(fn func(id uuid.UUID, status enum.Status) error)
- func (tx *Tx) OnUpdateTransaction(fn func(in *models.Transaction) error)
- func (tx *Tx) OnUpdateUser(fn func(in *models.User) error)
- func (tx *Tx) Reset()
- func (tx *Tx) RetrieveAPIKey(clientIDOrKeyID any) (*models.APIKey, error)
- func (tx *Tx) RetrieveAccount(id ulid.ULID) (*models.Account, error)
- func (tx *Tx) RetrieveComplianceAuditLog(id ulid.ULID) (*models.ComplianceAuditLog, error)
- func (tx *Tx) RetrieveContact(contactID, counterpartyID any) (*models.Contact, error)
- func (tx *Tx) RetrieveCounterparty(counterpartyID ulid.ULID) (*models.Counterparty, error)
- func (tx *Tx) RetrieveCryptoAddress(accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error)
- func (tx *Tx) RetrieveResetPasswordLink(id ulid.ULID) (*models.ResetPasswordLink, error)
- func (tx *Tx) RetrieveSecureEnvelope(txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error)
- func (tx *Tx) RetrieveSunrise(id ulid.ULID) (*models.Sunrise, error)
- func (tx *Tx) RetrieveTransaction(id uuid.UUID) (*models.Transaction, error)
- func (tx *Tx) RetrieveUser(emailOrUserID any) (*models.User, error)
- func (tx *Tx) Rollback() error
- func (tx *Tx) SearchCounterparties(query *models.SearchQuery) (*models.CounterpartyPage, error)
- func (tx *Tx) SetUserLastLogin(userID ulid.ULID, lastLogin time.Time) error
- func (tx *Tx) SetUserPassword(userID ulid.ULID, password string) error
- func (tx *Tx) TransactionState(id uuid.UUID) (bool, enum.Status, error)
- func (tx *Tx) UnarchiveTransaction(id uuid.UUID) error
- func (tx *Tx) UpdateAPIKey(in *models.APIKey) error
- func (tx *Tx) UpdateAccount(in *models.Account) error
- func (tx *Tx) UpdateContact(in *models.Contact) error
- func (tx *Tx) UpdateCounterparty(in *models.Counterparty) error
- func (tx *Tx) UpdateCryptoAddress(in *models.CryptoAddress) error
- func (tx *Tx) UpdateDaybreak(counterparty *models.Counterparty) error
- func (tx *Tx) UpdateResetPasswordLink(in *models.ResetPasswordLink) error
- func (tx *Tx) UpdateSecureEnvelope(in *models.SecureEnvelope) error
- func (tx *Tx) UpdateSunrise(in *models.Sunrise) error
- func (tx *Tx) UpdateSunriseStatus(id uuid.UUID, status enum.Status) error
- func (tx *Tx) UpdateTransaction(in *models.Transaction) error
- func (tx *Tx) UpdateUser(in *models.User) error
Constants ¶
This section is empty.
Variables ¶
var ( ErrNilPtr = errors.New("destination pointer is nil") ErrUnknownType = errors.New("unknown type for conversion: reflection required") )
Functions ¶
func GetComplianceAuditLog ¶ added in v1.1.0
func GetComplianceAuditLog(includeChangeNotes bool, signIt bool) (model *models.ComplianceAuditLog)
Returns a sample ComplianceAuditLog. ChangeNotes is optional, as is signing it before returning.
func GetSampleAPIKey ¶ added in v1.1.0
Returns a sample APIKey. Can include or exclude any `NullType` types. The client id and secret will be random ULID strings.
func GetSampleAccount ¶ added in v1.1.0
Returns a sample Account. Can add the IVMS101 and CryptoAddresses and include or exclude `NullType` values. `zeroID` returns the model with a zeroed ULID.
func GetSampleContact ¶ added in v1.1.0
Returns a sample Contact.
func GetSampleCounterparty ¶ added in v1.1.0
func GetSampleCounterparty(includeNulls bool, includeContacts bool) (model *models.Counterparty)
Returns a sample Counterparty. This counterparty will be unique, using it's ID for the CommonName and Endpoint ("ULID_STRING.sample.example.com").
func GetSampleCryptoAddress ¶ added in v1.1.0
func GetSampleCryptoAddress(accountId ulid.ULID) (account *models.CryptoAddress)
Returns a sample CryptoAddress for the account ID provided. The crypto and travel addresses will be a random ULID strings and the network is "BTC".
func GetSamplePermission ¶ added in v1.1.0
func GetSamplePermission(id int64) (model *models.Permission)
Returns a sample Permission.
func GetSampleResetPasswordLink ¶ added in v1.1.0
func GetSampleResetPasswordLink(includeNulls bool) (model *models.ResetPasswordLink)
Returns a sample ResetPasswordLink. Can include or exclude any `NullType` types.
func GetSampleRole ¶ added in v1.1.0
Returns a sample Role. Can include sample Permissions with it.
func GetSampleSecureEnvelope ¶ added in v1.1.0
func GetSampleSecureEnvelope(includeNulls bool, includeTransaction bool) (model *models.SecureEnvelope)
Returns a sample SecureEnvelope.
func GetSampleSunrise ¶ added in v1.1.0
Returns a sample Sunrise. It won't have a signature unless includeNulls is true, and the email will be unique on the message ID.
func GetSampleTransaction ¶ added in v1.1.0
func GetSampleTransaction(includeNulls bool, includeEnvelopes bool, archived bool) (model *models.Transaction)
Returns a sample Transaction. The counterparty, beneficiary, originator, and crypto addresses are unique using the ID of the returned model.
func GetSampleUser ¶ added in v1.1.0
Returns a sample User. Can include or exclude any `NullType` types. `zeroID` returns the model with a zeroed ULID.
Types ¶
type MockScanner ¶ added in v1.1.0
type MockScanner struct {
// contains filtered or unexported fields
}
MockScanner allows testing `Scan` interfaces for models. You can add an error to return or the data items you wish to scan into a model using `SetError()` or `SetData()`.
func (*MockScanner) AssertNotScanned ¶ added in v1.1.0
func (m *MockScanner) AssertNotScanned(t testing.TB, expected int)
Assert that the expected number of `data` items were *not* scanned (ignored/nil).
func (*MockScanner) AssertScanned ¶ added in v1.1.0
func (m *MockScanner) AssertScanned(t testing.TB, expected int)
Assert that the expected number of `data` items were scanned successfully.
func (*MockScanner) Log ¶ added in v1.1.0
func (m *MockScanner) Log(t testing.TB)
Logs any test log messages that were recorded during the test; then clears the log.
func (*MockScanner) Reset ¶ added in v1.1.0
func (m *MockScanner) Reset()
Resets the MockScanner to it's original state.
func (*MockScanner) Scan ¶ added in v1.1.0
func (m *MockScanner) Scan(dest ...any) (err error)
Scan will return an error if set, otherwise it will check that the lengths of `dest` and the `data` are equal and then attempt to scan each `data` item into the `dest` item with the same index, returning any errors.
func (*MockScanner) SetData ¶ added in v1.1.0
func (m *MockScanner) SetData(data []any)
Sets data to be scanned into the destinations given when `Scan()` is called. SetData will panic if `err` is already set.
func (*MockScanner) SetError ¶ added in v1.1.0
func (m *MockScanner) SetError(err error)
Sets an error to be returned from the scanner when `Scan()` is called. SetError will panic if `data` is already set.
type PreparedTransaction ¶
type PreparedTransaction struct {
// contains filtered or unexported fields
}
func (*PreparedTransaction) AddCounterparty ¶
func (p *PreparedTransaction) AddCounterparty(model *models.Counterparty) error
Calls the callback previously set with "OnAddCounterparty()".
func (*PreparedTransaction) AddEnvelope ¶
func (p *PreparedTransaction) AddEnvelope(model *models.SecureEnvelope) error
Calls the callback previously set with "OnAddEnvelope()".
func (*PreparedTransaction) AssertCalls ¶ added in v1.1.0
func (p *PreparedTransaction) AssertCalls(t testing.TB, method string, expected int)
Assert that the expected number of calls were made to the given method.
func (*PreparedTransaction) AssertCommit ¶ added in v1.1.0
func (p *PreparedTransaction) AssertCommit(t testing.TB)
Assert that Commit has been called on the transaction without rollback.
func (*PreparedTransaction) AssertNoCommit ¶ added in v1.1.0
func (p *PreparedTransaction) AssertNoCommit(t testing.TB)
Assert that Commit has not been called on the transaction.
func (*PreparedTransaction) AssertNoRollback ¶ added in v1.1.0
func (p *PreparedTransaction) AssertNoRollback(t testing.TB)
Assert that Rollback has not been called on the transaction.
func (*PreparedTransaction) AssertRollback ¶ added in v1.1.0
func (p *PreparedTransaction) AssertRollback(t testing.TB)
Assert that Rollback has been called on the transaction without commit.
func (*PreparedTransaction) Commit ¶
func (p *PreparedTransaction) Commit() error
Calls the callback previously set with "OnCommit()". If no callback is set, it will "commit" the transaction.
func (*PreparedTransaction) CreateSunrise ¶ added in v1.1.0
func (p *PreparedTransaction) CreateSunrise(sunrise *models.Sunrise) error
Calls the callback previously set with "OnCreateSunrise()".
func (*PreparedTransaction) Created ¶
func (p *PreparedTransaction) Created() bool
Calls the callback previously set with "OnCreated()".
func (*PreparedTransaction) Fetch ¶
func (p *PreparedTransaction) Fetch() (*models.Transaction, error)
Calls the callback previously set with "OnFetch()".
func (*PreparedTransaction) LookupCounterparty ¶ added in v1.1.0
func (p *PreparedTransaction) LookupCounterparty(field, value string) (*models.Counterparty, error)
Calls the callback previously set with "OnLookupCounterparty()".
func (*PreparedTransaction) OnAddCounterparty ¶ added in v1.1.0
func (p *PreparedTransaction) OnAddCounterparty(fn func(*models.Counterparty) error)
Sets a callback for when "AddCounterparty()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnAddEnvelope ¶ added in v1.1.0
func (p *PreparedTransaction) OnAddEnvelope(fn func(*models.SecureEnvelope) error)
Sets a callback for when "AddEnvelope()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnCommit ¶ added in v1.1.0
func (p *PreparedTransaction) OnCommit(fn func() error)
Sets a callback for when "Commit()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnCreateSunrise ¶ added in v1.1.0
func (p *PreparedTransaction) OnCreateSunrise(fn func(sunrise *models.Sunrise) error)
Sets a callback for when "CreateSunrise()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnCreated ¶ added in v1.1.0
func (p *PreparedTransaction) OnCreated(fn func() bool)
Sets a callback for when "Created()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnFetch ¶ added in v1.1.0
func (p *PreparedTransaction) OnFetch(fn func() (*models.Transaction, error))
Sets a callback for when "Fetch()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnLookupCounterparty ¶ added in v1.1.0
func (p *PreparedTransaction) OnLookupCounterparty(fn func(field, value string) (*models.Counterparty, error))
Sets a callback for when "LookupCounterparty()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnRollback ¶ added in v1.1.0
func (p *PreparedTransaction) OnRollback(fn func() error)
Sets a callback for when "Rollback()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnUpdate ¶ added in v1.1.0
func (p *PreparedTransaction) OnUpdate(fn func(*models.Transaction) error)
Sets a callback for when "Update()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnUpdateCounterparty ¶ added in v1.1.0
func (p *PreparedTransaction) OnUpdateCounterparty(fn func(counterparty *models.Counterparty) error)
Sets a callback for when "UpdateCounterparty()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnUpdateSunrise ¶ added in v1.1.0
func (p *PreparedTransaction) OnUpdateSunrise(fn func(sunrise *models.Sunrise) error)
Sets a callback for when "UpdateSunrise()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) OnUpdateSunriseStatus ¶ added in v1.1.0
func (p *PreparedTransaction) OnUpdateSunriseStatus(fn func(id uuid.UUID, status enum.Status) error)
Sets a callback for when "UpdateSunriseStatus()" is called on the mock PreparedTransaction.
func (*PreparedTransaction) Reset ¶ added in v1.1.0
func (p *PreparedTransaction) Reset()
Reset all the calls and callbacks in the PreparedTransaction, if you don't want to create a new one.
func (*PreparedTransaction) Rollback ¶
func (p *PreparedTransaction) Rollback() error
Calls the callback previously set with "OnRollback()". If no callback is set, it will "rollback" the transaction.
func (*PreparedTransaction) Update ¶
func (p *PreparedTransaction) Update(model *models.Transaction) error
Calls the callback previously set with "OnUpdate()".
func (*PreparedTransaction) UpdateCounterparty ¶ added in v1.1.0
func (p *PreparedTransaction) UpdateCounterparty(counterparty *models.Counterparty) error
Calls the callback previously set with "OnUpdateCounterparty()".
func (*PreparedTransaction) UpdateSunrise ¶ added in v1.1.0
func (p *PreparedTransaction) UpdateSunrise(sunrise *models.Sunrise) error
Calls the callback previously set with "OnUpdateSunrise()".
func (*PreparedTransaction) UpdateSunriseStatus ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateSunriseStatus()".
type Store ¶
type Store struct {
OnClose func() error
OnBegin func(context.Context, *sql.TxOptions) (txn.Txn, error)
OnListTransactions func(ctx context.Context, in *models.TransactionPageInfo) (*models.TransactionPage, error)
OnCreateTransaction func(ctx context.Context, in *models.Transaction) error
OnRetrieveTransaction func(ctx context.Context, id uuid.UUID) (*models.Transaction, error)
OnUpdateTransaction func(ctx context.Context, in *models.Transaction) error
OnDeleteTransaction func(ctx context.Context, id uuid.UUID) error
OnArchiveTransaction func(ctx context.Context, id uuid.UUID) error
OnUnarchiveTransaction func(ctx context.Context, id uuid.UUID) error
OnCountTransactions func(ctx context.Context) (*models.TransactionCounts, error)
OnPrepareTransaction func(ctx context.Context, id uuid.UUID) (models.PreparedTransaction, error)
OnTransactionState func(ctx context.Context, id uuid.UUID) (bool, enum.Status, error)
OnListSecureEnvelopes func(ctx context.Context, txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error)
OnCreateSecureEnvelope func(ctx context.Context, in *models.SecureEnvelope) error
OnRetrieveSecureEnvelope func(ctx context.Context, txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error)
OnUpdateSecureEnvelope func(ctx context.Context, in *models.SecureEnvelope) error
OnDeleteSecureEnvelope func(ctx context.Context, txID uuid.UUID, envID ulid.ULID) error
OnLatestSecureEnvelope func(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
OnLatestPayloadEnvelope func(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
OnListAccounts func(ctx context.Context, in *models.PageInfo) (*models.AccountsPage, error)
OnCreateAccount func(ctx context.Context, in *models.Account) error
OnLookupAccount func(ctx context.Context, cryptoAddress string) (*models.Account, error)
OnRetrieveAccount func(ctx context.Context, id ulid.ULID) (*models.Account, error)
OnUpdateAccount func(ctx context.Context, in *models.Account) error
OnDeleteAccount func(ctx context.Context, id ulid.ULID) error
OnListAccountTransactions func(ctx context.Context, accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error)
OnListCryptoAddresses func(ctx context.Context, accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error)
OnCreateCryptoAddress func(ctx context.Context, in *models.CryptoAddress) error
OnRetrieveCryptoAddress func(ctx context.Context, accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error)
OnUpdateCryptoAddress func(ctx context.Context, in *models.CryptoAddress) error
OnDeleteCryptoAddress func(ctx context.Context, accountID, cryptoAddressID ulid.ULID) error
OnSearchCounterparties func(ctx context.Context, query *models.SearchQuery) (*models.CounterpartyPage, error)
OnListCounterparties func(ctx context.Context, page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error)
OnListCounterpartySourceInfo func(ctx context.Context, source enum.Source) ([]*models.CounterpartySourceInfo, error)
OnCreateCounterparty func(ctx context.Context, in *models.Counterparty) error
OnRetrieveCounterparty func(ctx context.Context, counterpartyID ulid.ULID) (*models.Counterparty, error)
OnLookupCounterparty func(ctx context.Context, field, value string) (*models.Counterparty, error)
OnUpdateCounterparty func(ctx context.Context, in *models.Counterparty) error
OnDeleteCounterparty func(ctx context.Context, counterpartyID ulid.ULID) error
OnListContacts func(ctx context.Context, counterparty any, page *models.PageInfo) (*models.ContactsPage, error)
OnCreateContact func(ctx context.Context, in *models.Contact) error
OnRetrieveContact func(ctx context.Context, contactID, counterparty any) (*models.Contact, error)
OnUpdateContact func(ctx context.Context, in *models.Contact) error
OnDeleteContact func(ctx context.Context, contactID, counterparty any) error
OnUseTravelAddressFactory func(models.TravelAddressFactory)
OnListSunrise func(ctx context.Context, page *models.PageInfo) (*models.SunrisePage, error)
OnCreateSunrise func(ctx context.Context, msg *models.Sunrise) error
OnRetrieveSunrise func(ctx context.Context, id ulid.ULID) (*models.Sunrise, error)
OnUpdateSunrise func(ctx context.Context, msg *models.Sunrise) error
OnUpdateSunriseStatus func(ctx context.Context, txID uuid.UUID, status enum.Status) error
OnDeleteSunrise func(ctx context.Context, id ulid.ULID) error
OnGetOrCreateSunriseCounterparty func(ctx context.Context, email, name string) (*models.Counterparty, error)
OnListUsers func(ctx context.Context, page *models.UserPageInfo) (*models.UserPage, error)
OnCreateUser func(ctx context.Context, in *models.User) error
OnRetrieveUser func(ctx context.Context, emailOrUserID any) (*models.User, error)
OnUpdateUser func(ctx context.Context, in *models.User) error
OnSetUserPassword func(ctx context.Context, userID ulid.ULID, password string) (err error)
OnSetUserLastLogin func(ctx context.Context, userID ulid.ULID, lastLogin time.Time) (err error)
OnDeleteUser func(ctx context.Context, userID ulid.ULID) error
OnLookupRole func(ctx context.Context, role string) (*models.Role, error)
OnListAPIKeys func(ctx context.Context, in *models.PageInfo) (*models.APIKeyPage, error)
OnCreateAPIKey func(ctx context.Context, in *models.APIKey) error
OnRetrieveAPIKey func(ctx context.Context, clientIDOrKeyID any) (*models.APIKey, error)
OnUpdateAPIKey func(ctx context.Context, in *models.APIKey) error
OnDeleteAPIKey func(ctx context.Context, keyID ulid.ULID) error
OnListResetPasswordLinks func(ctx context.Context, page *models.PageInfo) (*models.ResetPasswordLinkPage, error)
OnCreateResetPasswordLink func(ctx context.Context, link *models.ResetPasswordLink) error
OnRetrieveResetPasswordLink func(ctx context.Context, linkID ulid.ULID) (*models.ResetPasswordLink, error)
OnUpdateResetPasswordLink func(ctx context.Context, link *models.ResetPasswordLink) error
OnDeleteResetPasswordLink func(ctx context.Context, linkID ulid.ULID) (err error)
OnListComplianceAuditLogs func(ctx context.Context, page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error)
OnCreateComplianceAuditLog func(ctx context.Context, log *models.ComplianceAuditLog) error
OnRetrieveComplianceAuditLog func(ctx context.Context, id ulid.ULID) (*models.ComplianceAuditLog, error)
// contains filtered or unexported fields
}
Store implements the store.Store interface with callback functions that the tester can specify to simulate a specific behavior. The Store is not thread-safe and one mock store should be used per test. To set a callback for `Store.Function()`, set the `Store.OnFunction` stub to your desired callback function.
func Open ¶
Open a new mock store. Generally, the nil uri can be used to create the mock; otherwise a DSN with the mock scheme can be used.
func (*Store) ArchiveTransaction ¶ added in v0.29.0
Calls the callback previously set with `s.OnArchiveTransaction = ...`
func (*Store) AssertCalls ¶ added in v1.1.0
Assert that the expected number of calls were made to the given method.
func (*Store) Begin ¶ added in v1.1.0
If present, calls the callback previously set for "Begin()" (set the callback with "OnBegin()"), otherwise returns a `Txn` mock.
func (*Store) Close ¶
If present, calls the callback previously set for "Close()" (set the callback with "OnClose()"), otherwise returns `nil` indicating success.
func (*Store) CountTransactions ¶ added in v1.0.0
Calls the callback previously set with `s.OnCountTransactions = ...`
func (*Store) CreateAPIKey ¶
Calls the callback previously set with `s.OnCreateAPIKey = ...`
func (*Store) CreateAccount ¶
Calls the callback previously set with `s.OnCreateAccount = ...`
func (*Store) CreateComplianceAuditLog ¶ added in v1.1.0
Calls the callback previously set with `s.OnCreateComplianceAuditLog = ...`
func (*Store) CreateContact ¶ added in v0.28.0
Calls the callback previously set with `s.OnCreateContact = ...`
func (*Store) CreateCounterparty ¶
Calls the callback previously set with `s.OnCreateCounterparty = ...`
func (*Store) CreateCryptoAddress ¶
Calls the callback previously set with `s.OnCreateCryptoAddress = ...`
func (*Store) CreateResetPasswordLink ¶ added in v1.0.0
Calls the callback previously set with `s.OnCreateResetPasswordLink = ...`
func (*Store) CreateSecureEnvelope ¶
Calls the callback previously set with `s.OnCreateSecureEnvelope = ...`
func (*Store) CreateSunrise ¶ added in v0.28.0
Calls the callback previously set with `s.OnCreateSunrise = ...`
func (*Store) CreateTransaction ¶
Calls the callback previously set with `s.OnCreateTransaction = ...`
func (*Store) CreateUser ¶
Calls the callback previously set with `s.OnCreateUser = ...`
func (*Store) DeleteAPIKey ¶
Calls the callback previously set with `s.OnDeleteAPIKey = ...`
func (*Store) DeleteAccount ¶
Calls the callback previously set with `s.OnDeleteAccount = ...`
func (*Store) DeleteContact ¶ added in v0.28.0
Calls the callback previously set with `s.OnDeleteContact = ...`
func (*Store) DeleteCounterparty ¶
Calls the callback previously set with `s.OnDeleteCounterparty = ...`
func (*Store) DeleteCryptoAddress ¶
func (s *Store) DeleteCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) error
Calls the callback previously set with `s.OnDeleteCryptoAddress = ...`
func (*Store) DeleteResetPasswordLink ¶ added in v1.0.0
Calls the callback previously set with `s.OnDeleteResetPasswordLink = ...`
func (*Store) DeleteSecureEnvelope ¶
Calls the callback previously set with `s.OnDeleteSecureEnvelope = ...`
func (*Store) DeleteSunrise ¶ added in v0.28.0
Calls the callback previously set with `s.OnDeleteSunrise = ...`
func (*Store) DeleteTransaction ¶
Calls the callback previously set with `s.OnDeleteTransaction = ...`
func (*Store) DeleteUser ¶
Calls the callback previously set with `s.OnDeleteUser = ...`
func (*Store) GetOrCreateSunriseCounterparty ¶ added in v0.28.0
func (s *Store) GetOrCreateSunriseCounterparty(ctx context.Context, email, name string) (*models.Counterparty, error)
Calls the callback previously set with `s.OnGetOrCreateSunriseCounterparty = ...`
func (*Store) LatestPayloadEnvelope ¶ added in v0.24.0
func (s *Store) LatestPayloadEnvelope(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
Calls the callback previously set with `s.OnLatestPayloadEnvelope = ...`
func (*Store) LatestSecureEnvelope ¶ added in v0.14.0
func (s *Store) LatestSecureEnvelope(ctx context.Context, txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
Calls the callback previously set with `s.OnLatestSecureEnvelope = ...`
func (*Store) ListAPIKeys ¶
Calls the callback previously set with `s.OnListAPIKeys = ...`
func (*Store) ListAccountTransactions ¶ added in v1.0.0
func (s *Store) ListAccountTransactions(ctx context.Context, accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error)
Calls the callback previously set with `s.OnListAccountTransactions = ...`
func (*Store) ListAccounts ¶
func (s *Store) ListAccounts(ctx context.Context, in *models.PageInfo) (*models.AccountsPage, error)
Calls the callback previously set with `s.OnListAccounts = ...`
func (*Store) ListComplianceAuditLogs ¶ added in v1.1.0
func (s *Store) ListComplianceAuditLogs(ctx context.Context, page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error)
Calls the callback previously set with `s.OnListComplianceAuditLog = ...`
func (*Store) ListContacts ¶ added in v0.28.0
func (s *Store) ListContacts(ctx context.Context, counterparty any, page *models.PageInfo) (*models.ContactsPage, error)
Calls the callback previously set with `s.OnListContacts = ...`
func (*Store) ListCounterparties ¶
func (s *Store) ListCounterparties(ctx context.Context, page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error)
Calls the callback previously set with `s.OnListCounterparties = ...`
func (*Store) ListCounterpartySourceInfo ¶
func (s *Store) ListCounterpartySourceInfo(ctx context.Context, source enum.Source) ([]*models.CounterpartySourceInfo, error)
Calls the callback previously set with `s.OnListCounterpartySourceInfo = ...`
func (*Store) ListCryptoAddresses ¶
func (s *Store) ListCryptoAddresses(ctx context.Context, accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error)
Calls the callback previously set with `s.OnListCryptoAddresses = ...`
func (*Store) ListResetPasswordLinks ¶ added in v1.0.0
func (s *Store) ListResetPasswordLinks(ctx context.Context, page *models.PageInfo) (*models.ResetPasswordLinkPage, error)
Calls the callback previously set with `s.OnListResetPasswordLinks = ...`
func (*Store) ListSecureEnvelopes ¶
func (s *Store) ListSecureEnvelopes(ctx context.Context, txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error)
Calls the callback previously set with `s.OnListSecureEnvelopes = ...`
func (*Store) ListSunrise ¶ added in v0.28.0
func (s *Store) ListSunrise(ctx context.Context, page *models.PageInfo) (*models.SunrisePage, error)
Calls the callback previously set with `s.OnListSunrise = ...`
func (*Store) ListTransactions ¶
func (s *Store) ListTransactions(ctx context.Context, in *models.TransactionPageInfo) (*models.TransactionPage, error)
Calls the callback previously set with `s.OnListTransactions = ...`
func (*Store) LookupAccount ¶ added in v1.0.0
Calls the callback previously set with `s.OnLookupAccount = ...`
func (*Store) LookupCounterparty ¶
func (s *Store) LookupCounterparty(ctx context.Context, field, value string) (*models.Counterparty, error)
Calls the callback previously set with `s.OnLookupCounterparty = ...`
func (*Store) LookupRole ¶ added in v0.18.0
Calls the callback previously set with `s.OnLookupRole = ...`
func (*Store) PrepareTransaction ¶
func (s *Store) PrepareTransaction(ctx context.Context, id uuid.UUID) (models.PreparedTransaction, error)
Calls the callback previously set with `s.OnPrepareTransaction = ...`
func (*Store) Reset ¶ added in v1.1.0
func (s *Store) Reset()
Reset all the calls and callbacks in the store.
func (*Store) RetrieveAPIKey ¶
Calls the callback previously set with `s.OnRetrieveAPIKey = ...`
func (*Store) RetrieveAccount ¶
Calls the callback previously set with `s.OnRetrieveAccount = ...`
func (*Store) RetrieveComplianceAuditLog ¶ added in v1.1.0
func (s *Store) RetrieveComplianceAuditLog(ctx context.Context, id ulid.ULID) (*models.ComplianceAuditLog, error)
Calls the callback previously set with `s.OnRetrieveComplianceAuditLog = ...`
func (*Store) RetrieveContact ¶ added in v0.28.0
func (s *Store) RetrieveContact(ctx context.Context, contactID, counterparty any) (*models.Contact, error)
Calls the callback previously set with `s.OnRetrieveContact = ...`
func (*Store) RetrieveCounterparty ¶
func (s *Store) RetrieveCounterparty(ctx context.Context, counterpartyID ulid.ULID) (*models.Counterparty, error)
Calls the callback previously set with `s.OnRetrieveCounterparty = ...`
func (*Store) RetrieveCryptoAddress ¶
func (s *Store) RetrieveCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error)
Calls the callback previously set with `s.OnRetrieveCryptoAddress = ...`
func (*Store) RetrieveResetPasswordLink ¶ added in v1.0.0
func (s *Store) RetrieveResetPasswordLink(ctx context.Context, linkID ulid.ULID) (*models.ResetPasswordLink, error)
Calls the callback previously set with `s.OnRetrieveResetPasswordLink = ...`
func (*Store) RetrieveSecureEnvelope ¶
func (s *Store) RetrieveSecureEnvelope(ctx context.Context, txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error)
Calls the callback previously set with `s.OnRetrieveSecureEnvelope = ...`
func (*Store) RetrieveSunrise ¶ added in v0.28.0
Calls the callback previously set with `s.OnRetrieveSunrise = ...`
func (*Store) RetrieveTransaction ¶
Calls the callback previously set with `s.OnRetrieveTransaction = ...`
func (*Store) RetrieveUser ¶
Calls the callback previously set with `s.OnRetrieveUser = ...`
func (*Store) SearchCounterparties ¶ added in v0.23.0
func (s *Store) SearchCounterparties(ctx context.Context, query *models.SearchQuery) (*models.CounterpartyPage, error)
Calls the callback previously set with `s.OnSearchCounterparties = ...`
func (*Store) SetUserLastLogin ¶ added in v0.18.0
func (s *Store) SetUserLastLogin(ctx context.Context, userID ulid.ULID, lastLogin time.Time) (err error)
Calls the callback previously set with `s.OnSetUserLastLogin = ...`
func (*Store) SetUserPassword ¶
Calls the callback previously set with `s.OnSetUserPassword = ...`
func (*Store) TransactionState ¶ added in v1.0.0
Calls the callback previously set with `s.OnTransactionState = ...`
func (*Store) UnarchiveTransaction ¶ added in v1.0.0
Calls the callback previously set with `s.OnUnarchiveTransaction = ...`
func (*Store) UpdateAPIKey ¶
Calls the callback previously set with `s.OnUpdateAPIKey = ...`
func (*Store) UpdateAccount ¶
Calls the callback previously set with `s.OnUpdateAccount = ...`
func (*Store) UpdateContact ¶ added in v0.28.0
Calls the callback previously set with `s.OnUpdateContact = ...`
func (*Store) UpdateCounterparty ¶
Calls the callback previously set with `s.OnUpdateCounterparty = ...`
func (*Store) UpdateCryptoAddress ¶
Calls the callback previously set with `s.OnUpdateCryptoAddress = ...`
func (*Store) UpdateResetPasswordLink ¶ added in v1.0.0
Calls the callback previously set with `s.OnUpdateResetPasswordLink = ...`
func (*Store) UpdateSecureEnvelope ¶
Calls the callback previously set with `s.OnUpdateSecureEnvelope = ...`
func (*Store) UpdateSunrise ¶ added in v0.28.0
Calls the callback previously set with `s.OnUpdateSunrise = ...`
func (*Store) UpdateSunriseStatus ¶ added in v1.0.0
Calls the callback previously set with `s.OnUpdateSunriseStatus = ...`
func (*Store) UpdateTransaction ¶
Calls the callback previously set with `s.OnUpdateTransaction = ...`
func (*Store) UpdateUser ¶
Calls the callback previously set with `s.OnUpdateUser = ...`
func (*Store) UseTravelAddressFactory ¶
func (s *Store) UseTravelAddressFactory(f models.TravelAddressFactory)
Calls the callback previously set with `s.OnUseTravelAddressFactory = ...`
type Tx ¶ added in v1.1.0
type Tx struct {
// contains filtered or unexported fields
}
Tx implements the store.Txn interface using a mock store. The test user can specify any callbacks to simulate specific behaviors. By default the Tx struct will respect the readonly option so long as no overriding method is provided.
func (*Tx) ArchiveTransaction ¶ added in v1.1.0
Calls the callback previously set with "OnArchiveTransaction()".
func (*Tx) AssertCalls ¶ added in v1.1.0
Assert that the expected number of calls were made to the given method.
func (*Tx) AssertCommit ¶ added in v1.1.0
Assert that Commit has been called on the transaction without rollback.
func (*Tx) AssertNoCommit ¶ added in v1.1.0
Assert that Commit has not been called on the transaction.
func (*Tx) AssertNoRollback ¶ added in v1.1.0
Assert that Rollback has not been called on the transaction.
func (*Tx) AssertRollback ¶ added in v1.1.0
Assert that Rollback has been called on the transaction without commit.
func (*Tx) Commit ¶ added in v1.1.0
Calls the callback previously set with "OnCommit()", or completes the "commit" for the transaction.
func (*Tx) CountTransactions ¶ added in v1.1.0
func (tx *Tx) CountTransactions() (*models.TransactionCounts, error)
Calls the callback previously set with "OnCountTransactions()".
func (*Tx) CreateAPIKey ¶ added in v1.1.0
Calls the callback previously set with "OnCreateAPIKey()".
func (*Tx) CreateAccount ¶ added in v1.1.0
Calls the callback previously set with "OnCreateAccount()".
func (*Tx) CreateComplianceAuditLog ¶ added in v1.1.0
func (tx *Tx) CreateComplianceAuditLog(log *models.ComplianceAuditLog) error
Calls the callback previously set with "OnCreateComplianceAuditLog()".
func (*Tx) CreateContact ¶ added in v1.1.0
Calls the callback previously set with "OnCreateContact()".
func (*Tx) CreateCounterparty ¶ added in v1.1.0
func (tx *Tx) CreateCounterparty(in *models.Counterparty) error
Calls the callback previously set with "OnCreateCounterparty()".
func (*Tx) CreateCryptoAddress ¶ added in v1.1.0
func (tx *Tx) CreateCryptoAddress(in *models.CryptoAddress) error
Calls the callback previously set with "OnCreateCryptoAddress()".
func (*Tx) CreateDaybreak ¶ added in v1.1.0
func (tx *Tx) CreateDaybreak(counterparty *models.Counterparty) error
Calls the callback previously set with "OnCreateDaybreak()".
func (*Tx) CreateResetPasswordLink ¶ added in v1.1.0
func (tx *Tx) CreateResetPasswordLink(in *models.ResetPasswordLink) error
Calls the callback previously set with "OnCreateResetPasswordLink()".
func (*Tx) CreateSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) CreateSecureEnvelope(in *models.SecureEnvelope) error
Calls the callback previously set with "OnCreateSecureEnvelope()".
func (*Tx) CreateSunrise ¶ added in v1.1.0
Calls the callback previously set with "OnCreateSunrise()".
func (*Tx) CreateTransaction ¶ added in v1.1.0
func (tx *Tx) CreateTransaction(in *models.Transaction) error
Calls the callback previously set with "OnCreateTransaction()".
func (*Tx) CreateUser ¶ added in v1.1.0
Calls the callback previously set with "OnCreateUser()".
func (*Tx) DeleteAPIKey ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteAPIKey()".
func (*Tx) DeleteAccount ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteAccount()".
func (*Tx) DeleteContact ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteContact()".
func (*Tx) DeleteCounterparty ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteCounterparty()".
func (*Tx) DeleteCryptoAddress ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteCryptoAddress()".
func (*Tx) DeleteDaybreak ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteDaybreak()".
func (*Tx) DeleteResetPasswordLink ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteResetPasswordLink()".
func (*Tx) DeleteSecureEnvelope ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteSecureEnvelope()".
func (*Tx) DeleteSunrise ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteSunrise()".
func (*Tx) DeleteTransaction ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteTransaction()".
func (*Tx) DeleteUser ¶ added in v1.1.0
Calls the callback previously set with "OnDeleteUser()".
func (*Tx) GetOrCreateSunriseCounterparty ¶ added in v1.1.0
func (tx *Tx) GetOrCreateSunriseCounterparty(email, name string) (*models.Counterparty, error)
Calls the callback previously set with "OnGetOrCreateSunriseCounterparty()".
func (*Tx) LatestPayloadEnvelope ¶ added in v1.1.0
func (tx *Tx) LatestPayloadEnvelope(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
Calls the callback previously set with "OnLatestPayloadEnvelope()".
func (*Tx) LatestSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) LatestSecureEnvelope(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error)
Calls the callback previously set with "OnLatestSecureEnvelope()".
func (*Tx) ListAPIKeys ¶ added in v1.1.0
Calls the callback previously set with "OnListAPIKeys()".
func (*Tx) ListAccountTransactions ¶ added in v1.1.0
func (tx *Tx) ListAccountTransactions(accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error)
Calls the callback previously set with "OnListAccountTransactions()".
func (*Tx) ListAccounts ¶ added in v1.1.0
Calls the callback previously set with "OnListAccounts()".
func (*Tx) ListComplianceAuditLogs ¶ added in v1.1.0
func (tx *Tx) ListComplianceAuditLogs(page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error)
Calls the callback previously set with "OnListComplianceAuditLogs()".
func (*Tx) ListContacts ¶ added in v1.1.0
Calls the callback previously set with "OnListContacts()".
func (*Tx) ListCounterparties ¶ added in v1.1.0
func (tx *Tx) ListCounterparties(page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error)
Calls the callback previously set with "OnListCounterparties()".
func (*Tx) ListCounterpartySourceInfo ¶ added in v1.1.0
func (tx *Tx) ListCounterpartySourceInfo(source enum.Source) ([]*models.CounterpartySourceInfo, error)
Calls the callback previously set with "OnListCounterpartySourceInfo()".
func (*Tx) ListCryptoAddresses ¶ added in v1.1.0
func (tx *Tx) ListCryptoAddresses(accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error)
Calls the callback previously set with "OnListCryptoAddresses()".
func (*Tx) ListDaybreak ¶ added in v1.1.0
func (tx *Tx) ListDaybreak() (map[string]*models.CounterpartySourceInfo, error)
Calls the callback previously set with "OnListDaybreak()".
func (*Tx) ListResetPasswordLinks ¶ added in v1.1.0
Calls the callback previously set with "OnListResetPasswordLinks()".
func (*Tx) ListSecureEnvelopes ¶ added in v1.1.0
func (tx *Tx) ListSecureEnvelopes(txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error)
Calls the callback previously set with "OnListSecureEnvelopes()".
func (*Tx) ListSunrise ¶ added in v1.1.0
Calls the callback previously set with "OnListSunrise()".
func (*Tx) ListTransactions ¶ added in v1.1.0
func (tx *Tx) ListTransactions(in *models.TransactionPageInfo) (*models.TransactionPage, error)
Calls the callback previously set with "OnListTransactions()".
func (*Tx) LookupAccount ¶ added in v1.1.0
Calls the callback previously set with "OnLookupAccount()".
func (*Tx) LookupCounterparty ¶ added in v1.1.0
func (tx *Tx) LookupCounterparty(field, value string) (*models.Counterparty, error)
Calls the callback previously set with "OnLookupCounterparty()".
func (*Tx) LookupRole ¶ added in v1.1.0
Calls the callback previously set with "OnLookupRole()".
func (*Tx) OnArchiveTransaction ¶ added in v1.1.0
Set a callback for when "ArchiveTransaction()" is called on the mock Txn.
func (*Tx) OnCountTransactions ¶ added in v1.1.0
func (tx *Tx) OnCountTransactions(fn func() (*models.TransactionCounts, error))
Set a callback for when "CountTransactions()" is called on the mock Txn.
func (*Tx) OnCreateAPIKey ¶ added in v1.1.0
Set a callback for when "CreateAPIKey()" is called on the mock Txn.
func (*Tx) OnCreateAccount ¶ added in v1.1.0
Set a callback for when "CreateAccount()" is called on the mock Txn.
func (*Tx) OnCreateComplianceAuditLog ¶ added in v1.1.0
func (tx *Tx) OnCreateComplianceAuditLog(fn func(log *models.ComplianceAuditLog) error)
Set a callback for when "CreateComplianceAuditLog()" is called on the mock Txn.
func (*Tx) OnCreateContact ¶ added in v1.1.0
Set a callback for when "CreateContact()" is called on the mock Txn.
func (*Tx) OnCreateCounterparty ¶ added in v1.1.0
func (tx *Tx) OnCreateCounterparty(fn func(in *models.Counterparty) error)
Set a callback for when "CreateCounterparty()" is called on the mock Txn.
func (*Tx) OnCreateCryptoAddress ¶ added in v1.1.0
func (tx *Tx) OnCreateCryptoAddress(fn func(in *models.CryptoAddress) error)
Set a callback for when "CreateCryptoAddress()" is called on the mock Txn.
func (*Tx) OnCreateDaybreak ¶ added in v1.1.0
func (tx *Tx) OnCreateDaybreak(fn func(counterparty *models.Counterparty) error)
Set a callback for when "CreateDaybreak()" is called on the mock Txn.
func (*Tx) OnCreateResetPasswordLink ¶ added in v1.1.0
func (tx *Tx) OnCreateResetPasswordLink(fn func(in *models.ResetPasswordLink) error)
Set a callback for when "CreateResetPasswordLink()" is called on the mock Txn.
func (*Tx) OnCreateSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) OnCreateSecureEnvelope(fn func(in *models.SecureEnvelope) error)
Set a callback for when "CreateSecureEnvelope()" is called on the mock Txn.
func (*Tx) OnCreateSunrise ¶ added in v1.1.0
Set a callback for when "CreateSunrise()" is called on the mock Txn.
func (*Tx) OnCreateTransaction ¶ added in v1.1.0
func (tx *Tx) OnCreateTransaction(fn func(in *models.Transaction) error)
Set a callback for when "CreateTransaction()" is called on the mock Txn.
func (*Tx) OnCreateUser ¶ added in v1.1.0
Set a callback for when "CreateUser()" is called on the mock Txn.
func (*Tx) OnDeleteAPIKey ¶ added in v1.1.0
Set a callback for when "DeleteAPIKey()" is called on the mock Txn.
func (*Tx) OnDeleteAccount ¶ added in v1.1.0
Set a callback for when "DeleteAccount()" is called on the mock Txn.
func (*Tx) OnDeleteContact ¶ added in v1.1.0
Set a callback for when "DeleteContact()" is called on the mock Txn.
func (*Tx) OnDeleteCounterparty ¶ added in v1.1.0
Set a callback for when "DeleteCounterparty()" is called on the mock Txn.
func (*Tx) OnDeleteCryptoAddress ¶ added in v1.1.0
Set a callback for when "DeleteCryptoAddress()" is called on the mock Txn.
func (*Tx) OnDeleteDaybreak ¶ added in v1.1.0
Set a callback for when "DeleteDaybreak()" is called on the mock Txn.
func (*Tx) OnDeleteResetPasswordLink ¶ added in v1.1.0
Set a callback for when "DeleteResetPasswordLink()" is called on the mock Txn.
func (*Tx) OnDeleteSecureEnvelope ¶ added in v1.1.0
Set a callback for when "DeleteSecureEnvelope()" is called on the mock Txn.
func (*Tx) OnDeleteSunrise ¶ added in v1.1.0
Set a callback for when "DeleteSunrise()" is called on the mock Txn.
func (*Tx) OnDeleteTransaction ¶ added in v1.1.0
Set a callback for when "DeleteTransaction()" is called on the mock Txn.
func (*Tx) OnDeleteUser ¶ added in v1.1.0
Set a callback for when "DeleteUser()" is called on the mock Txn.
func (*Tx) OnGetOrCreateSunriseCounterparty ¶ added in v1.1.0
func (tx *Tx) OnGetOrCreateSunriseCounterparty(fn func(email, name string) (*models.Counterparty, error))
Set a callback for when "GetOrCreateSunriseCounterparty()" is called on the mock Txn.
func (*Tx) OnLatestPayloadEnvelope ¶ added in v1.1.0
func (tx *Tx) OnLatestPayloadEnvelope(fn func(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error))
Set a callback for when "LatestPayloadEnvelope()" is called on the mock Txn.
func (*Tx) OnLatestSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) OnLatestSecureEnvelope(fn func(txID uuid.UUID, direction enum.Direction) (*models.SecureEnvelope, error))
Set a callback for when "LatestSecureEnvelope()" is called on the mock Txn.
func (*Tx) OnListAPIKeys ¶ added in v1.1.0
Set a callback for when "ListAPIKeys()" is called on the mock Txn.
func (*Tx) OnListAccountTransactions ¶ added in v1.1.0
func (tx *Tx) OnListAccountTransactions(fn func(accountID ulid.ULID, page *models.TransactionPageInfo) (*models.TransactionPage, error))
Set a callback for when "ListAccountTransactions()" is called on the mock Txn.
func (*Tx) OnListAccounts ¶ added in v1.1.0
Set a callback for when "ListAccounts()" is called on the mock Txn.
func (*Tx) OnListComplianceAuditLogs ¶ added in v1.1.0
func (tx *Tx) OnListComplianceAuditLogs(fn func(page *models.ComplianceAuditLogPageInfo) (*models.ComplianceAuditLogPage, error))
Set a callback for when "ListComplianceAuditLogs()" is called on the mock Txn.
func (*Tx) OnListContacts ¶ added in v1.1.0
func (tx *Tx) OnListContacts(fn func(counterparty any, page *models.PageInfo) (*models.ContactsPage, error))
Set a callback for when "ListContacts()" is called on the mock Txn.
func (*Tx) OnListCounterparties ¶ added in v1.1.0
func (tx *Tx) OnListCounterparties(fn func(page *models.CounterpartyPageInfo) (*models.CounterpartyPage, error))
Set a callback for when "ListCounterparties()" is called on the mock Txn.
func (*Tx) OnListCounterpartySourceInfo ¶ added in v1.1.0
func (tx *Tx) OnListCounterpartySourceInfo(fn func(source enum.Source) ([]*models.CounterpartySourceInfo, error))
Set a callback for when "ListCounterpartySourceInfo()" is called on the mock Txn.
func (*Tx) OnListCryptoAddresses ¶ added in v1.1.0
func (tx *Tx) OnListCryptoAddresses(fn func(accountID ulid.ULID, page *models.PageInfo) (*models.CryptoAddressPage, error))
Set a callback for when "ListCryptoAddresses()" is called on the mock Txn.
func (*Tx) OnListDaybreak ¶ added in v1.1.0
func (tx *Tx) OnListDaybreak(fn func() (map[string]*models.CounterpartySourceInfo, error))
Set a callback for when "ListDaybreak()" is called on the mock Txn.
func (*Tx) OnListResetPasswordLinks ¶ added in v1.1.0
func (tx *Tx) OnListResetPasswordLinks(fn func(page *models.PageInfo) (*models.ResetPasswordLinkPage, error))
Set a callback for when "ListResetPasswordLinks()" is called on the mock Txn.
func (*Tx) OnListSecureEnvelopes ¶ added in v1.1.0
func (tx *Tx) OnListSecureEnvelopes(fn func(txID uuid.UUID, page *models.PageInfo) (*models.SecureEnvelopePage, error))
Set a callback for when "ListSecureEnvelopes()" is called on the mock Txn.
func (*Tx) OnListSunrise ¶ added in v1.1.0
Set a callback for when "ListSunrise()" is called on the mock Txn.
func (*Tx) OnListTransactions ¶ added in v1.1.0
func (tx *Tx) OnListTransactions(fn func(in *models.TransactionPageInfo) (*models.TransactionPage, error))
Set a callback for when "ListTransactions()" is called on the mock Txn.
func (*Tx) OnListUsers ¶ added in v1.1.0
Set a callback for when "ListUsers()" is called on the mock Txn.
func (*Tx) OnLookupAccount ¶ added in v1.1.0
Set a callback for when "LookupAccount()" is called on the mock Txn.
func (*Tx) OnLookupCounterparty ¶ added in v1.1.0
func (tx *Tx) OnLookupCounterparty(fn func(field, value string) (*models.Counterparty, error))
Set a callback for when "LookupCounterparty()" is called on the mock Txn.
func (*Tx) OnLookupRole ¶ added in v1.1.0
Set a callback for when "LookupRole()" is called on the mock Txn.
func (*Tx) OnRetrieveAPIKey ¶ added in v1.1.0
Set a callback for when "RetrieveAPIKey()" is called on the mock Txn.
func (*Tx) OnRetrieveAccount ¶ added in v1.1.0
Set a callback for when "RetrieveAccount()" is called on the mock Txn.
func (*Tx) OnRetrieveComplianceAuditLog ¶ added in v1.1.0
func (tx *Tx) OnRetrieveComplianceAuditLog(fn func(id ulid.ULID) (*models.ComplianceAuditLog, error))
Set a callback for when "RetrieveComplianceAuditLog()" is called on the mock Txn.
func (*Tx) OnRetrieveContact ¶ added in v1.1.0
Set a callback for when "RetrieveContact()" is called on the mock Txn.
func (*Tx) OnRetrieveCounterparty ¶ added in v1.1.0
func (tx *Tx) OnRetrieveCounterparty(fn func(counterpartyID ulid.ULID) (*models.Counterparty, error))
Set a callback for when "RetrieveCounterparty()" is called on the mock Txn.
func (*Tx) OnRetrieveCryptoAddress ¶ added in v1.1.0
func (tx *Tx) OnRetrieveCryptoAddress(fn func(accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error))
Set a callback for when "RetrieveCryptoAddress()" is called on the mock Txn.
func (*Tx) OnRetrieveResetPasswordLink ¶ added in v1.1.0
Set a callback for when "RetrieveResetPasswordLink()" is called on the mock Txn.
func (*Tx) OnRetrieveSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) OnRetrieveSecureEnvelope(fn func(txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error))
Set a callback for when "RetrieveSecureEnvelope()" is called on the mock Txn.
func (*Tx) OnRetrieveSunrise ¶ added in v1.1.0
Set a callback for when "RetrieveSunrise()" is called on the mock Txn.
func (*Tx) OnRetrieveTransaction ¶ added in v1.1.0
Set a callback for when "RetrieveTransaction()" is called on the mock Txn.
func (*Tx) OnRetrieveUser ¶ added in v1.1.0
Set a callback for when "RetrieveUser()" is called on the mock Txn.
func (*Tx) OnRollback ¶ added in v1.1.0
Set a callback for when "Rollback()" is called on the mock Txn.
func (*Tx) OnSearchCounterparties ¶ added in v1.1.0
func (tx *Tx) OnSearchCounterparties(fn func(query *models.SearchQuery) (*models.CounterpartyPage, error))
Set a callback for when "SearchCounterparties()" is called on the mock Txn.
func (*Tx) OnSetUserLastLogin ¶ added in v1.1.0
Set a callback for when "SetUserLastLogin()" is called on the mock Txn.
func (*Tx) OnSetUserPassword ¶ added in v1.1.0
Set a callback for when "SetUserPassword()" is called on the mock Txn.
func (*Tx) OnTransactionState ¶ added in v1.1.0
Set a callback for when "TransactionState()" is called on the mock Txn.
func (*Tx) OnUnarchiveTransaction ¶ added in v1.1.0
Set a callback for when "UnarchiveTransaction()" is called on the mock Txn.
func (*Tx) OnUpdateAPIKey ¶ added in v1.1.0
Set a callback for when "UpdateAPIKey()" is called on the mock Txn.
func (*Tx) OnUpdateAccount ¶ added in v1.1.0
Set a callback for when "UpdateAccount()" is called on the mock Txn.
func (*Tx) OnUpdateContact ¶ added in v1.1.0
Set a callback for when "UpdateContact()" is called on the mock Txn.
func (*Tx) OnUpdateCounterparty ¶ added in v1.1.0
func (tx *Tx) OnUpdateCounterparty(fn func(in *models.Counterparty) error)
Set a callback for when "UpdateCounterparty()" is called on the mock Txn.
func (*Tx) OnUpdateCryptoAddress ¶ added in v1.1.0
func (tx *Tx) OnUpdateCryptoAddress(fn func(in *models.CryptoAddress) error)
Set a callback for when "UpdateCryptoAddress()" is called on the mock Txn.
func (*Tx) OnUpdateDaybreak ¶ added in v1.1.0
func (tx *Tx) OnUpdateDaybreak(fn func(counterparty *models.Counterparty) error)
Set a callback for when "UpdateDaybreak()" is called on the mock Txn.
func (*Tx) OnUpdateResetPasswordLink ¶ added in v1.1.0
func (tx *Tx) OnUpdateResetPasswordLink(fn func(in *models.ResetPasswordLink) error)
Set a callback for when "UpdateResetPasswordLink()" is called on the mock Txn.
func (*Tx) OnUpdateSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) OnUpdateSecureEnvelope(fn func(in *models.SecureEnvelope) error)
Set a callback for when "UpdateSecureEnvelope()" is called on the mock Txn.
func (*Tx) OnUpdateSunrise ¶ added in v1.1.0
Set a callback for when "UpdateSunrise()" is called on the mock Txn.
func (*Tx) OnUpdateSunriseStatus ¶ added in v1.1.0
Set a callback for when "UpdateSunriseStatus()" is called on the mock Txn.
func (*Tx) OnUpdateTransaction ¶ added in v1.1.0
func (tx *Tx) OnUpdateTransaction(fn func(in *models.Transaction) error)
Set a callback for when "UpdateTransaction()" is called on the mock Txn.
func (*Tx) OnUpdateUser ¶ added in v1.1.0
Set a callback for when "UpdateUser()" is called on the mock Txn.
func (*Tx) Reset ¶ added in v1.1.0
func (tx *Tx) Reset()
Reset all the calls and callbacks in the transaction, if you don't want to create a new one.
func (*Tx) RetrieveAPIKey ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveAPIKey()".
func (*Tx) RetrieveAccount ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveAccount()".
func (*Tx) RetrieveComplianceAuditLog ¶ added in v1.1.0
Calls the callback previously set with "OnCreateComplianceAuditLog()".
func (*Tx) RetrieveContact ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveContact()".
func (*Tx) RetrieveCounterparty ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveCounterparty()".
func (*Tx) RetrieveCryptoAddress ¶ added in v1.1.0
func (tx *Tx) RetrieveCryptoAddress(accountID, cryptoAddressID ulid.ULID) (*models.CryptoAddress, error)
Calls the callback previously set with "OnRetrieveCryptoAddress()".
func (*Tx) RetrieveResetPasswordLink ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveResetPasswordLink()".
func (*Tx) RetrieveSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) RetrieveSecureEnvelope(txID uuid.UUID, envID ulid.ULID) (*models.SecureEnvelope, error)
Calls the callback previously set with "OnRetrieveSecureEnvelope()".
func (*Tx) RetrieveSunrise ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveSunrise()".
func (*Tx) RetrieveTransaction ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveTransaction()".
func (*Tx) RetrieveUser ¶ added in v1.1.0
Calls the callback previously set with "OnRetrieveUser()".
func (*Tx) Rollback ¶ added in v1.1.0
Calls the callback previously set with "OnRollback()", or completes the "rollback" for the transaction.
func (*Tx) SearchCounterparties ¶ added in v1.1.0
func (tx *Tx) SearchCounterparties(query *models.SearchQuery) (*models.CounterpartyPage, error)
Calls the callback previously set with "OnSearchCounterparties()".
func (*Tx) SetUserLastLogin ¶ added in v1.1.0
Calls the callback previously set with "OnSetUserLastLogin()".
func (*Tx) SetUserPassword ¶ added in v1.1.0
Calls the callback previously set with "OnSetUserPassword()".
func (*Tx) TransactionState ¶ added in v1.1.0
Calls the callback previously set with "OnTransactionState()".
func (*Tx) UnarchiveTransaction ¶ added in v1.1.0
Calls the callback previously set with "OnUnarchiveTransaction()".
func (*Tx) UpdateAPIKey ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateAPIKey()".
func (*Tx) UpdateAccount ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateAccount()".
func (*Tx) UpdateContact ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateContact()".
func (*Tx) UpdateCounterparty ¶ added in v1.1.0
func (tx *Tx) UpdateCounterparty(in *models.Counterparty) error
Calls the callback previously set with "OnUpdateCounterparty()".
func (*Tx) UpdateCryptoAddress ¶ added in v1.1.0
func (tx *Tx) UpdateCryptoAddress(in *models.CryptoAddress) error
Calls the callback previously set with "OnUpdateCryptoAddress()".
func (*Tx) UpdateDaybreak ¶ added in v1.1.0
func (tx *Tx) UpdateDaybreak(counterparty *models.Counterparty) error
Calls the callback previously set with "OnUpdateDaybreak()".
func (*Tx) UpdateResetPasswordLink ¶ added in v1.1.0
func (tx *Tx) UpdateResetPasswordLink(in *models.ResetPasswordLink) error
Calls the callback previously set with "OnUpdateResetPasswordLink()".
func (*Tx) UpdateSecureEnvelope ¶ added in v1.1.0
func (tx *Tx) UpdateSecureEnvelope(in *models.SecureEnvelope) error
Calls the callback previously set with "OnUpdateSecureEnvelope()".
func (*Tx) UpdateSunrise ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateSunrise()".
func (*Tx) UpdateSunriseStatus ¶ added in v1.1.0
Calls the callback previously set with "OnUpdateSunriseStatus()".
func (*Tx) UpdateTransaction ¶ added in v1.1.0
func (tx *Tx) UpdateTransaction(in *models.Transaction) error
Calls the callback previously set with "OnUpdateTransaction()".