Documentation ¶
Index ¶
- Constants
- func CleanAndExpandPath(path string) string
- func DeprecatedConfigLocationCheck(path string, err error) (*toml.Tree, error)
- func FormatRoutes(ginRoutes gin.RoutesInfo) (routes []string)
- func Max(a, b int) int
- type AddrStatus
- type AddrsStatus
- type Bitcoind
- type Config
- type Info
- type Invoice
- type Invoices
- type Lnd
- type NewPayment
- type Payment
- type Status
- type StatusReply
Constants ¶
View Source
const ( DefaultConfigDir = "~/.lncm/" DefaultConfigFile = DefaultConfigDir + "invoicer.conf" DefaultLogFile = DefaultConfigDir + "invoicer.log" DefaultInvoiceExpiry = 180 MaxInvoiceDescLen = 639 )
Variables ¶
This section is empty.
Functions ¶
func CleanAndExpandPath ¶
CleanAndExpandPath converts passed file system paths into absolute ones.
func DeprecatedConfigLocationCheck ¶ added in v0.5.0
deprecatedConfigLocationCheck checks for a config file in a previously default location. Checking there will be
removed in one of the next versions. tl;dr: `mkdir ~/.lncm && mv ~/.invoicer/* ~/.lncm/ && rmdir ~/.invoicer`
OR, if you run in Docker, just change where your volume is mounted, ex:
`-v $(pwd)/:/root/.invoicer/` -> `-v $(pwd)/:/root/.lncm/`
func FormatRoutes ¶ added in v0.5.0
func FormatRoutes(ginRoutes gin.RoutesInfo) (routes []string)
Types ¶
type AddrStatus ¶
type AddrsStatus ¶
type AddrsStatus []AddrStatus
type Bitcoind ¶
type Bitcoind struct { Host string `toml:"host"` Port int64 `toml:"port"` User string `toml:"user"` Pass string `toml:"pass"` }
Bitcoind config NOTE: Keep in mind that this is **not yet encrypted**, so best to keep it _local_
type Config ¶
type Config struct { // Port invoicer will run on Port int64 `toml:"port"` // Path to directory where `index.html` will be served from StaticDir string `toml:"static-dir"` // Location of a log file LogFile string `toml:"log-file"` // Currently only `lnd` supported LnClient string `toml:"ln-client"` // Allows for disabling the possibility of on-chain payments. OffChainOnly bool `toml:"off-chain-only"` // [bitcoind] section in the `--config` file that defines Bitcoind's setup Bitcoind Bitcoind `toml:"bitcoind"` // [lnd] section in the `--config` file that defines Lnd's setup Lnd Lnd `toml:"lnd"` // An optional list of user:password pairs that will get granted access to the /history endpoint Users map[string]string `toml:"users"` }
This struct defines the structure of the config .toml file
type Lnd ¶
type Lnd struct { Host string `toml:"host"` Port int64 `toml:"port"` // TLS certificate is usually located in `~/.lnd/tls.cert` TLS string `toml:"tls"` // Macaroons are usually located in `~/.lnd/data/chain/bitcoin/mainnet/` Macaroons struct { // This is needed to generate new invoices Invoice string `toml:"invoice"` // This is needed to check status of invoices (and if enabled access `/history` endpoint) ReadOnly string `toml:"readonly"` } `toml:"macaroon"` // How many times try to talk to LND before committing suicide KillCount *int `toml:"kill-count"` }
Lnd config
type NewPayment ¶
type Payment ¶
type Payment struct { NewPayment Description string `json:"description"` // The requested amount for the payment Amount int64 `json:"amount"` // General status of the payment Expired bool `json:"is_expired"` Paid bool `json:"is_paid"` PaidAt int64 `json:"paid_at,omitempty"` // LN specific LnPaid bool `json:"ln_paid"` // BTC specific BtcPaid bool `json:"btc_paid"` // only true if amount >= the requested one BtcAmount int64 `json:"btc_amount"` Confirmations int64 `json:"confirmations"` TxIds []string `json:"txids"` }
func (*Payment) ApplyBtc ¶
func (p *Payment) ApplyBtc(s AddrStatus)
type Status ¶
type StatusReply ¶
type StatusReply struct { Code int `json:"-"` Error string `json:"error,omitempty"` Ln *Status `json:"ln,omitempty"` Bitcoin *AddrStatus `json:"bitcoin,omitempty"` }
Click to show internal directories.
Click to hide internal directories.