legacy

package
v1.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 22, 2021 License: ISC Imports: 79 Imported by: 0

Documentation

Index

Constants

View Source
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.

func UseLogger

func UseLogger(logger slog.Logger)

UseLogger uses a specified Logger to output package logging info. This should be used in preference to SetLogWriter if the caller is also using slog.

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

type Politeiawww struct {
	sync.RWMutex
	// contains filtered or unexported fields
}

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.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL