peer

package
v0.0.0-...-756aa5d Latest Latest
Warning

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

Go to latest
Published: Dec 26, 2020 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Adapter

type Adapter interface {
	URLValuesToPeer(values url.Values) (Peer, error)
	PeerToURLValues(peer Peer) url.Values
	StringToPeer(str string) (Peer, error)
}

Adapter represents a peer adapter

func NewAdapter

func NewAdapter() Adapter

NewAdapter creates a new adapter instance

type Builder

type Builder interface {
	Create() Builder
	WithHost(host string) Builder
	WithPort(port uint) Builder
	IsClear() Builder
	IsOnion() Builder
	Now() (Peer, error)
}

Builder represents a peer builder

func NewBuilder

func NewBuilder() Builder

NewBuilder creates a new builder instance

type Peer

type Peer interface {
	Host() string
	Port() uint
	IsClear() bool
	IsOnion() bool
	String() string
}

Peer represents a peer

func CreatePeerWithClear

func CreatePeerWithClear(host string, port uint) Peer

CreatePeerWithClear creates a new peer instance with clear

func CreatePeerWithOnion

func CreatePeerWithOnion(host string, port uint) Peer

CreatePeerWithOnion creates a new peer instance with onion

Jump to

Keyboard shortcuts

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