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
Source Files
¶
- application.go
- service.go
Click to show internal directories.
Click to hide internal directories.
