handlers

package
v0.1.10 Latest Latest
Warning

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

Go to latest
Published: Jan 29, 2019 License: GPL-3.0 Imports: 16 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func AccountBalanceHandler

func AccountBalanceHandler(w http.ResponseWriter, r *http.Request)

func AccountErrorHandler

func AccountErrorHandler(w http.ResponseWriter, r *http.Request, ga *blockchain.GladiusAccountManager) error

Account Manager Error Handler, checks required account permissions prior to accessing API endpoints

func AccountTransactionsHandler

func AccountTransactionsHandler(w http.ResponseWriter, r *http.Request)

func CreateSignedMessageHandler

func CreateSignedMessageHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

func ErrorHandler

func ErrorHandler(w http.ResponseWriter, r *http.Request, m string, e error, statusCode int)

ErrorHandler - Default Error Handler

func GetContentLinksHandler

func GetContentLinksHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

GetContentLinksHandler gets the links to the given list of files from random nodes in the network

func GetContentNeededHandler

func GetContentNeededHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

GetContentNeededHandler compares the content provided with what is required by the pool and returns the deltas in the format website/<asset or route/filename

func GetFullStateHandler

func GetFullStateHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

GetFullStateHandler gets the current state the node has access to.

func GetNodeStateHandler

func GetNodeStateHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

GetNodeStateHandler gets the current state of a specific node

func GetSignatureListHandler

func GetSignatureListHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

GetSignatureListHandler gets the list of signatures used to create the current state

func JoinHandler

func JoinHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

JoinHandler takes in an IP and tries to join it's cluster

func KeystoreAccountCreationHandler

func KeystoreAccountCreationHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

func KeystoreAccountRetrievalHandler

func KeystoreAccountRetrievalHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

func KeystoreAccountUnlockHandler

func KeystoreAccountUnlockHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

func LeaveHandler

func LeaveHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

func MarketPoolsHandler

func MarketPoolsHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

MarketPoolsHandler - Returns all Pools

func NotFoundHandler

func NotFoundHandler(w http.ResponseWriter, r *http.Request)

NotFoundHandler is a route not found handler

func PoolPublicDataHandler

func PoolPublicDataHandler(ga *blockchain.GladiusAccountManager) func(w http.ResponseWriter, r *http.Request)

PoolPublicDataHandler gets the public data of a specified pool

func PoolResponseForAddress

func PoolResponseForAddress(poolAddress string, ga *blockchain.GladiusAccountManager) (blockchain.PoolResponse, error)

PoolResponseForAddress formats a pool response

func PushStateMessageHandler

func PushStateMessageHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

PushStateMessageHandler updates state with signed update and pushes state to a set of random peers. They then propigate it to their peers until the network has a consistent state

func ResponseHandler

func ResponseHandler(w http.ResponseWriter, r *http.Request, m string, success bool, err *string, res interface{}, transaction *types.Transaction)

ResponseHandler default Response Handler

func SetStateDebugHandler

func SetStateDebugHandler(p *peer.Peer) func(w http.ResponseWriter, r *http.Request)

func StatusHandler

func StatusHandler(w http.ResponseWriter, r *http.Request)

StatusHandler Main Status API route handler

func StatusTxHandler

func StatusTxHandler(w http.ResponseWriter, r *http.Request)

StatusTxHandler - Checks Status of txHash

func VerifySignedMessageHandler

func VerifySignedMessageHandler(w http.ResponseWriter, r *http.Request)

VerifySignedMessageHandler verifies the incoming message with takes the form of: {"message": "b64string", "hash": "b64string", "signature": "b64string", "address": ""}

func VersionHandler added in v0.1.3

func VersionHandler(version string) func(w http.ResponseWriter, r *http.Request)

VersionHandler - version information of the current module

Types

This section is empty.

Jump to

Keyboard shortcuts

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