connection

package
v0.0.0-...-644f3f1 Latest Latest
Warning

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

Go to latest
Published: May 25, 2023 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func HandleConnection

func HandleConnection(pool *Pool, conn net.Conn, callback func(message string))

Types

type Message

type Message struct {
	Kind     string
	Version  string
	Data     string
	Datetime string
}

type Pool

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

func NewPool

func NewPool(peers []string) *Pool

func (*Pool) Add

func (p *Pool) Add(conn net.Conn) error

func (*Pool) Broadcast

func (p *Pool) Broadcast(msg Message)

func (*Pool) ListConnections

func (p *Pool) ListConnections() []net.Conn

func (*Pool) Remove

func (p *Pool) Remove(conn net.Conn)

Jump to

Keyboard shortcuts

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