courier

package
v0.0.0-...-12c2aea Latest Latest
Warning

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

Go to latest
Published: May 22, 2020 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func BridgeGetFileContent

func BridgeGetFileContent(key string, hash [20]byte) *bytes.Buffer

func BridgeListen

func BridgeListen(addr *net.TCPAddr)

func BridgeLocalCall

func BridgeLocalCall(srcNei resourcePool.GNeighbor, data func(net.Conn) []byte)

func BridgeSearchFileContent

func BridgeSearchFileContent(word string, pass *bufio.Reader, neighbors []resourcePool.GNeighbor) *bytes.Buffer

func BridgeSilentSend

func BridgeSilentSend(srcNei resourcePool.GNeighbor, data func(net.Conn) []byte)

func ConnectNeighbor

func ConnectNeighbor(rAddr *net.UDPAddr) []byte

func GetFileContent

func GetFileContent(rAddr *utils.UDPAddr, hash [20]byte) *bytes.Buffer

func GetIndexInfo

func GetIndexInfo(rAddr *net.UDPAddr) resourcePool.GTree

func SendData

func SendData(conn *net.UDPConn, ask []byte)

func SilentSend

func SilentSend(rAddr utils.UDPAddr, data func(*net.UDPConn) []byte)

func Start

func Start(wg event.Bus)

Types

type MiddleWareFn

type MiddleWareFn = func(askCode Op, resp Response) []byte

type Op

type Op byte
const (
	Done Op = 1 + iota
	AskIndex
	Get
	Connect
	TCP
	Pass
	Search
	Update
	Bypass
	Remove
	Patch
)

type Response

type Response struct {
	// contains filtered or unexported fields
}

Jump to

Keyboard shortcuts

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