webapi

package
v0.0.0-...-5fa8bf8 Latest Latest
Warning

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

Go to latest
Published: May 18, 2024 License: MIT Imports: 8 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var Bye = Msg{Type: "bye"}
View Source
var Completed = func(PbftPoolCsv []PbftItem, desc []metrics.Desc) Msg {
	return Msg{
		Type: "completed",
		Content: Report{
			PbftPoolCsv:    PbftPoolCsv,
			MeasureOutputs: desc,
		},
	}
}
View Source
var Computing = func(Total int, Count int) Msg {
	return Msg{
		Type: "computing",
		Content: Progress{
			Total: Total,
			Count: Count,
		},
	}
}
View Source
var Hello = Msg{Type: "hello"}
View Source
var Started = Msg{Type: "started"}
View Source
var ValNothing = Nothing{} // 一个方便的单例。

Functions

func RunApiServer

func RunApiServer()

构建一个富有状态的echo函数和相应状态chan。并且返回chan供写入。

func RunFrontendServer

func RunFrontendServer()

Types

type ApiProxy

type ApiProxy interface {
	Enqueue(m Msg)
	// contains filtered or unexported methods
}
var GlobalProxy ApiProxy

type DumbProxy

type DumbProxy struct {
}

func (DumbProxy) Enqueue

func (dp DumbProxy) Enqueue(m Msg)

type GoodApiProxy

type GoodApiProxy struct {
	Append_Signal signal.Signal[Msg]
	// contains filtered or unexported fields
}

func NewGoodApiProxy

func NewGoodApiProxy() *GoodApiProxy

func (*GoodApiProxy) Enqueue

func (ap *GoodApiProxy) Enqueue(m Msg)

给PBFT模块用。

type Msg

type Msg struct {
	Type    string      `json:"type"`
	Content interface{} `json:"content"`
}

type Nothing

type Nothing struct{} // 表示不携带东西的空元组事件data

type PbftItem

type PbftItem struct {
	TxpoolSize int `json:"txpool_size"`
	Tx         int `json:"tx"`
}

type Progress

type Progress struct {
	Count int `json:"count"`
	Total int `json:"total"`
}

type Report

type Report struct {
	PbftPoolCsv    []PbftItem     `json:"pbftShardCsv"`
	MeasureOutputs []metrics.Desc `json:"measureOutputs"`
}

Jump to

Keyboard shortcuts

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