peer

package
v0.0.0-...-268d42b Latest Latest
Warning

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

Go to latest
Published: Mar 9, 2019 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package peer defines peer for the messenger

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Peer

type Peer struct {
	Name       string
	PublicKey  ed25519.PublicKey
	Connection net.Conn
}

Peer defines peer for the messagener

func New

func New(c net.Conn) (*Peer, error)

New creates a new peer

type Peers

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

Peers defines struct for store of map of peers

func (*Peers) Add

func (p *Peers) Add(name string, peer *Peer)

Add provides inserting of the new peer

func (*Peers) Get

func (p *Peers) Get(name string) (*Peer, error)

Get provides getting of the peer by the name

Jump to

Keyboard shortcuts

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