repo

package
v0.0.0-...-a9b3359 Latest Latest
Warning

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

Go to latest
Published: Jul 2, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type PostgresRepo

type PostgresRepo struct {
	// contains filtered or unexported fields
}

func New

func New(conf config.Database) (
	pr *PostgresRepo,
	err error,
)

func (*PostgresRepo) AddPool

func (pr *PostgresRepo) AddPool(
	ctx c.Context, pool entities.Pool, table string,
) (
	err error,
)

func (*PostgresRepo) AddToken

func (pr *PostgresRepo) AddToken(
	ctx c.Context, table string, token entities.Token,
) (
	err error,
)

func (*PostgresRepo) GetByTokens

func (pr *PostgresRepo) GetByTokens(
	ctx c.Context, table string, pair entities.TokenPair,
) (
	pools []entities.Pool,
	err error,
)

func (*PostgresRepo) GetStorage

func (pr *PostgresRepo) GetStorage() trade.Storage

func (*PostgresRepo) GetTokenByAddress

func (pr *PostgresRepo) GetTokenByAddress(
	ctx c.Context, table string, address string,
) (
	token entities.Token,
	err error,
)

func (*PostgresRepo) ListPools

func (pr *PostgresRepo) ListPools(
	ctx c.Context, table string,
) (
	pools []entities.Pool,
	err error,
)

func (*PostgresRepo) ListTokens

func (pr *PostgresRepo) ListTokens(
	ctx c.Context, table string,
) (
	tokens []entities.Token,
	err error,
)

func (*PostgresRepo) RemovePool

func (pr *PostgresRepo) RemovePool(
	ctx c.Context, table string, pool entities.Pool,
) (
	err error,
)

func (*PostgresRepo) RemovePools

func (pr *PostgresRepo) RemovePools(
	ctx c.Context, table string, pools []entities.Pool,
) (
	out []entities.Pool,
	err error,
)

func (*PostgresRepo) RemoveToken

func (pr *PostgresRepo) RemoveToken(
	ctx c.Context, table string, token entities.Token,
) (
	err error,
)

func (*PostgresRepo) RemoveTokens

func (pr *PostgresRepo) RemoveTokens(
	ctx c.Context, table string, tokens []entities.Token,
) (
	out []entities.Token,
	err error,
)

func (*PostgresRepo) StorePools

func (pr *PostgresRepo) StorePools(
	ctx c.Context, table string, pools []entities.Pool,
) (
	err error,
)

func (*PostgresRepo) StoreTokens

func (pr *PostgresRepo) StoreTokens(
	ctx c.Context, table string, tokens []entities.Token,
) (
	err error,
)

type Storage

type Storage struct {
	// contains filtered or unexported fields
}

func NewStorage

func NewStorage(files map[string]string) (
	st *Storage,
	err error,
)

func (*Storage) AddPool

func (s *Storage) AddPool(
	ctx c.Context,
	pool entities.Pool,
	where string,
) (
	err error,
)

func (*Storage) AddToken

func (s *Storage) AddToken(
	ctx c.Context,
	where string,
	token entities.Token,
) (
	err error,
)

func (*Storage) ClearAll

func (s *Storage) ClearAll(ctx c.Context) (
	err error,
)

func (*Storage) GetByTokens

func (s *Storage) GetByTokens(
	ctx c.Context,
	where string,
	tokens entities.TokenPair,
) (
	pools []entities.Pool,
	err error,
)

func (*Storage) GetStorage

func (s *Storage) GetStorage() trade.Storage

func (*Storage) GetTokenByAddress

func (s *Storage) GetTokenByAddress(
	ctx c.Context,
	where, address string,
) (
	token entities.Token,
	err error,
)

func (*Storage) ListPools

func (s *Storage) ListPools(
	ctx c.Context,
	where string,
) (
	pools []entities.Pool,
	err error,
)

func (*Storage) ListTokens

func (s *Storage) ListTokens(
	ctx c.Context,
	where string,
) (
	tokens []entities.Token,
	err error,
)

func (*Storage) RemovePool

func (s *Storage) RemovePool(
	ctx c.Context,
	where string,
	pool entities.Pool,
) (
	err error,
)

func (*Storage) RemovePools

func (s *Storage) RemovePools(
	ctx c.Context,
	where string,
	pools []entities.Pool,
) (
	out []entities.Pool,
	err error,
)

func (*Storage) RemoveToken

func (s *Storage) RemoveToken(
	ctx c.Context,
	where string,
	token entities.Token,
) (
	err error,
)

func (*Storage) RemoveTokens

func (s *Storage) RemoveTokens(
	ctx c.Context,
	where string,
	tokens []entities.Token,
) (
	out []entities.Token,
	err error,
)

func (*Storage) StorePools

func (s *Storage) StorePools(
	ctx c.Context,
	where string,
	pools []entities.Pool,
) (
	err error,
)

func (*Storage) StoreTokens

func (s *Storage) StoreTokens(
	ctx c.Context,
	where string,
	tokens []entities.Token,
) (
	err error,
)

Jump to

Keyboard shortcuts

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