http

package
v0.0.0-...-0b69eb1 Latest Latest
Warning

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

Go to latest
Published: Oct 26, 2023 License: MIT Imports: 18 Imported by: 0

Documentation

Index

Constants

View Source
const ITEMS_LIMIT = 10000
View Source
const NODE_DICT_KEY_LEN = 32

Variables

View Source
var ErrNothingToRediscover = errors.New("nothing to rediscover")

Functions

This section is empty.

Types

type Handler

type Handler struct {
	StateProvider provider.StateProvider
	NodeProvider  provider.NodeProvider
	ItemProvider  provider.ItemProvider

	StateHolder *state.StateHolder

	Depth int

	NewStates chan *types.State
	Addresses chan *address.Address

	UpdateRecorder updates.Recorder
}

func (*Handler) RegisterHandlers

func (h *Handler) RegisterHandlers(e *echo.Echo)

type ItemRequest

type ItemRequest struct {
	Index uint64 `param:"index"`
}

type ItemResponse

type ItemResponse struct {
	Item      *data.ItemData `json:"item"`
	Root      types.Node     `json:"root"`
	ProofCell *cell.Cell     `json:"proof_cell"`
}

type ItemsRequest

type ItemsRequest struct {
	From  uint64 `query:"from"`
	Count uint64 `query:"count"`
}

type ItemsResponse

type ItemsResponse struct {
	Items     []*data.ItemData `json:"items"`
	LastIndex string           `json:"last_index"`
	Root      types.Node       `json:"root"`
}

type SetAddrRequest

type SetAddrRequest struct {
	AddressString string `param:"addr"`
}

type StateResponse

type StateResponse struct {
	Depth     int                `json:"depth"`
	Capacity  string             `json:"capacity"`
	LastIndex string             `json:"last_index"`
	Root      types.Node         `json:"root"`
	Address   *myaddress.Address `json:"address"`
}

Jump to

Keyboard shortcuts

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