http

package
v0.3.1-0...-ee1233d Latest Latest
Warning

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

Go to latest
Published: Mar 15, 2024 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrNoHTTPFramework = errors.Validation.NewWithKeyAndDetail(
		"ERR_NO_HTTP_ENGINE",
		"HTTP framework required",
	)
	ErrNoRewarder = errors.Validation.NewWithKeyAndDetail(
		"ERR_NO_REWARDER",
		"Rewarder is required",
	)
)

Functions

func LogSkipper

func LogSkipper(c echo.Context) bool

Types

type NewServerOpts

type NewServerOpts struct {
	Echo            *echo.Echo
	EventRepo       relayer.EventRepository
	SuspendedTxRepo relayer.SuspendedTransactionRepository
	CorsOrigins     []string
	SrcEthClient    ethClient
	DestEthClient   ethClient
}

func (NewServerOpts) Validate

func (opts NewServerOpts) Validate() error

type Server

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

@host relayer.katla.taiko.xyz Server represents an relayer http server instance.

func NewServer

func NewServer(opts NewServerOpts) (*Server, error)

func (*Server) GetBlockInfo

func (srv *Server) GetBlockInfo(c echo.Context) error

getBlockInfoResponse

 returns block info for the chains

		@Summary		Get block info
		@ID			   	get-block-info
		@Accept			json
		@Produce		json
		@Success		200	{object} getBlockInfoResponse
		@Router			/blockInfo [get]

func (*Server) GetEventsByAddress

func (srv *Server) GetEventsByAddress(c echo.Context) error

GetEventsByAddress

 returns events by address

		@Summary		Get events by address
		@ID			   	get-events-by-address
	    @Param			address	query		string		true	"address to query"
	    @Param			msgHash	query		string		false	"msgHash to query"
	    @Param			chainID	query		string		false	"chainID to query"
	    @Param			eventType	query		string		false	"eventType to query"
	    @Param			event	query		string		false	"event to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/events [get]

func (*Server) GetSuspendedTransactions

func (srv *Server) GetSuspendedTransactions(c echo.Context) error

GetSuspendedTransactions

 returns suspended transactions

		@Summary		Get suspended transactions
		@ID			   	get-suspended-transactions
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/suspendedTransactions [get]

func (*Server) Health

func (srv *Server) Health(c echo.Context) error

Health endpoints for probes

func (*Server) ServeHTTP

func (srv *Server) ServeHTTP(w http.ResponseWriter, r *http.Request)

ServeHTTP implements the `http.Handler` interface which serves HTTP requests

func (*Server) Shutdown

func (srv *Server) Shutdown(ctx context.Context) error

Shutdown shuts down the HTTP server

func (*Server) Start

func (srv *Server) Start(address string) error

Start starts the HTTP server

Jump to

Keyboard shortcuts

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