Documentation ¶
Index ¶
Constants ¶
View Source
const LastNBlocks = 100
LastNBlocks defines limit of blocks showed in tail when requested
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HandlerService ¶
type HandlerService struct { GetService *repository.GetService StoreService *repository.StoreService }
HandlerService to operate with handlers
func GetHandlerService ¶
func GetHandlerService() *HandlerService
GetHandlerService creates and returns handlers service
func NewHandlerService ¶
func NewHandlerService(getService *repository.GetService, storeService *repository.StoreService) *HandlerService
NewHandlerService creates handler service + generates Genesis block and store it in pudge
func (*HandlerService) HandleGetBlock ¶
func (s *HandlerService) HandleGetBlock(w http.ResponseWriter, r *http.Request)
HandleGetBlock handles GET request on get block by hash
func (*HandlerService) HandleGetLastBlocks ¶
func (s *HandlerService) HandleGetLastBlocks(w http.ResponseWriter, r *http.Request)
HandleGetLastBlocks handles GET request on get last N blocks
func (*HandlerService) HandleWriteBlock ¶
func (s *HandlerService) HandleWriteBlock(w http.ResponseWriter, r *http.Request)
HandleWriteBlock writes 1 block at a time
Click to show internal directories.
Click to hide internal directories.