postgresql

package
v0.5.0 Latest Latest
Warning

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

Go to latest
Published: Feb 25, 2026 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var DATABASE_URL_ENV = "DATABASE_URL"
View Source
var ErrDB = errors.New("ERROR DATABASE")

Functions

This section is empty.

Types

type Postgresql

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

func DatabaseSetup

func DatabaseSetup(ctx context.Context, migrationDir string) (Postgresql, error)

func (Postgresql) AddLiquiditySwap

func (pql Postgresql) AddLiquiditySwap(tx pgx.Tx, swap utils.LiquiditySwap) error

func (Postgresql) AddPreimageMeltRequest

func (pql Postgresql) AddPreimageMeltRequest(tx pgx.Tx, quote string, preimage string) error

func (Postgresql) ChangeCheckingId

func (pql Postgresql) ChangeCheckingId(tx pgx.Tx, quote string, checking_id string) error

func (Postgresql) ChangeLiquiditySwapState

func (pql Postgresql) ChangeLiquiditySwapState(tx pgx.Tx, id string, state utils.SwapState) error

func (Postgresql) ChangeMeltRequestState

func (pql Postgresql) ChangeMeltRequestState(tx pgx.Tx, quote string, state cashu.ACTION_STATE, melted bool, fee_paid uint64) error

func (Postgresql) ChangeMintRequestState

func (pql Postgresql) ChangeMintRequestState(tx pgx.Tx, quote string, state cashu.ACTION_STATE, minted bool) error

func (Postgresql) Close

func (pql Postgresql) Close()

func (Postgresql) Commit

func (pql Postgresql) Commit(ctx context.Context, tx pgx.Tx) error

func (Postgresql) DeleteChangeByQuote

func (pql Postgresql) DeleteChangeByQuote(tx pgx.Tx, quote string) error

func (Postgresql) DeleteProofs

func (pql Postgresql) DeleteProofs(tx pgx.Tx, proofs cashu.Proofs) error

func (Postgresql) GetAllLiquiditySwaps

func (pql Postgresql) GetAllLiquiditySwaps() ([]utils.LiquiditySwap, error)

func (Postgresql) GetAllSeeds

func (pql Postgresql) GetAllSeeds() ([]cashu.Seed, error)

func (Postgresql) GetAuthUser

func (pql Postgresql) GetAuthUser(tx pgx.Tx, sub string) (database.AuthUser, error)

func (Postgresql) GetBlindSigsCountByKeyset added in v0.4.0

func (pql Postgresql) GetBlindSigsCountByKeyset(since time.Time) (map[string]database.BlindSigsCountByKeyset, error)

func (Postgresql) GetBlindSigsTimeSeries added in v0.4.0

func (pql Postgresql) GetBlindSigsTimeSeries(since int64, bucketMinutes int) ([]database.ProofTimeSeriesPoint, error)

func (Postgresql) GetConfig

func (pql Postgresql) GetConfig() (utils.Config, error)

func (Postgresql) GetLiquiditySwapById

func (pql Postgresql) GetLiquiditySwapById(tx pgx.Tx, id string) (utils.LiquiditySwap, error)

func (Postgresql) GetLiquiditySwaps

func (pql Postgresql) GetLiquiditySwaps(swap utils.LiquiditySwap) ([]utils.LiquiditySwap, error)

func (Postgresql) GetLiquiditySwapsByStates

func (pql Postgresql) GetLiquiditySwapsByStates(tx pgx.Tx, states []utils.SwapState) ([]string, error)

func (Postgresql) GetMeltChangeByQuote

func (pql Postgresql) GetMeltChangeByQuote(tx pgx.Tx, quote string) ([]cashu.MeltChange, error)

func (Postgresql) GetMeltQuotesByState

func (pql Postgresql) GetMeltQuotesByState(state cashu.ACTION_STATE) ([]cashu.MeltRequestDB, error)

func (Postgresql) GetMeltRequestById

func (pql Postgresql) GetMeltRequestById(tx pgx.Tx, id string) (cashu.MeltRequestDB, error)

func (Postgresql) GetMeltRequestsByTimeAndId added in v0.4.2

func (pql Postgresql) GetMeltRequestsByTimeAndId(ctx context.Context, since time.Time, id *string) ([]cashu.MeltRequestDB, error)

func (Postgresql) GetMintMeltBalanceByTime

func (pql Postgresql) GetMintMeltBalanceByTime(time int64) (database.MintMeltBalance, error)

func (Postgresql) GetMintRequestById

func (pql Postgresql) GetMintRequestById(tx pgx.Tx, id string) (cashu.MintRequestDB, error)

func (Postgresql) GetMintRequestByRequest

