routes

package
v0.0.0-...-7d63ed4 Latest Latest
Warning

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

Go to latest
Published: Mar 31, 2022 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BuildEndpoints

func BuildEndpoints(router *Router, handler *IndexHandler)

Types

type BalanceHandler

type BalanceHandler struct {
}

BalanceHandler handles balance requests

func (*BalanceHandler) Incoming

func (h *BalanceHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type CurrentChallengeHandler

type CurrentChallengeHandler struct {
}

BalanceHandler handles balance requests

func (*CurrentChallengeHandler) Incoming

func (h *CurrentChallengeHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type DifficultyHandler

type DifficultyHandler struct {
}

BalanceHandler handles balance requests

func (*DifficultyHandler) Incoming

func (h *DifficultyHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type DisputeStatusHandler

type DisputeStatusHandler struct {
}

BalanceHandler handles balance requests

func (*DisputeStatusHandler) Incoming

func (h *DisputeStatusHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type GasHandler

type GasHandler struct {
}

BalanceHandler handles balance requests

func (*GasHandler) Incoming

func (h *GasHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type GranularityHandler

type GranularityHandler struct {
}

BalanceHandler handles balance requests

func (*GranularityHandler) Incoming

func (h *GranularityHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type Handler

type Handler interface {
	Incoming(ctx context.Context, req *http.Request) (int, string)
}

Handler handle incoming http requests and produces a response code and JSON payload string

type IndexHandler

type IndexHandler struct {
}

BalanceHandler handles balance requests

func (*IndexHandler) Incoming

func (h *IndexHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type MiningStatusHandler

type MiningStatusHandler struct {
}

BalanceHandler handles balance requests

func (*MiningStatusHandler) Incoming

func (h *MiningStatusHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type QueryStringHandler

type QueryStringHandler struct {
}

BalanceHandler handles balance requests

func (*QueryStringHandler) Incoming

func (h *QueryStringHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type RequestIdHandler

type RequestIdHandler struct {
}

BalanceHandler handles balance requests

func (*RequestIdHandler) Incoming

func (h *RequestIdHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type Router

type Router struct {
	DB db.DB
	// contains filtered or unexported fields
}

Router holds all url to handler mappings and routes incoming http calls to handlers

func NewRouter

func NewRouter(DB db.DB) *Router

NewRouter creates a new router instance using the given DB instance

func (*Router) AddRoute

func (r *Router) AddRoute(path string, handler Handler)

AddRoute adds handler for the given url

func (*Router) ServeHTTP

func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request)

Default http handler callback which will route to appropriate handler internally

type TokenBalanceHandler

type TokenBalanceHandler struct {
}

BalanceHandler handles balance requests

func (*TokenBalanceHandler) Incoming

func (h *TokenBalanceHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type Top50Handler

type Top50Handler struct {
}

BalanceHandler handles balance requests

func (*Top50Handler) Incoming

func (h *Top50Handler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

type TotalTipHandler

type TotalTipHandler struct {
}

BalanceHandler handles balance requests

func (*TotalTipHandler) Incoming

func (h *TotalTipHandler) Incoming(ctx context.Context, req *http.Request) (int, string)

Incoming implementation for handler

Jump to

Keyboard shortcuts

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