Documentation ¶
Index ¶
- Constants
- func DisableLog()
- func RespondWithError(w http.ResponseWriter, r *http.Request, userHttpCode int, format string, ...)
- func UseLogger(logger slog.Logger)
- type BETransaction
- type BETransactionPrevOut
- type BETransactionScriptPubkey
- type BETransactionVin
- type BETransactionVout
- type Politeiawww
- type TxDetails
Constants ¶
const ( LoginAttemptsToLockUser = 5 // Route to reset password at GUI ResetPasswordGuiRoute = "/password" // XXX what is this doing here? )
Variables ¶
This section is empty.
Functions ¶
func DisableLog ¶
func DisableLog()
DisableLog disables all library log output. Logging output is disabled by default until either UseLogger or SetLogWriter are called.
func RespondWithError ¶
func RespondWithError(w http.ResponseWriter, r *http.Request, userHttpCode int, format string, args ...interface{})
RespondWithError returns an HTTP error status to the client. If it's a user error, it returns a 4xx HTTP status and the specific user error code. If it's an internal server error, it returns 500 and an error code which is also outputted to the logs so that it can be correlated later if the user files a complaint.
Types ¶
type BETransaction ¶
type BETransaction struct { TxId string `json:"txid"` // Transaction id Vin []BETransactionVin `json:"vin"` // Transaction inputs Vout []BETransactionVout `json:"vout"` // Transaction outputs Confirmations uint64 `json:"confirmations"` // Number of confirmations Timestamp int64 `json:"time"` // Transaction timestamp }
BETransaction is an object representing a transaction; it's part of the data returned from the URL for the block explorer when fetching the transactions for an address.
type BETransactionPrevOut ¶
type BETransactionPrevOut struct {
Addresses []string `json:"addresses"` // Array of transaction input addresses
}
BETransactionPrevOut holds the information about the inputs' previous addresses. This will allow one to check for dev subsidy origination, etc.
type BETransactionScriptPubkey ¶
type BETransactionScriptPubkey struct {
Addresses []string `json:"addresses"` // Array of transaction input addresses
}
BETransactionScriptPubkey holds the script info for a transaction.
type BETransactionVin ¶
type BETransactionVin struct {
PrevOut BETransactionPrevOut `json:"prevOut"` // Previous transaction output
}
BETransactionVin holds the transaction prevOut address information
type BETransactionVout ¶
type BETransactionVout struct { Amount json.Number `json:"value"` // Transaction amount (in DCR) ScriptPubkey BETransactionScriptPubkey `json:"scriptPubkey"` // Transaction script info }
BETransactionVout holds the transaction amount information.
type Politeiawww ¶
Politeiawww represents the legacy politeiawww server.
func NewPoliteiawww ¶
func NewPoliteiawww(cfg *config.Config, router, auth *mux.Router, params *chaincfg.Params, pdclient *pdclient.Client) (*Politeiawww, error)
NewPoliteiawww returns a new legacy Politeiawww.
func (*Politeiawww) Close ¶
func (p *Politeiawww) Close()
Close performs any required shutdown and cleanup for Politeiawww.
type TxDetails ¶
type TxDetails struct { Address string // Transaction address TxID string // Transacion ID Amount uint64 // Transaction amount (in atoms) Timestamp int64 // Transaction timestamp Confirmations uint64 // Number of confirmations InputAddresses []string /// An array of all addresses from previous outputs }
TxDetails is an object representing a transaction. XXX This was previously being used to standardize the different responses from the dcrdata and insight APIs. Support for the insight API was removed but parts of politeiawww still consume this struct so it has remained.
Source Files ¶
- cmsaddresswatcher.go
- cmsemail.go
- cmsevents.go
- cmsnotifications.go
- cmsuser.go
- codestats.go
- dcc.go
- dcrdata.go
- decredplugin.go
- emailcache.go
- error.go
- invoices.go
- log.go
- paywall.go
- piuser.go
- politeiad.go
- politeiawww.go
- prices.go
- proposals.go
- routes.go
- testing.go
- totp.go
- user.go
- useremail.go
- www.go
- wwwcms.go
- wwwpiuser.go
- wwwproposals.go
- wwwuser.go