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) 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) 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) 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) UpsertQuote ¶
UpsertQuote inserts a new quote into the database or updates an existing one.