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: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	CacheKeyUniqueProposers   = "unique-proposers"
	CacheKeyUniqueProvers     = "unique-provers"
	CacheKeyStats             = "stats"
	CacheKeyPOSStats          = "pos-stats"
	CacheKeyCurrentProvers    = "current-provers"
	CacheKeyTotalTransactions = "total-transactions"
)
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 GetCountByAddressAndEventNameResp

type GetCountByAddressAndEventNameResp struct {
	Count int `json:"count"`
}

GetCountByAddressAndEventName

 returns count of events by user address and event name

		@Summary		Get count of events by user address and event name
		@ID			   	get-charts-by-task
	    @Param			address	query		string		true	"address to query"
	    @Param			event	query		string		true	"event name to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} GetCountByAddressAndEventNameResp
		@Router			/eventByAddress [get]

type NewServerOpts

type NewServerOpts struct {
	Echo           *echo.Echo
	EventRepo      eventindexer.EventRepository
	StatRepo       eventindexer.StatRepository
	NFTBalanceRepo eventindexer.NFTBalanceRepository
	ChartRepo      eventindexer.ChartRepository
	EthClient      *ethclient.Client
	CorsOrigins    []string
}

func (NewServerOpts) Validate

func (opts NewServerOpts) Validate() error

type Server

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

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

func NewServer

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

func (*Server) GetAssignedBlocksByProverAddress

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

GetAssignedBlocksByProverAddress

 returns the assigned blocks for a given prover address.

		@Summary		Get assigned blocks by prover address
		@ID			   	get-assigned-blocks-by-prover-address
	    @Param			address	query		string		true	"address to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/assignedBlocks [get]

func (*Server) GetByAddressAndEventName

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

GetByAddressAndEventName

 returns events by address and name of the event

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

func (*Server) GetChartByTask

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

GetChartByTask

 returns time series data for displaying charts

		@Summary		Get time series data for displaying charts
		@ID			   	get-charts-by-task
	    @Param			task	query		string		true	"task to query"
	    @Param			start	query		string		true	"start date"
	    @Param			end	query		string		true	"end date"
		@Accept			json
		@Produce		json
		@Success		200	{object} eventindexer.ChartResponse
		@Router			/chart/chartByTask [get]

func (*Server) GetCountByAddressAndEventName

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

func (*Server) GetNFTBalancesByAddessAndChainID

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

GetNFTBalancesByAddessAndChainID

 returns nft balances by address and chain ID

		@Summary		Get nft balances by address and chain ID
		@ID			   	get-nft-balances-by-address-and-chain-id
	    @Param			address	query		string		true	"address to query"
	    @Param			chainID	query		string		true	"chainID to query"
		@Accept			json
		@Produce		json
		@Success		200	{object} paginate.Page
		@Router			/nftsByAddress [get]

func (*Server) GetStats

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

GetStats returns the current computed stats for the deployed network.

@Summary		Get stats
@ID			   	get-stats
@Accept			json
@Produce		json
@Success		200	{object} eventindexer.Stat
@Router			/stats [get]

func (*Server) GetUniqueProposers

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

GetUniqueProposers

 returns all unique proposers

		@Summary		Get unique proposers
		@ID			   	get-unique-proposers
		@Accept			json
		@Produce		json
		@Success		200	{object} uniqueProposersResp
		@Router			/uniqueProposers [get]

func (*Server) GetUniqueProvers

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

GetUniqueProvers

 returns all unique provers

		@Summary		Get unique provers
		@ID			   	get-unique-provers
		@Accept			json
		@Produce		json
		@Success		200	{object} uniqueProversResp
		@Router			/uniqueProvers [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

func (*Server) UserAddedLiquidity

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

func (*Server) UserBridged

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

func (*Server) UserProposedBlock

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

func (*Server) UserProvedBlock

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

func (*Server) UserSwappedOnTaiko

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

Jump to

Keyboard shortcuts

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