conn_store

package
v0.0.0-...-6af2dc9 Latest Latest
Warning

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

Go to latest
Published: Nov 8, 2021 License: MIT Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrNoRoute = fmt.Errorf("unable to route")

Functions

This section is empty.

Types

type Conn

type Conn interface {
	RegisterPing(conn net.Conn)
	StopTCP()
	RegisterPingUDP(addr *net.UDPAddr)
	WriteUDP(pkt packet.TcpPacket) error
	WriteTCP(pkt packet.TcpPacket) error
}

type ConnInstance

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

func (*ConnInstance) RegisterPing

func (c *ConnInstance) RegisterPing(conn net.Conn)

func (*ConnInstance) RegisterPingUDP

func (c *ConnInstance) RegisterPingUDP(addr *net.UDPAddr)

func (*ConnInstance) StopTCP

func (c *ConnInstance) StopTCP()

func (*ConnInstance) WriteTCP

func (c *ConnInstance) WriteTCP(pkt packet.TcpPacket) error

func (*ConnInstance) WriteUDP

func (c *ConnInstance) WriteUDP(pkt packet.TcpPacket) error

type MockConnInstance

type MockConnInstance struct {
	RegisterPingFunc    func(conn net.Conn)
	StopTCPFunc         func()
	RegisterPingUDPFunc func(addr *net.UDPAddr)
	WriteUDPFunc        func(pkt packet.TcpPacket) error
	WriteTCPFunc        func(pkt packet.TcpPacket) error
}

func (MockConnInstance) RegisterPing

func (m MockConnInstance) RegisterPing(conn net.Conn)

func (MockConnInstance) StopTCP

func (m MockConnInstance) StopTCP()

func (MockConnInstance) WriteTCP

func (m MockConnInstance) WriteTCP(pkt packet.TcpPacket) error

func (MockConnInstance) WriteUDP

func (m MockConnInstance) WriteUDP(pkt packet.TcpPacket) error

type Store

type Store interface {
	Stop(ip string)
	Get(ip string) Conn
	New(ip string) Conn
}

func New

type StoreInstance

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

func (*StoreInstance) Get

func (s *StoreInstance) Get(ip string) Conn

func (*StoreInstance) New

func (s *StoreInstance) New(ip string) Conn

func (*StoreInstance) Stop

func (s *StoreInstance) Stop(ip string)

Jump to

Keyboard shortcuts

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