Documentation ¶
Index ¶
- type Configuration
- type GetKeySetOptions
- type MintStorage
- type MySqlConfig
- type SqlDatabase
- func (s SqlDatabase) DeleteProof(proof cashu.Proof) error
- func (s SqlDatabase) GetKeySet(options ...GetKeySetOptions) ([]crypto.KeySet, error)
- func (s SqlDatabase) GetLightningInvoice(hash string) (lightning.Invoicer, error)
- func (s SqlDatabase) GetLightningInvoices(paid bool) ([]invoice.Invoice, error)
- func (s SqlDatabase) GetReservedProofs() ([]cashu.Proof, error)
- func (s SqlDatabase) GetScripts(address string) ([]cashu.P2SHScript, error)
- func (s SqlDatabase) GetUsedProofs(secrets ...string) ([]cashu.Proof, error)
- func (s SqlDatabase) Migrate(object interface{}) error
- func (s SqlDatabase) ProofsUsed(in []string) []cashu.Proof
- func (s SqlDatabase) StoreKeySet(k crypto.KeySet) error
- func (s SqlDatabase) StoreLightningInvoice(i lightning.Invoicer) error
- func (s SqlDatabase) StorePromise(p cashu.Promise) error
- func (s SqlDatabase) StoreProof(p cashu.Proof) error
- func (s SqlDatabase) StoreScript(p cashu.P2SHScript) error
- func (s SqlDatabase) StoreUsedProofs(proof cashu.ProofsUsed) error
- func (s SqlDatabase) UpdateLightningInvoice(hash string, options ...UpdateInvoiceOptions) error
- type SqliteConfig
- type UpdateInvoiceOptions
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Configuration ¶
type Configuration struct { Database struct { MySql *MySqlConfig `json:"mySql" yaml:"mySql"` Sqlite *SqliteConfig `json:"sqlite" yaml:"sqlite"` } `json:"database" yaml:"database"` }
var Config Configuration
type GetKeySetOptions ¶ added in v0.1.7
func KeySetWithId ¶ added in v0.1.7
func KeySetWithId(id string) GetKeySetOptions
func KeySetWithMintUrl ¶ added in v0.1.7
func KeySetWithMintUrl(mintUrl string) GetKeySetOptions
type MintStorage ¶
type MintStorage interface { GetUsedProofs(secrets ...string) ([]cashu.Proof, error) GetReservedProofs() ([]cashu.Proof, error) ProofsUsed([]string) []cashu.Proof StoreProof(proof cashu.Proof) error DeleteProof(proof cashu.Proof) error StoreUsedProofs(proof cashu.ProofsUsed) error StorePromise(p cashu.Promise) error StoreScript(p cashu.P2SHScript) error GetScripts(address string) ([]cashu.P2SHScript, error) StoreLightningInvoice(i lightning.Invoicer) error GetLightningInvoice(hash string) (lightning.Invoicer, error) GetLightningInvoices(paid bool) ([]invoice.Invoice, error) // todo -- the return type of this interface function must be of type lightning.Invoicer UpdateLightningInvoice(hash string, options ...UpdateInvoiceOptions) error GetKeySet(options ...GetKeySetOptions) ([]crypto.KeySet, error) StoreKeySet(k crypto.KeySet) error Migrate(interface{}) error }
func NewSqlDatabase ¶
func NewSqlDatabase() MintStorage
type MySqlConfig ¶
type SqlDatabase ¶
type SqlDatabase struct {
// contains filtered or unexported fields
}
func (SqlDatabase) DeleteProof ¶
func (s SqlDatabase) DeleteProof(proof cashu.Proof) error
func (SqlDatabase) GetKeySet ¶ added in v0.1.7
func (s SqlDatabase) GetKeySet(options ...GetKeySetOptions) ([]crypto.KeySet, error)
func (SqlDatabase) GetLightningInvoice ¶
func (s SqlDatabase) GetLightningInvoice(hash string) (lightning.Invoicer, error)
GetLightningInvoice reads lighting invoice from db
func (SqlDatabase) GetLightningInvoices ¶
func (s SqlDatabase) GetLightningInvoices(paid bool) ([]invoice.Invoice, error)
GetLightningInvoices
func (SqlDatabase) GetReservedProofs ¶
func (s SqlDatabase) GetReservedProofs() ([]cashu.Proof, error)
func (SqlDatabase) GetScripts ¶
func (s SqlDatabase) GetScripts(address string) ([]cashu.P2SHScript, error)
func (SqlDatabase) GetUsedProofs ¶
func (s SqlDatabase) GetUsedProofs(secrets ...string) ([]cashu.Proof, error)
GetUsedProofs reads all proofs from db
func (SqlDatabase) Migrate ¶
func (s SqlDatabase) Migrate(object interface{}) error
func (SqlDatabase) ProofsUsed ¶
func (s SqlDatabase) ProofsUsed(in []string) []cashu.Proof
func (SqlDatabase) StoreKeySet ¶ added in v0.1.7
func (s SqlDatabase) StoreKeySet(k crypto.KeySet) error
func (SqlDatabase) StoreLightningInvoice ¶
func (s SqlDatabase) StoreLightningInvoice(i lightning.Invoicer) error
StoreLightningInvoice will store lightning invoice in db
func (SqlDatabase) StorePromise ¶
func (s SqlDatabase) StorePromise(p cashu.Promise) error
StorePromise will write promise to db
func (SqlDatabase) StoreProof ¶
func (s SqlDatabase) StoreProof(p cashu.Proof) error
StoreProof will write proof to db
func (SqlDatabase) StoreScript ¶
func (s SqlDatabase) StoreScript(p cashu.P2SHScript) error
func (SqlDatabase) StoreUsedProofs ¶
func (s SqlDatabase) StoreUsedProofs(proof cashu.ProofsUsed) error
func (SqlDatabase) UpdateLightningInvoice ¶
func (s SqlDatabase) UpdateLightningInvoice(hash string, options ...UpdateInvoiceOptions) error
UpdateLightningInvoice updates lightning invoice in db
type SqliteConfig ¶
type UpdateInvoiceOptions ¶
func UpdateInvoicePaid ¶
func UpdateInvoicePaid(paid bool) UpdateInvoiceOptions
func UpdateInvoiceTimePaid ¶
func UpdateInvoiceTimePaid(t time.Time) UpdateInvoiceOptions
func UpdateInvoiceWithIssued ¶
func UpdateInvoiceWithIssued(issued bool) UpdateInvoiceOptions
Click to show internal directories.
Click to hide internal directories.