Documentation
¶
Index ¶
Constants ¶
View Source
const (
CLIENT = "client"
)
Variables ¶
View Source
var ( // ErrInvalidStream returned when the stream is invalid ErrInvalidStream = errors.New("invalid client stream") )
Functions ¶
This section is empty.
Types ¶
type Client ¶
type Client interface {
component.Component
// Call client method
Call(ctx context.Context, sc ServiceClient, method string, req interface{}, res interface{}, opts ...CallOption) error
// Stream client
Stream(ctx context.Context, sc ServiceClient, desc interface{}, method string, req interface{}, opts ...CallOption) (StreamClient, error)
// Get client connection
Dial(address string, opts ...DialOption) (pool.Connection, error)
}
Client interface to implement custom clients
type ServiceClient ¶
type ServiceClient interface {
// Get service name of the client
GetServiceName() string
// Get dial options for the client
GetDialOptions() []DialOption
}
ServiceClient is used by the generated code to return service config
type StreamClient ¶
type StreamClient interface {
// Send request
Send(req interface{}) error
// Close send and receive response
CloseAndRecv(res interface{}) error
// Receive response
Recv(res interface{}) error
// Close client connection
CloseConn() error
}
StreamClient interface is used by client implementation for streaming
Click to show internal directories.
Click to hide internal directories.