roundgrp

package
v0.0.0-...-8401909 Latest Latest
Warning

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

Go to latest
Published: May 4, 2022 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Handlers

type Handlers struct {
	BlockCore block.Core
	AlgodCore algod.Core
}

func (Handlers) GetCurrentRoundFromAPI

func (h Handlers) GetCurrentRoundFromAPI(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetCurrentRoundFromAPI retrieves the current round and returns the block data from Algod API

func (Handlers) GetEarliestSyncedRound

func (h Handlers) GetEarliestSyncedRound(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetEarliestSyncedRound retrieves the earliest block from CouchDB.

func (Handlers) GetLatestSyncedRound

func (h Handlers) GetLatestSyncedRound(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetLatestSyncedRound the latest block from CouchDB.

func (Handlers) GetRound

func (h Handlers) GetRound(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetRound retrieves a block from CouchDB based on the round number (num)

func (Handlers) GetRoundFromAPI

func (h Handlers) GetRoundFromAPI(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetRoundFromAPI retrieves a block from the Algod API based on the round number (num)

func (Handlers) GetRoundsPagination

func (h Handlers) GetRoundsPagination(ctx context.Context, w http.ResponseWriter, r *http.Request) error

GetRoundsPagination accepts the following parameters: - limit: number of items per page - latest_blk: the latest block number client wants to start with - page: number of pages - order: asc/desc The application counts from the latest_blk, calculates the number of pages using the number of items specified and retrieves the list of block for different pages. It returns the number of pages, number of blocks til the end and the list of blocks of interest as the response.

Jump to

Keyboard shortcuts

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