tor

package
v0.5.4 Latest Latest
Warning

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

Go to latest
Published: Apr 21, 2022 License: MIT Imports: 11 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type BaseOnionService

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

BaseOnionService is a concrete implementation of the service interface over Tor onion services.

func (*BaseOnionService) Broadcast

func (s *BaseOnionService) Broadcast(message []byte, capability tapir.Capability) error

Broadcast sends a message to all connections who possess the given capability

func (*BaseOnionService) Connect

func (s *BaseOnionService) Connect(hostname string, app tapir.Application) (bool, error)

Connect initializes a new outbound connection to the given peer, using the defined Application

func (*BaseOnionService) GarbageCollect added in v0.5.4

func (s *BaseOnionService) GarbageCollect()

GarbageCollect iterates through the connection pool and cleans up any connections that are closed that haven't been removed from the map.

func (*BaseOnionService) GetConnection

func (s *BaseOnionService) GetConnection(hostname string) (tapir.Connection, error)

GetConnection returns a connection for a given hostname.

func (*BaseOnionService) Init

Init initializes a BaseOnionService with a given private key and identity The private key is needed to initialize the Onion listen socket, ideally we could just pass an Identity in here.

func (*BaseOnionService) Listen

func (s *BaseOnionService) Listen(app tapir.Application) error

Listen starts a blocking routine that waits for incoming connections and initializes connections with them based on the given Application.

func (*BaseOnionService) Metrics

func (s *BaseOnionService) Metrics() tapir.ServiceMetrics

Metrics provides a report of useful information about the status of the service e.g. the number of active connections

func (*BaseOnionService) SetPort added in v0.3.2

func (s *BaseOnionService) SetPort(port int)

SetPort configures the port that the service uses.

func (*BaseOnionService) Shutdown

func (s *BaseOnionService) Shutdown()

Shutdown closes the service and ensures that any connections are closed.

func (*BaseOnionService) WaitForCapabilityOrClose

func (s *BaseOnionService) WaitForCapabilityOrClose(cid string, name tapir.Capability) (tapir.Connection, error)

WaitForCapabilityOrClose blocks until the connection has the given capability or the underlying connection is closed (through error or user action)

Jump to

Keyboard shortcuts

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