Documentation ¶
Index ¶
- type Brahms
- type Decoder
- type Encoder
- type Handler
- type MsgEmitReq
- type MsgNode
- type MsgProbeResp
- type MsgPullResp
- type MsgPushReq
- type Transport
- func (tr *Transport) Emit(ctx context.Context, c chan<- brahms.NID, id brahms.NID, msg []byte, ...)
- func (tr *Transport) Probe(ctx context.Context, c chan<- brahms.NID, id brahms.NID, n brahms.Node)
- func (tr *Transport) Pull(ctx context.Context, c chan<- brahms.View, from brahms.Node)
- func (tr *Transport) Push(ctx context.Context, self brahms.Node, to brahms.Node)
- func (tr *Transport) Request(ctx context.Context, method string, n brahms.Node, path string, body io.Reader, ...) (err error)
- func (tr *Transport) RequestOrLog(ctx context.Context, method string, n brahms.Node, path string, body io.Reader, ...) (ok bool)
- type TransportErr
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Decoder ¶
type Decoder interface {
Decode(v interface{}) (err error)
}
Decoder is used for decoding messages from the request
type Encoder ¶
type Encoder interface {
Encode(v interface{}) (err error)
}
Encoder is used for encoding messages to the handlers response
type Handler ¶
type Handler struct { C chan []byte // contains filtered or unexported fields }
Handler handles brahms related messages
func NewHandler ¶
NewHandler initates a new handler with default json encoding
type MsgEmitReq ¶
type MsgEmitReq struct {
Data []byte `json:"data"`
}
MsgEmitReq requests a peer to emit data
type MsgProbeResp ¶
type MsgProbeResp struct {
Active bool `json:"active"`
}
MsgProbeResp returns status info of a node
type Transport ¶
type Transport struct {
// contains filtered or unexported fields
}
Transport is a transport that uses an http client
func (*Transport) Emit ¶
func (tr *Transport) Emit(ctx context.Context, c chan<- brahms.NID, id brahms.NID, msg []byte, to brahms.Node)
Emit implements custom message emitting
type TransportErr ¶
TransportErr describes an error during transport functions
func (TransportErr) Error ¶
func (e TransportErr) Error() string
Click to show internal directories.
Click to hide internal directories.