handlers

package
v0.0.1 Latest Latest
Warning

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

Go to latest
Published: May 24, 2020 License: MIT Imports: 8 Imported by: 0

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

Jump to

Keyboard shortcuts

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