routes

package
v0.0.0-...-86af830 Latest Latest
Warning

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

Go to latest
Published: Dec 12, 2023 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

View Source
const (
	InternalServerError = "Internal server error"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Routes

type Routes struct {
	// contains filtered or unexported fields
}

Routes ... Route handler struct

func NewRoutes

func NewRoutes(logger log.Logger, bv database.BridgeTransfersView, r *chi.Mux) Routes

NewRoutes ... Construct a new route handler instance

func (Routes) DocsHandler

func (h Routes) DocsHandler(w http.ResponseWriter, r *http.Request)

func (Routes) L1DepositsHandler

func (h Routes) L1DepositsHandler(w http.ResponseWriter, r *http.Request)

L1DepositsHandler ... Handles /api/v0/deposits/{address} GET requests

func (Routes) L2WithdrawalsHandler

func (h Routes) L2WithdrawalsHandler(w http.ResponseWriter, r *http.Request)

L2WithdrawalsHandler ... Handles /api/v0/withdrawals/{address} GET requests

func (Routes) SupplyView

func (h Routes) SupplyView(w http.ResponseWriter, r *http.Request)

SupplyView ... Handles /api/v0/supply GET requests

type Validator

type Validator struct{}

Validator ... Validates API user request parameters

func (*Validator) ParseValidateAddress

func (v *Validator) ParseValidateAddress(addr string) (common.Address, error)

ParseValidateAddress ... Validates and parses the address query parameter

func (*Validator) ParseValidateLimit

func (v *Validator) ParseValidateLimit(limit string) (int, error)

ParseValidateLimit ... Validates and parses the limit query parameters

func (*Validator) ValidateCursor

func (v *Validator) ValidateCursor(cursor string) error

ValidateCursor ... Validates and parses the cursor query parameter

Jump to

Keyboard shortcuts

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