Documentation
¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
View Source
var ( // ErrIllegalHeaderWrite indicates that setting header is illegal because of // the stream's state. ErrIllegalHeaderWrite = errors.New("transport: the stream is done or WriteHeader was already called") )
Functions ¶
func SetupConnOptions ¶ added in v0.1.1
func SetupConnOptions(opts []nats.Option) []nats.Option
SetupConnOptions default conn opts.
Types ¶
type Client ¶
type Client struct {
// contains filtered or unexported fields
}
func (*Client) Invoke ¶
func (c *Client) Invoke(ctx context.Context, method string, args interface{}, reply interface{}, opts ...grpc.CallOption) error
Invoke performs a unary RPC and returns after the request is received into reply.
func (*Client) NewStream ¶
func (c *Client) NewStream(ctx context.Context, desc *grpc.StreamDesc, method string, opts ...grpc.CallOption) (grpc.ClientStream, error)
NewStream begins a streaming RPC.
type NatsConn ¶
type NatsConn interface { Publish(subj string, data []byte) error PublishRequest(subj, reply string, data []byte) error Request(subj string, data []byte, timeout time.Duration) (*nats.Msg, error) ChanSubscribe(subj string, ch chan *nats.Msg) (*nats.Subscription, error) SubscribeSync(subj string) (*nats.Subscription, error) QueueSubscribe(subj, queue string, cb nats.MsgHandler) (*nats.Subscription, error) LastError() error Flush() error }
NatsConn nats connection.
type Server ¶
type Server struct {
// contains filtered or unexported fields
}
Server is the interface to gRPC over NATS
func (*Server) RegisterService ¶
func (p *Server) RegisterService(sd *grpc.ServiceDesc, ss interface{})
RegisterService is used to register gRPC services
Click to show internal directories.
Click to hide internal directories.