Documentation ¶
Index ¶
- Variables
- func CreateLogger(level string, devMode bool) *zap.Logger
- func EnsureDefault(a, b string) string
- func IsRouteForEnv(env string, addr ilp.Address) error
- func LoadFileConfig(filename string, cfg *Config) ([]string, error)
- func NewAPI(s *Service, rt *Router) *httprouter.Router
- func Start(cfg *Config) (func() error, error)
- type Callback
- type CallbackChan
- type CallbackFn
- type CallbackResult
- type Config
- type Opts
- type Peer
- type PingRequest
- type PingResponse
- type Router
- func (r *Router) AddPeer(connId string) error
- func (r *Router) FlushTable()
- func (r *Router) HandleRequest(connId string, msg *ilp.MessagePrepare) ilp.Message
- func (r *Router) Info() map[string]interface{}
- func (r *Router) NextHop(destination ilp.Address) (string, error)
- func (r *Router) RemovePeer(connId string) error
- func (r *Router) Run() error
- type Sender
- type Service
- func (s *Service) ConnectToPeer(address string, data *btp.AuthData, transport string) error
- func (s *Service) DisconnectFromPeer(connId string) error
- func (s *Service) GenerateTxInit(tag string) (ilp.Address, string, error)
- func (s *Service) Info() map[string]interface{}
- func (s *Service) SendBiDirectionalPing(ctx context.Context, address ilp.Address) error
- func (s *Service) SendMessage(ctx context.Context, id string, msg *ilp.MessagePrepare, ff [32]byte, ...) error
- func (s *Service) Start() error
- func (s *Service) Stop() error
- type Transport
- type TransportConnection
- type WebsocketTransport
- func (b *WebsocketTransport) Close(id string) error
- func (b *WebsocketTransport) Name() string
- func (b *WebsocketTransport) Open(address string) (*TransportConnection, error)
- func (b *WebsocketTransport) Send(id string, data []byte) error
- func (b *WebsocketTransport) Start() (<-chan *TransportConnection, error)
- func (b *WebsocketTransport) Stop(ctx context.Context) error
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Version string CompiledAt string GoVersion string )
Automatically injected during compilation. Use make compile target.
Functions ¶
func EnsureDefault ¶
func LoadFileConfig ¶
LoadFileConfig creates a new connector based on the configuration defined in the provided file
Types ¶
type CallbackChan ¶
type CallbackChan chan *CallbackResult
type CallbackFn ¶
type CallbackResult ¶
type Config ¶
type Config struct { Env string `yaml:"env"` LogLevel string `yaml:"log_level"` DevMode bool `yaml:"dev_mode"` Admin struct { Enable bool `yaml:"enable"` Host string `yaml:"string"` Port int `yaml:"port"` } `yaml:"admin"` IlpAddress ilp.Address `yaml:"ilpAddress"` BTP struct { Host string `yaml:"host"` Port int `yaml:"port"` } `yaml:"btp"` Storage storage.Config `yaml:"storage"` Peers []Peer `yaml:"peers"` }
type PingRequest ¶
type PingResponse ¶
type Router ¶
type Router struct {
// contains filtered or unexported fields
}
func (*Router) FlushTable ¶
func (r *Router) FlushTable()
func (*Router) HandleRequest ¶
func (*Router) RemovePeer ¶
type Service ¶
type Service struct {
// contains filtered or unexported fields
}
func (*Service) ConnectToPeer ¶
ConnectToPeer tries to open a connection to the target and initialize a channel. If the transport does not exist or there was an irrecoverable network issue, it returns an error. If the transport connection is successful, the peer goes through the normal authentication flow.
func (*Service) DisconnectFromPeer ¶
func (*Service) GenerateTxInit ¶
func (*Service) SendBiDirectionalPing ¶
func (*Service) SendMessage ¶
type Transport ¶
type Transport interface { // Start starts up the transport and begins accepting connections. Start() (<-chan *TransportConnection, error) // Open opens a new connection with the remote Open(address string) (*TransportConnection, error) // Close closes the connection Close(id string) error // Send sends data over a connection Send(id string, data []byte) error // Stop starts tearing down the transports. It stops accepting new peer // and waits for the completion of pending ones. Stop(ctx context.Context) error // Name uniquely identifies the transport. Used mainly for logging purposes. Name() string }
type TransportConnection ¶
type TransportConnection struct {
// contains filtered or unexported fields
}
type WebsocketTransport ¶
type WebsocketTransport struct {
// contains filtered or unexported fields
}
func NewWebSocketTransport ¶
func NewWebSocketTransport(log *zap.Logger, address string) *WebsocketTransport
func (*WebsocketTransport) Close ¶
func (b *WebsocketTransport) Close(id string) error
func (*WebsocketTransport) Name ¶
func (b *WebsocketTransport) Name() string
func (*WebsocketTransport) Open ¶
func (b *WebsocketTransport) Open(address string) (*TransportConnection, error)
func (*WebsocketTransport) Start ¶
func (b *WebsocketTransport) Start() (<-chan *TransportConnection, error)
Source Files ¶
Directories ¶
Path | Synopsis |
---|---|
Package mock is a generated GoMock package.
|
Package mock is a generated GoMock package. |
* Copyright (c) 2019 Uroš Hercog <uros@orcus.network> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License.
|
* Copyright (c) 2019 Uroš Hercog <uros@orcus.network> * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. |
Click to show internal directories.
Click to hide internal directories.