service

package
v0.0.0-...-25353bf Latest Latest
Warning

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

Go to latest
Published: Jun 2, 2020 License: MIT Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BeginFind

func BeginFind(req BeginReq) error

func BeginHandler

func BeginHandler(c *gin.Context)

func BeginUpdateDelayHandler

func BeginUpdateDelayHandler(c *gin.Context)

func ChoseNextNode

func ChoseNextNode(NeighborList map[string]conf.Neighbor, path string) (string, error)

func GetNeighborDelay

func GetNeighborDelay(req GetNeighborDelayReq) error

func GetNeighborDelayHandler

func GetNeighborDelayHandler(c *gin.Context)

func HandleRequest

func HandleRequest(req RequestReq) error

开线程处理蚂蚁

func HandleUpdate

func HandleUpdate(req UpdateTauReq) error

处理更新请求

func HandleUpdateData

func HandleUpdateData(req UpdateDataReq) error

更新目标节点数据

func LogConfig

func LogConfig(c *gin.Context)

func RecordAntResult

func RecordAntResult(req DestNodeReq) error

结果记录

func RecordPathResult

func RecordPathResult(content string) error

收敛结果记录

func RequestHandler

func RequestHandler(c *gin.Context)

func ResultHandler

func ResultHandler(c *gin.Context)

func SourceNodeHandleResponse

func SourceNodeHandleResponse(req DestNodeReq) error

func StartWebService

func StartWebService(c *conf.Conf)

func TestSt

func TestSt(c *gin.Context)

func UpdateData

func UpdateData(destNum string)

发送处理请求到目标节点

func UpdateDataHandler

func UpdateDataHandler(c *gin.Context)

更新tau

func UpdateHandler

func UpdateHandler(c *gin.Context)

更新tau

func XOR

func XOR(data, delta string) string

Types

type BeginReq

type BeginReq struct {
	SourceURL string `json:"source_url"`

	WorkChain string `json:"work_chain"`
}

type DestNodeReq

type DestNodeReq struct {
	SourceURL       string  `json:"source_url"`
	DestNumber      string  `json:"dest_number"`
	Round           int     `json:"round"`
	AntNumber       int     `json:"ant_number"`
	IsLastAnt       bool    `json:"is_last_ant"`
	IsLastRound     bool    `json:"is_last_round"`
	Path            string  `json:"path"`
	PathDelay       float64 `json:"path_delay"`
	PathDelayDetail string  `json:"path_delay_detail"`

	IsSuccess bool `json:"is_success"`
}

type GetDelayResp

type GetDelayResp struct {
	Code      int     `json:"code"`
	Message   string  `json:"message"`
	TimeDelay float64 `json:"time_delay"`
}

type GetNeighborDelayReq

type GetNeighborDelayReq struct {
	DataSize  int   `json:"data_size"`
	Round     int   `json:"round"`
	TimeStamp int64 `json:"time_stamp"`
}

type RequestReq

type RequestReq struct {
	SourceURL   string `json:"source_url"`
	DestNumber  string `json:"dest_number"`
	Round       int    `json:"round"`
	AntNumber   int    `json:"ant_number"`
	IsLastAnt   bool   `json:"is_last_ant"`
	IsLastRound bool   `json:"is_last_round"`

	Data          string `json:"data"`
	TimeStampNano int64  `json:"time_stamp_nano"`

	Path            string  `json:"path"`
	PathDelay       float64 `json:"path_delay"`
	PathDelayDetail string  `json:"path_delay_detail"`
}

type TestReq

type TestReq struct {
	TimeStamp     int64  `json:"time_stamp"`
	TimeStampNano int64  `json:"time_stamp_nano"`
	NextURL       string `json:"next_url"`
}

type UpdateDataReq

type UpdateDataReq struct {
	DataDelta string `json:"data_delta"`
}

type UpdateTauReq

type UpdateTauReq struct {
	Path     string `json:"path"`
	PathCost string `json:"path_cost"`
	Round    int    `json:"round"`

	Rho float64 `json:"rho"`
	Q   int     `json:"q"`
}

Jump to

Keyboard shortcuts

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