common

package module
v0.0.0-...-babcf44 Latest Latest
Warning

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

Go to latest
Published: Jun 3, 2022 License: MIT Imports: 0 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type P2pReq

type P2pReq struct {
	NowKey    string `json:"nowKey"`
	TargetKey string `json:"targetKey"`
}

type P2pResp

type P2pResp struct {
	Code       P2pRespStatus `json:"code"`
	NowAddr    string        `json:"nowAddr"`
	TargetAddr string        `json:"targetAddr"`
	Msg        string        `json:"msg"`
}

type P2pRespStatus

type P2pRespStatus int64
const (
	Success        P2pRespStatus = 0
	NotFoundTarget P2pRespStatus = 1
	Other          P2pRespStatus = -1
)

func (P2pRespStatus) Int64

func (p P2pRespStatus) Int64() int64

type PingReq

type PingReq struct {
	NowKey string `json:"nowKey"`
}

type Request

type Request struct {
	Type RequestType `json:"type"`
	Data []byte      `json:"data"`
}

type RequestType

type RequestType int64
const (
	P2p  RequestType = 0
	Ping RequestType = 1
)

func (RequestType) Int64

func (p RequestType) Int64() int64

type Response

type Response struct {
	Type RequestType `json:"type"`
	Data []byte      `json:"data"`
}

Jump to

Keyboard shortcuts

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