Documentation ¶
Index ¶
- Variables
- func BuildResponsePeerInfo(ip string, pubKey Key, metaData map[string]string) (*pb.Envelope, error)
- func RecvWithTimeout(timeout time.Duration, stream Stream) (*pb.Envelope, error)
- type Address
- type CStreamWrapper
- type ConnID
- type Connection
- type ConnectionID
- type ConnectionStore
- type Crypto
- type GrpcConnection
- func (conn *GrpcConnection) Close()
- func (conn *GrpcConnection) GetID() ConnID
- func (conn *GrpcConnection) GetIP() Address
- func (conn *GrpcConnection) GetMetaData() map[string]string
- func (conn *GrpcConnection) GetPeerKey() Key
- func (conn *GrpcConnection) Handle(handler Handler)
- func (conn *GrpcConnection) Send(payload []byte, protocol string, successCallBack func(interface{}), ...)
- func (conn *GrpcConnection) Start() error
- func (conn *GrpcConnection) Verify(envelope *pb.Envelope) bool
- type Handler
- type Key
- type KeyID
- type KeyOpts
- type KeyRecoverer
- type Message
- type PeerInfo
- type SStreamWrapper
- type Signer
- type Stream
- type StreamWrapper
- type Verifier
Constants ¶
This section is empty.
Variables ¶
View Source
var ErrConnAlreadyExist = errors.New("connection already exist in store")
View Source
var ErrConnNotExist = errors.New("connection not exist in store")
View Source
var ErrIPv4Format = errors.New("invalid IPv4 format")
Functions ¶
func BuildResponsePeerInfo ¶
Types ¶
type CStreamWrapper ¶
type CStreamWrapper struct {
// contains filtered or unexported fields
}
func (*CStreamWrapper) Close ¶
func (csw *CStreamWrapper) Close()
func (*CStreamWrapper) GetStream ¶
func (csw *CStreamWrapper) GetStream() Stream
type Connection ¶
type Connection interface { Send(data []byte, protocol string, successCallBack func(interface{}), errCallBack func(error)) Close() GetIP() Address GetPeerKey() Key GetID() ConnID GetMetaData() map[string]string Start() error Handle(handler Handler) }
func NewConnection ¶
func NewConnection(ip string, metaData map[string]string, peerKey Key, streamWrapper StreamWrapper, crypto Crypto) (Connection, error)
type ConnectionID ¶
type ConnectionID string
type ConnectionStore ¶
func NewConnectionStore ¶
func NewConnectionStore() *ConnectionStore
func (ConnectionStore) AddConnection ¶
func (connStore ConnectionStore) AddConnection(conn Connection) error
func (ConnectionStore) DeleteConnection ¶
func (connStore ConnectionStore) DeleteConnection(connID ConnID) error
func (ConnectionStore) GetConnection ¶
func (connStore ConnectionStore) GetConnection(connID ConnID) (Connection, error)
type Crypto ¶ added in v0.2.0
type Crypto struct { Signer Verifier KeyRecoverer }
type GrpcConnection ¶
type GrpcConnection struct { ID ConnID sync.RWMutex Crypto // contains filtered or unexported fields }
func (*GrpcConnection) Close ¶
func (conn *GrpcConnection) Close()
func (*GrpcConnection) GetID ¶
func (conn *GrpcConnection) GetID() ConnID
func (*GrpcConnection) GetIP ¶
func (conn *GrpcConnection) GetIP() Address
func (*GrpcConnection) GetMetaData ¶ added in v0.1.11
func (conn *GrpcConnection) GetMetaData() map[string]string
func (*GrpcConnection) GetPeerKey ¶
func (conn *GrpcConnection) GetPeerKey() Key
func (*GrpcConnection) Handle ¶
func (conn *GrpcConnection) Handle(handler Handler)
func (*GrpcConnection) Send ¶
func (conn *GrpcConnection) Send(payload []byte, protocol string, successCallBack func(interface{}), errCallBack func(error))
func (*GrpcConnection) Start ¶
func (conn *GrpcConnection) Start() error
type KeyRecoverer ¶ added in v0.2.1
type SStreamWrapper ¶
type SStreamWrapper struct {
// contains filtered or unexported fields
}
server stream wrapper
func (*SStreamWrapper) Close ¶
func (ssw *SStreamWrapper) Close()
func (*SStreamWrapper) GetStream ¶
func (ssw *SStreamWrapper) GetStream() Stream
type StreamWrapper ¶
func NewClientStreamWrapper ¶
func NewClientStreamWrapper(conn *grpc.ClientConn) (StreamWrapper, error)
client stream wrapper
func NewServerStreamWrapper ¶
func NewServerStreamWrapper(serverStream pb.StreamService_BifrostStreamServer, cancel context.CancelFunc) StreamWrapper
Click to show internal directories.
Click to hide internal directories.