Documentation ¶
Index ¶
- Variables
- type Client
- type Http
- type HttpConfig
- type MessageHandler
- type Websocket
- func (c *Websocket) Close() error
- func (c *Websocket) GetRequestID() uint64
- func (c *Websocket) Send(req, res *rony.MessageEnvelope) (err error)
- func (c *Websocket) SendWithContext(ctx context.Context, req, res *rony.MessageEnvelope) (err error)
- func (c *Websocket) SendWithDetails(ctx context.Context, req, res *rony.MessageEnvelope, waitToConnect bool, ...) (err error)
- type WebsocketConfig
Constants ¶
This section is empty.
Variables ¶
View Source
var ( ErrTimeout = fmt.Errorf("time out") ErrLeaderRedirect = fmt.Errorf("leader redirect") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface { Send(req *rony.MessageEnvelope, res *rony.MessageEnvelope) error Close() error GetRequestID() uint64 }
type Http ¶ added in v0.0.49
type Http struct {
// contains filtered or unexported fields
}
func NewHttp ¶ added in v0.0.49
func NewHttp(config HttpConfig) *Http
func (*Http) GetRequestID ¶ added in v0.0.49
func (*Http) Send ¶ added in v0.0.49
func (h *Http) Send(req *rony.MessageEnvelope, res *rony.MessageEnvelope) (err error)
type HttpConfig ¶ added in v0.0.49
type MessageHandler ¶
type MessageHandler func(m *rony.MessageEnvelope)
type Websocket ¶
type Websocket struct {
// contains filtered or unexported fields
}
func NewWebsocket ¶
func NewWebsocket(config WebsocketConfig) *Websocket
func (*Websocket) GetRequestID ¶
func (*Websocket) SendWithContext ¶
type WebsocketConfig ¶ added in v0.0.49
type WebsocketConfig struct { HostPort string IdleTimeout time.Duration DialTimeout time.Duration Handler MessageHandler Header map[string]string Secure bool ForceConnect bool // RequestMaxRetry is the maximum number client sends a request if any network layer error occurs RequestMaxRetry int // RequestTimeout is the timeout for each individual request on each try. RequestTimeout time.Duration // ContextTimeout is the amount that Send function will wait until times out. This includes all the retries. ContextTimeout time.Duration }
Click to show internal directories.
Click to hide internal directories.