Documentation ¶
Index ¶
- type Migration
- type PreparedTransaction
- func (p *PreparedTransaction) AddCounterparty(in *models.Counterparty) (err error)
- func (p *PreparedTransaction) AddEnvelope(in *models.SecureEnvelope) (err error)
- func (p *PreparedTransaction) Commit() error
- func (p *PreparedTransaction) Created() bool
- func (p *PreparedTransaction) Fetch() (transaction *models.Transaction, err error)
- func (p *PreparedTransaction) Rollback() error
- func (p *PreparedTransaction) Update(in *models.Transaction) (err error)
- type Store
- func (s *Store) BeginTx(ctx context.Context, opts *sql.TxOptions) (tx *sql.Tx, err error)
- func (s *Store) Close() error
- func (s *Store) CreateAPIKey(ctx context.Context, key *models.APIKey) (err error)
- func (s *Store) CreateAccount(ctx context.Context, account *models.Account) (err error)
- func (s *Store) CreateCounterparty(ctx context.Context, counterparty *models.Counterparty) (err error)
- func (s *Store) CreateCryptoAddress(ctx context.Context, addr *models.CryptoAddress) (err error)
- func (s *Store) CreateSecureEnvelope(ctx context.Context, env *models.SecureEnvelope) (err error)
- func (s *Store) CreateTransaction(ctx context.Context, transaction *models.Transaction) (err error)
- func (s *Store) CreateUser(ctx context.Context, user *models.User) (err error)
- func (s *Store) DeleteAPIKey(ctx context.Context, keyID ulid.ULID) (err error)
- func (s *Store) DeleteAccount(ctx context.Context, id ulid.ULID) (err error)
- func (s *Store) DeleteCounterparty(ctx context.Context, counterpartyID ulid.ULID) (err error)
- func (s *Store) DeleteCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) (err error)
- func (s *Store) DeleteSecureEnvelope(ctx context.Context, txID uuid.UUID, envID ulid.ULID) (err error)
- func (s *Store) DeleteTransaction(ctx context.Context, id uuid.UUID) (err error)
- func (s *Store) DeleteUser(ctx context.Context, userID ulid.ULID) (err error)
- func (s *Store) InitializeSchema(empty bool) (err error)
- func (s *Store) LatestPayloadEnvelope(ctx context.Context, envelopeID uuid.UUID, direction string) (env *models.SecureEnvelope, err error)
- func (s *Store) LatestSecureEnvelope(ctx context.Context, envelopeID uuid.UUID, direction string) (env *models.SecureEnvelope, err error)
- func (s *Store) ListAPIKeys(ctx context.Context, page *models.PageInfo) (out *models.APIKeyPage, err error)
- func (s *Store) ListAccounts(ctx context.Context, page *models.PageInfo) (out *models.AccountsPage, err error)
- func (s *Store) ListCounterparties(ctx context.Context, page *models.PageInfo) (out *models.CounterpartyPage, err error)
- func (s *Store) ListCounterpartySourceInfo(ctx context.Context, source string) (out []*models.CounterpartySourceInfo, err error)
- func (s *Store) ListCryptoAddresses(ctx context.Context, accountID ulid.ULID, page *models.PageInfo) (out *models.CryptoAddressPage, err error)
- func (s *Store) ListSecureEnvelopes(ctx context.Context, txID uuid.UUID, page *models.PageInfo) (out *models.SecureEnvelopePage, err error)
- func (s *Store) ListTransactions(ctx context.Context, page *models.PageInfo) (out *models.TransactionPage, err error)
- func (s *Store) ListUsers(ctx context.Context, page *models.PageInfo) (out *models.UserPage, err error)
- func (s *Store) LookupCounterparty(ctx context.Context, commonName string) (counterparty *models.Counterparty, err error)
- func (s *Store) LookupRole(ctx context.Context, role string) (model *models.Role, err error)
- func (s *Store) PrepareTransaction(ctx context.Context, envelopeID uuid.UUID) (_ models.PreparedTransaction, err error)
- func (s *Store) RetrieveAPIKey(ctx context.Context, clientIDOrKeyID any) (key *models.APIKey, err error)
- func (s *Store) RetrieveAccount(ctx context.Context, id ulid.ULID) (account *models.Account, err error)
- func (s *Store) RetrieveCounterparty(ctx context.Context, counterpartyID ulid.ULID) (counterparty *models.Counterparty, err error)
- func (s *Store) RetrieveCryptoAddress(ctx context.Context, accountID, cryptoAddressID ulid.ULID) (addr *models.CryptoAddress, err error)
- func (s *Store) RetrieveSecureEnvelope(ctx context.Context, txID uuid.UUID, envID ulid.ULID) (env *models.SecureEnvelope, err error)
- func (s *Store) RetrieveTransaction(ctx context.Context, id uuid.UUID) (transaction *models.Transaction, err error)
- func (s *Store) RetrieveUser(ctx context.Context, emailOrUserID any) (user *models.User, err error)
- func (s *Store) SearchCounterparties(ctx context.Context, query *models.SearchQuery) (out *models.CounterpartyPage, err 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) UpdateAPIKey(ctx context.Context, key *models.APIKey) (err error)
- func (s *Store) UpdateAccount(ctx context.Context, a *models.Account) (err error)
- func (s *Store) UpdateCounterparty(ctx context.Context, counterparty *models.Counterparty) (err error)
- func (s *Store) UpdateCryptoAddress(ctx context.Context, addr *models.CryptoAddress) (err error)
- func (s *Store) UpdateSecureEnvelope(ctx context.Context, env *models.SecureEnvelope) (err error)
- func (s *Store) UpdateTransaction(ctx context.Context, t *models.Transaction) (err error)
- func (s *Store) UpdateUser(ctx context.Context, user *models.User) (err error)
- func (s *Store) UseTravelAddressFactory(f models.TravelAddressFactory)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Migration ¶
type Migration struct { ID int // The unique sequence ID of the migration Name string // The human readable name of the migration Version string // The package version when the migration was applied Created time.Time // The timestamp when the migration was applied Path string // The path of the migration in the filesystem }
Migration is used to represent both a SQL migration from the embedded file system and a migration record in the database. These records are compared to ensure the database is as up to date as possible before the application starts.
func Migrations ¶
Migrations returns the migration files from the embedded file system.
type PreparedTransaction ¶
type PreparedTransaction struct {
// contains filtered or unexported fields
}
func (*PreparedTransaction) AddCounterparty ¶
func (p *PreparedTransaction) AddCounterparty(in *models.Counterparty) (err error)
TODO: this method needs to be tested extensively!!
func (*PreparedTransaction) AddEnvelope ¶
func (p *PreparedTransaction) AddEnvelope(in *models.SecureEnvelope) (err error)
func (*PreparedTransaction) Commit ¶
func (p *PreparedTransaction) Commit() error
func (*PreparedTransaction) Created ¶
func (p *PreparedTransaction) Created() bool
func (*PreparedTransaction) Fetch ¶
func (p *PreparedTransaction) Fetch() (transaction *models.Transaction, err error)
func (*PreparedTransaction) Rollback ¶
func (p *PreparedTransaction) Rollback() error
func (*PreparedTransaction) Update ¶
func (p *PreparedTransaction) Update(in *models.Transaction) (err error)
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store implements the store.Store interface using SQLite3 as the storage backend.
func (*Store) CreateAPIKey ¶
func (*Store) CreateAccount ¶
Create an account and any crypto addresses associated with the account.
func (*Store) CreateCounterparty ¶
func (*Store) CreateCryptoAddress ¶
func (*Store) CreateSecureEnvelope ¶
func (*Store) CreateTransaction ¶
func (*Store) CreateUser ¶
func (*Store) DeleteAPIKey ¶
func (*Store) DeleteAccount ¶
Delete account and all associated crypto addresses
func (*Store) DeleteCounterparty ¶
func (*Store) DeleteCryptoAddress ¶
func (*Store) DeleteSecureEnvelope ¶
func (*Store) DeleteTransaction ¶
func (*Store) DeleteUser ¶
func (*Store) InitializeSchema ¶
Initialize schema applies any unapplied migrations to the database and should be run when the database is first connected to. If empty is true then the migration table is created and all migrations are applied. If it is not true then the current migration of the database is fetched and all unapplied migrations are applied.
This method is called on Open() and should not be directly applied by the user.
func (*Store) LatestPayloadEnvelope ¶ added in v0.24.0
func (*Store) LatestSecureEnvelope ¶ added in v0.14.0
func (*Store) ListAPIKeys ¶
func (*Store) ListAccounts ¶
func (s *Store) ListAccounts(ctx context.Context, page *models.PageInfo) (out *models.AccountsPage, err error)
Retrieve summary information for all accounts for the specified page, omitting crypto addresses and any other irrelevant information.
func (*Store) ListCounterparties ¶
func (*Store) ListCounterpartySourceInfo ¶
func (*Store) ListCryptoAddresses ¶
func (s *Store) ListCryptoAddresses(ctx context.Context, accountID ulid.ULID, page *models.PageInfo) (out *models.CryptoAddressPage, err error)
List crypto addresses associated with the specified accountID.
func (*Store) ListSecureEnvelopes ¶
func (*Store) ListTransactions ¶
func (*Store) LookupCounterparty ¶
func (*Store) LookupRole ¶ added in v0.18.0
func (*Store) PrepareTransaction ¶
func (*Store) RetrieveAPIKey ¶
func (*Store) RetrieveAccount ¶
func (s *Store) RetrieveAccount(ctx context.Context, id ulid.ULID) (account *models.Account, err error)
Retrieve account detail information including all associated crypto addresses.
func (*Store) RetrieveCounterparty ¶
func (*Store) RetrieveCryptoAddress ¶
func (*Store) RetrieveSecureEnvelope ¶
func (*Store) RetrieveTransaction ¶
func (*Store) RetrieveUser ¶
func (*Store) SearchCounterparties ¶ added in v0.23.0
func (s *Store) SearchCounterparties(ctx context.Context, query *models.SearchQuery) (out *models.CounterpartyPage, err error)
func (*Store) SetUserLastLogin ¶ added in v0.18.0
func (*Store) SetUserPassword ¶
func (*Store) UpdateAPIKey ¶
NOTE: the only thing that can be updated on an api key right now is last_seen
func (*Store) UpdateAccount ¶
Update account information; ignores any associated crypto addresses.
func (*Store) UpdateCounterparty ¶
func (*Store) UpdateCryptoAddress ¶
func (*Store) UpdateSecureEnvelope ¶
func (*Store) UpdateTransaction ¶
func (*Store) UpdateUser ¶
func (*Store) UseTravelAddressFactory ¶
func (s *Store) UseTravelAddressFactory(f models.TravelAddressFactory)