tapir

package module
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Oct 29, 2020 License: MIT Imports: 10 Imported by: 0

README

TAPir: Tiny Anonymous Peer

Tapir is a small library for building p2p applications over anonymous communication systems (right now Tapir only supports Tor v3 Onion Services).

Tapir has been designed as a replacement to the Ricochet protocol.

Features

  • New Authentication Protocol based on v3 Onion Services
  • Bidirectional Application Channels.

Work In Progress

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Application

type Application interface {
	NewInstance() Application
	Init(connection Connection)
	Transcript() *core.Transcript
	PropagateTranscript(transcript *core.Transcript)
}

Application defines the interface for all Tapir Applications

type Capability

type Capability string

Capability defines a status granted to a connection, from an application. That allows the connection to access other Application or functions within an Application.

type Connection

type Connection interface {
	Hostname() string
	IsOutbound() bool
	ID() *primitives.Identity
	Expect() []byte
	SetHostname(hostname string)
	HasCapability(name Capability) bool
	SetCapability(name Capability)
	SetEncryptionKey(key [32]byte)
	Send(message []byte)
	Close()
	App() Application
	SetApp(application Application)
	IsClosed() bool
	Broadcast(message []byte, capability Capability) error
}

Connection Interface

func NewConnection

func NewConnection(service Service, id *primitives.Identity, hostname string, outbound bool, conn io.ReadWriteCloser, app Application) Connection

NewConnection creates a new Connection

type InteractiveApplication

type InteractiveApplication interface {
	Application
	Listen()
}

InteractiveApplication defines the interface for interactive Tapir applications (apps that expect the user to send and receive messages from)

type Service

type Service interface {
	Init(acn connectivity.ACN, privateKey ed25519.PrivateKey, identity *primitives.Identity)
	Connect(hostname string, application Application) (bool, error)
	Listen(application Application) error
	GetConnection(connectionID string) (Connection, error)
	Metrics() ServiceMetrics
	Broadcast(message []byte, capability Capability) error
	WaitForCapabilityOrClose(connectionID string, capability Capability) (Connection, error)
	Shutdown()
}

Service defines the interface for a Tapir Service

type ServiceMetrics

type ServiceMetrics struct {
	ConnectionCount int
}

ServiceMetrics outlines higher level information about the service e.g. counts of connections

Directories

Path Synopsis
networks
tor

Jump to

Keyboard shortcuts

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