postgresql

package
v0.6.0 Latest Latest
Warning

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

Go to latest
Published: May 20, 2026 License: MIT Imports: 16 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) GetBlindSigStatsRows added in v0.6.0

func (pql Postgresql) GetBlindSigStatsRows(ctx context.Context, tx pgx.Tx, startDate, endDate int64) ([]database.KeysetStatsRow, error)

func (Postgresql) GetConfig

func (pql Postgresql) GetConfig(tx pgx.Tx) (utils.Config, error)

func (Postgresql) GetLatestStatsSnapshot added in v0.6.0

func (pql Postgresql) GetLatestStatsSnapshot(ctx context.Context) (*database.StatsSnapshot, 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) GetMeltRequestsByTime added in v0.6.0

func (pql Postgresql) GetMeltRequestsByTime(ctx context.Context, since time.Time) ([]cashu.MeltRequestDB, error)

func (Postgresql) GetMeltStatsRows added in v0.6.0

func (pql Postgresql) GetMeltStatsRows(ctx context.Context, tx pgx.Tx, startDate, endDate int64) ([]database.MeltStatsRow, 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) GetMintRequestsByTime added in v0.6.0

func (pql Postgresql) GetMintRequestsByTime(ctx context.Context, since time.Time) ([]cashu.MintRequestDB, error)

func (Postgresql) GetMintStatsRows added in v0.6.0

func (pql Postgresql) GetMintStatsRows(ctx context.Context, tx pgx.Tx, startDate, endDate int64) ([]database.MintStatsRow, error)

func (Postgresql) GetNostrAuth

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

func (Postgresql) GetNostrNotificationConfig added in v0.6.0

func (pql Postgresql) GetNostrNotificationConfig(tx pgx.Tx) (*utils.NostrNotificationConfig, error)

func (Postgresql) GetProofStatsRows added in v0.6.0

func (pql Postgresql) GetProofStatsRows(ctx context.Context, tx pgx.Tx, startDate, endDate int64) ([]database.KeysetStatsRow, 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) 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) GetStatsFeeRows added in v0.6.0

func (pql Postgresql) GetStatsFeeRows(ctx context.Context, tx pgx.Tx, startDate, endDate int64) ([]database.KeysetFeeRow, error)

func (Postgresql) GetStatsSnapshotsBySince added in v0.6.0

func (pql Postgresql) GetStatsSnapshotsBySince(ctx context.Context, since int64) ([]database.StatsSnapshot, error)

func (Postgresql) GetTx

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

func (Postgresql) InsertStatsSnapshot added in v0.6.0

func (pql Postgresql) InsertStatsSnapshot(ctx context.Context, snapshot database.StatsSnapshot) 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) SearchLightningRequests added in v0.6.0

func (pql Postgresql) SearchLightningRequests(ctx context.Context, query string, since time.Time, limit int) ([]database.LightningActivityRow, error)

func (Postgresql) SetConfig

func (pql Postgresql) SetConfig(tx pgx.Tx, config utils.Config) error

func (Postgresql) SetProofsState

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

func (Postgresql) UpdateConfig

func (pql Postgresql) UpdateConfig(tx pgx.Tx, 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) UpdateNostrNotificationConfig added in v0.6.0

func (pql Postgresql) UpdateNostrNotificationConfig(tx pgx.Tx, config utils.NostrNotificationConfig) 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