Documentation ¶
Overview ¶
Package base contains the base sql implementation
Index ¶
- func GetAllModels() (allModels []interface{})
- type Store
- func (s Store) DB() *gorm.DB
- func (s *Store) GetActiveQuoteRequests(ctx context.Context, matchStatuses ...db.ActiveQuoteRequestStatus) ([]*db.ActiveQuoteRequest, error)
- func (s *Store) GetAllQuotes(ctx context.Context) ([]*db.Quote, error)
- func (s *Store) GetQuotesByDestChainAndToken(ctx context.Context, destChainID uint64, destTokenAddr string) ([]*db.Quote, error)
- func (s *Store) GetQuotesByOriginAndDestination(ctx context.Context, originChainID uint64, originTokenAddr string, ...) ([]*db.Quote, error)
- func (s *Store) GetQuotesByRelayerAddress(ctx context.Context, relayerAddr string) ([]*db.Quote, error)
- func (s *Store) InsertActiveQuoteRequest(ctx context.Context, req *model.PutRFQRequest, requestID string) error
- func (s *Store) InsertActiveQuoteResponse(ctx context.Context, resp *model.WsRFQResponse, relayerAddr string, ...) error
- func (s *Store) UpdateActiveQuoteRequestStatus(ctx context.Context, requestID string, quoteID *string, ...) error
- func (s *Store) UpdateActiveQuoteResponseStatus(ctx context.Context, quoteID string, status db.ActiveQuoteResponseStatus) error
- func (s *Store) UpsertQuote(ctx context.Context, quote *db.Quote) error
- func (s *Store) UpsertQuotes(ctx context.Context, quotes []*db.Quote) error
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func GetAllModels ¶
func GetAllModels() (allModels []interface{})
GetAllModels gets all models to migrate. see: https://medium.com/@SaifAbid/slice-interfaces-8c78f8b6345d for an explanation of why we can't do this at initialization time
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store is a store that implements an underlying gorm db.
func (*Store) GetActiveQuoteRequests ¶ added in v1.29.0
func (s *Store) GetActiveQuoteRequests(ctx context.Context, matchStatuses ...db.ActiveQuoteRequestStatus) ([]*db.ActiveQuoteRequest, error)
GetActiveQuoteRequests gets active quote requests from the database.
func (*Store) GetAllQuotes ¶
GetAllQuotes retrieves all quotes from the database.
func (*Store) GetQuotesByDestChainAndToken ¶
func (s *Store) GetQuotesByDestChainAndToken(ctx context.Context, destChainID uint64, destTokenAddr string) ([]*db.Quote, error)
GetQuotesByDestChainAndToken gets quotes from the database by destination chain and token.
func (*Store) GetQuotesByOriginAndDestination ¶
func (s *Store) GetQuotesByOriginAndDestination(ctx context.Context, originChainID uint64, originTokenAddr string, destChainID uint64, destTokenAddr string) ([]*db.Quote, error)
GetQuotesByOriginAndDestination gets quotes from the database by origin and destination.
func (*Store) GetQuotesByRelayerAddress ¶
func (s *Store) GetQuotesByRelayerAddress(ctx context.Context, relayerAddr string) ([]*db.Quote, error)
GetQuotesByRelayerAddress gets quotes from the database by relayer address.
func (*Store) InsertActiveQuoteRequest ¶ added in v1.29.0
func (s *Store) InsertActiveQuoteRequest(ctx context.Context, req *model.PutRFQRequest, requestID string) error
InsertActiveQuoteRequest inserts an active quote request into the database.
func (*Store) InsertActiveQuoteResponse ¶ added in v1.29.0
func (s *Store) InsertActiveQuoteResponse(ctx context.Context, resp *model.WsRFQResponse, relayerAddr string, status db.ActiveQuoteResponseStatus) error
InsertActiveQuoteResponse inserts an active quote response into the database.
func (*Store) UpdateActiveQuoteRequestStatus ¶ added in v1.29.0
func (s *Store) UpdateActiveQuoteRequestStatus(ctx context.Context, requestID string, quoteID *string, status db.ActiveQuoteRequestStatus) error
UpdateActiveQuoteRequestStatus updates the status of an active quote request in the database.
func (*Store) UpdateActiveQuoteResponseStatus ¶ added in v1.29.0
func (s *Store) UpdateActiveQuoteResponseStatus(ctx context.Context, quoteID string, status db.ActiveQuoteResponseStatus) error
UpdateActiveQuoteResponseStatus updates the status of an active quote response in the database.
func (*Store) UpsertQuote ¶
UpsertQuote inserts a new quote into the database or updates an existing one.