func (pql Postgresql) GetMintRequestByRequest(tx pgx.Tx, request string) (cashu.MintRequestDB, error)

func (Postgresql) GetMintRequestsByTimeAndId added in v0.4.2

func (pql Postgresql) GetMintRequestsByTimeAndId(ctx context.Context, since time.Time, id *string) ([]cashu.MintRequestDB, error)

func (Postgresql) GetNostrAuth

func (pql Postgresql) GetNostrAuth(tx pgx.Tx, nonce string) (database.NostrLoginAuth, error)

func (Postgresql) GetProofsCountByKeyset added in v0.4.0

func (pql Postgresql) GetProofsCountByKeyset(since time.Time) (map[string]database.ProofsCountByKeyset, error)

func (Postgresql) GetProofsFromQuote

func (pql Postgresql) GetProofsFromQuote(tx pgx.Tx, quote string) (cashu.Proofs, error)

func (Postgresql) GetProofsFromSecret

func (pql Postgresql) GetProofsFromSecret(tx pgx.Tx, SecretList []string) (cashu.Proofs, error)

func (Postgresql) GetProofsFromSecretCurve

func (pql Postgresql) GetProofsFromSecretCurve(tx pgx.Tx, Ys []cashu.WrappedPublicKey) (cashu.Proofs, error)

func (Postgresql) GetProofsTimeSeries added in v0.4.0

func (pql Postgresql) GetProofsTimeSeries(since int64, bucketMinutes int) ([]database.ProofTimeSeriesPoint, error)

func (Postgresql) GetRestoreSigsFromBlindedMessages

func (pql Postgresql) GetRestoreSigsFromBlindedMessages(tx pgx.Tx, B_ []cashu.WrappedPublicKey) ([]cashu.RecoverSigDB, error)

func (Postgresql) GetSeedsByUnit

func (pql Postgresql) GetSeedsByUnit(tx pgx.Tx, unit cashu.Unit) ([]cashu.Seed, error)

func (Postgresql) GetTx

func (pql Postgresql) GetTx(ctx context.Context) (pgx.Tx, error)

func (Postgresql) MakeAuthUser

func (pql Postgresql) MakeAuthUser(tx pgx.Tx, auth database.AuthUser) error

func (Postgresql) Rollback

func (pql Postgresql) Rollback(ctx context.Context, tx pgx.Tx) error

func (Postgresql) SaveMeltChange

func (pql Postgresql) SaveMeltChange(tx pgx.Tx, change []cashu.BlindedMessage, quote string) error

func (Postgresql) SaveMeltRequest

func (pql Postgresql) SaveMeltRequest(tx pgx.Tx, request cashu.MeltRequestDB) error

func (Postgresql) SaveMintRequest

func (pql Postgresql) SaveMintRequest(tx pgx.Tx, request cashu.MintRequestDB) error

func (Postgresql) SaveNewSeed

func (pql Postgresql) SaveNewSeed(tx pgx.Tx, seed cashu.Seed) error

func (Postgresql) SaveNewSeeds

func (pql Postgresql) SaveNewSeeds(seeds []cashu.Seed) error

func (Postgresql) SaveNostrAuth

func (pql Postgresql) SaveNostrAuth(auth database.NostrLoginAuth) error

func (Postgresql) SaveProof

func (pql Postgresql) SaveProof(tx pgx.Tx, proofs []cashu.Proof) error

func (Postgresql) SaveRestoreSigs

func (pql Postgresql) SaveRestoreSigs(tx pgx.Tx, recover_sigs []cashu.RecoverSigDB) error

func (Postgresql) SetConfig

func (pql Postgresql) SetConfig(config utils.Config) error

func (Postgresql) SetProofsState

func (pql Postgresql) SetProofsState(tx pgx.Tx, proofs cashu.Proofs, state cashu.ProofState) error

func (Postgresql) SubTx

func (pql Postgresql) SubTx(ctx context.Context, tx pgx.Tx) (pgx.Tx, error)

func (Postgresql) UpdateConfig

func (pql Postgresql) UpdateConfig(config utils.Config) error

func (Postgresql) UpdateLastLoggedIn

func (pql Postgresql) UpdateLastLoggedIn(tx pgx.Tx, sub string, lastLoggedIn uint64) error

func (Postgresql) UpdateNostrAuthActivation

func (pql Postgresql) UpdateNostrAuthActivation(tx pgx.Tx, nonce string, activated bool) error

func (Postgresql) UpdateSeedsActiveStatus

func (pql Postgresql) UpdateSeedsActiveStatus(tx pgx.Tx, seeds []cashu.Seed) error

Jump to

Keyboard shortcuts

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