Documentation
¶
Index ¶
- Constants
- type Agent
- type BufferedNode
- type Log
- type Message
- type NOOPLogger
- func (n *NOOPLogger) Debug(v ...interface{})
- func (n *NOOPLogger) Debugf(v ...interface{})
- func (n *NOOPLogger) Error(v ...interface{})
- func (n *NOOPLogger) Errorf(format string, v ...interface{})
- func (n *NOOPLogger) Info(v ...interface{})
- func (n *NOOPLogger) Infof(format string, v ...interface{})
- func (n *NOOPLogger) Warn(v ...interface{})
- func (n *NOOPLogger) Warnf(format string, v ...interface{})
- type P2PNode
- type PeerStore
- type Server
Constants ¶
View Source
const ( PublicKeySize = ed25519.PublicKeySize SignatureSize = ed25519.SignatureSize )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Agent ¶
type Agent struct {
}
Agent is the main tft agent entity
func (*Agent) SetupAdminControl ¶
func (a *Agent) SetupAdminControl()
SetupAdminControl for the agent, allowing it to be controlled over an http interface. WARNING: this interface has full controll over the agent, including wallets and their secrets
type BufferedNode ¶
type BufferedNode struct {
// contains filtered or unexported fields
}
func NewBufferedNode ¶
func NewBufferedNode(store PeerStore) *BufferedNode
NewBufferedNode creates a new buffered node embedding a regular P2PNode
func (*BufferedNode) PeerID ¶
func (bn *BufferedNode) PeerID() string
PeerID returns the underlying nodes PeerID
func (*BufferedNode) Send ¶
func (bn *BufferedNode) Send(message Message) error
type Message ¶
type Message struct {
// Sender digital twin ID
Sender uint64 `json:"sender"`
// Receiver digital twin ID
Receiver uint64 `json:"receiver"`
// Topic of the message
Topic string `json:"topic"`
// TTL of the message, after this time, the message should be flushed from
// receiving and sending buffers.
TTL time.Time `json:"ttl"`
// Payload of the message
Payload []byte `json:"payload"`
}
Message being sent between peers
type NOOPLogger ¶
type NOOPLogger struct{}
func (*NOOPLogger) Debug ¶
func (n *NOOPLogger) Debug(v ...interface{})
func (*NOOPLogger) Debugf ¶
func (n *NOOPLogger) Debugf(v ...interface{})
func (*NOOPLogger) Error ¶
func (n *NOOPLogger) Error(v ...interface{})
func (*NOOPLogger) Errorf ¶
func (n *NOOPLogger) Errorf(format string, v ...interface{})
func (*NOOPLogger) Info ¶
func (n *NOOPLogger) Info(v ...interface{})
func (*NOOPLogger) Infof ¶
func (n *NOOPLogger) Infof(format string, v ...interface{})
func (*NOOPLogger) Warn ¶
func (n *NOOPLogger) Warn(v ...interface{})
func (*NOOPLogger) Warnf ¶
func (n *NOOPLogger) Warnf(format string, v ...interface{})
type P2PNode ¶
type P2PNode struct {
// contains filtered or unexported fields
}
P2PNode handles streams amd connections
func NewP2PNode ¶
type PeerStore ¶
type PeerStore interface {
// PeerID currently associated with this digital twin
PeerID(dtid uint64) (string, error)
// PublicKey of this digital twin
PublicKey(dtid uint64) ([PublicKeySize]byte, error)
// SetPeerId of this digital twin. This should override a cached peer ID of
// a digital twin. NOTE: because the transport does not validate keys of remote
// digital twins, a malicous entity could emulate a peer ID and poison the peer
// cache. As such, this should only be used in development.
SetPeerID(dtid uint64, pid string)
}
PeerStore allows looking up info for a peer digital twin ID
Source Files
¶
Click to show internal directories.
Click to hide internal directories.