db

package
v0.0.0-...-7b2af25 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Sep 21, 2023 License: MIT Imports: 2 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Database

type Database interface {

	// Get the slice of prices id for all tokens stored in database
	// Returns error if operation fails
	GetTokensPriceID() ([]string, error)

	// Store given IBC tokens details inside database
	// Returns error if operation fails
	SaveIBCToken(token types.IBCToken) error

	// Store given tokens details inside database
	// Returns error if operation fails
	SaveTokens(token []types.ChainRegistryAsset) error

	// Store latest tokens price in database
	// Returns error if operation fails
	SaveTokensPrices(prices []types.TokenPrice) error

	// Close closes the connection to the database
	Close()
}

type DatabaseBuilder

type DatabaseBuilder func(ctx *DatabaseContext) (Database, error)

DatabaseBuilder represents a method that allows to build database

type DatabaseContext

type DatabaseContext struct {
	Cfg utils.DatabaseConfig
}

DatabaseContext contains the data used to build a Database instance

func NewDatabaseContext

func NewDatabaseContext(cfg utils.DatabaseConfig) *DatabaseContext

NewDatabaseContext allows to build new DatabaseContext instance

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL