Documentation ¶
Overview ¶
Package conf is for working with dot-donate files. See: https://github.com/aboodman/dot-donate.
Index ¶
Constants ¶
View Source
const ( // DonateFile is the name of the dot-donate file. DonateFile string = ".donate" // PaymentTypeBTC indicates payment should happen using the Bitcoin network. PaymentTypeBTC string = "BTC" // PaymentTypePayPal indicates payment should happen using PayPal. PaymentTypePayPal string = "PayPal" // PaymentTypeUSDC indicates payment should happen using Coinbase's stablecoin, USDC. PaymentTypeUSDC string = "USDC" // PaymentTypeNone indicates no payment type. PaymentTypeNone string = "" )
Variables ¶
View Source
var ( // ErrNoSupportedPaymentType is returned by conf.Read() when the config looks valid, but it // doesn't contain a payment type tythe supports. ErrNoSupportedPaymentType error = errors.New("No supported payment type") )
Functions ¶
func ValidUSDCAddress ¶
ValidUSDCAddress returns true if an string is a correctly formated USDC address. It doesn't check whether the address actually exists.
Types ¶
type Config ¶
type Config struct { BTC string `json:"BTC,omitempty"` PayPal string `json:"PayPal,omitempty"` USDC string `json:"USDC,omitempty"` }
Config describes the json metadata developers add to their package to opt-in to receiving tythes.
func (Config) AddressForType ¶
AddressForType returns the address to be used for a particular payment type.
func (Config) PreferredPaymentType ¶
PreferredPaymentType returns the payment type that should be used, in the case that multiple are specified.
type PaymentType ¶
type PaymentType string
PaymentType is a mechanism that tythe can use to move money between parties.
Click to show internal directories.
Click to hide internal directories.