Documentation ¶
Index ¶
- Variables
- type MockPushCli
- type PushCli
- func (p *PushCli) AddRoute(ctx context.Context, req *pb.AddRouteReq) (*pb.AddRouteResp, error)
- func (p *PushCli) Close() error
- func (p *PushCli) Connect(ctx context.Context, req *pb.ConnectReq) (*pb.ConnectResp, error)
- func (p *PushCli) DelUnack(ctx context.Context, req *pb.DelUnackReq) (*pb.DelUnackResp, error)
- func (p *PushCli) Disconnect(ctx context.Context, req *pb.DisconnectReq) (*pb.DisconnectResp, error)
- func (p *PushCli) GrpcOptions() []grpc.CallOption
- func (p *PushCli) PostSubscribe(ctx context.Context, req *pb.PostSubscribeReq) (*pb.PostSubscribeResp, error)
- func (p *PushCli) Pubcomp(ctx context.Context, req *pb.PubcompReq) (*pb.PubcompResp, error)
- func (p *PushCli) Publish(ctx context.Context, req *pb.PublishReq) (*pb.PublishResp, error)
- func (p *PushCli) Pubrec(ctx context.Context, req *pb.PubrecReq) (*pb.PubrecResp, error)
- func (p *PushCli) Pubrel(ctx context.Context, req *pb.PubrelReq) (*pb.PubrelResp, error)
- func (p *PushCli) Pull(ctx context.Context, req *pb.PullReq) (*pb.PullResp, error)
- func (p *PushCli) PutUnack(ctx context.Context, req *pb.PutUnackReq) (*pb.PutUnackResp, error)
- func (p *PushCli) RangeUnack(ctx context.Context, req *pb.RangeUnackReq) (*pb.RangeUnackResp, error)
- func (p *PushCli) Ready() bool
- func (p *PushCli) RemoveRoute(ctx context.Context, req *pb.RemoveRouteReq) (*pb.RemoveRouteResp, error)
- func (p *PushCli) String() string
- func (p *PushCli) Subscribe(ctx context.Context, req *pb.SubscribeReq) (*pb.SubscribeResp, error)
- func (p *PushCli) Unsubscribe(ctx context.Context, req *pb.UnsubscribeReq) (*pb.UnsubscribeResp, error)
Constants ¶
This section is empty.
Variables ¶
var ( // ErrAleradyClosed pushcli close ErrAleradyClosed = errors.New("pushcli already close") // ErrNoEndpoints there is no the endpoint of push ErrNoEndpoints = errors.New("no the endpoints of push") )
Functions ¶
This section is empty.
Types ¶
type MockPushCli ¶
MockPushCli it is used of unit testing provide a complete pushd service
func NewMockPushCli ¶
func NewMockPushCli(t *testing.T, etcdAddrs []string) *MockPushCli
NewMockPushCli new a pushcli object
type PushCli ¶
type PushCli struct { pb.PushServiceClient // contains filtered or unexported fields }
PushCli a grpc connection It completed the interaction with the push service When there is no the push service ,the status is pushStarting If pushcli is close ,status is pushClosed
func NewClient ¶
func NewClient(conf *conf.PushClient) (*PushCli, error)
NewClient new a pushcli object by configuration and the access logger is used of the recording of log Support for two ways to connect to push services 1. Specify fixed cluster address 2. Through discovery services Grpc connection mode is non-blocking mode , the connection will modify state successfully
func (*PushCli) AddRoute ¶
func (p *PushCli) AddRoute(ctx context.Context, req *pb.AddRouteReq) (*pb.AddRouteResp, error)
AddRoute complete the client addroute operation
func (*PushCli) Connect ¶
func (p *PushCli) Connect(ctx context.Context, req *pb.ConnectReq) (*pb.ConnectResp, error)
Connect complete the client connection operation
func (*PushCli) DelUnack ¶
func (p *PushCli) DelUnack(ctx context.Context, req *pb.DelUnackReq) (*pb.DelUnackResp, error)
DelUnack complete the client delunack operation
func (*PushCli) Disconnect ¶
func (p *PushCli) Disconnect(ctx context.Context, req *pb.DisconnectReq) (*pb.DisconnectResp, error)
Disconnect complete the client disconnection operation
func (*PushCli) GrpcOptions ¶
func (p *PushCli) GrpcOptions() []grpc.CallOption
func (*PushCli) PostSubscribe ¶
func (p *PushCli) PostSubscribe(ctx context.Context, req *pb.PostSubscribeReq) (*pb.PostSubscribeResp, error)
PostSubscribe complete the client postsubscribe operation
func (*PushCli) Pubcomp ¶
func (p *PushCli) Pubcomp(ctx context.Context, req *pb.PubcompReq) (*pb.PubcompResp, error)
Pubcomp complete the client pubcomp operation
func (*PushCli) Publish ¶
func (p *PushCli) Publish(ctx context.Context, req *pb.PublishReq) (*pb.PublishResp, error)
Publish complete the client publish operation
func (*PushCli) PutUnack ¶
func (p *PushCli) PutUnack(ctx context.Context, req *pb.PutUnackReq) (*pb.PutUnackResp, error)
PutUnack complete the client putunack operation
func (*PushCli) RangeUnack ¶
func (p *PushCli) RangeUnack(ctx context.Context, req *pb.RangeUnackReq) (*pb.RangeUnackResp, error)
RangeUnack complete the client rangeunack operation
func (*PushCli) RemoveRoute ¶
func (p *PushCli) RemoveRoute(ctx context.Context, req *pb.RemoveRouteReq) (*pb.RemoveRouteResp, error)
RemoveRoute complete the client removeroute operation
func (*PushCli) Subscribe ¶
func (p *PushCli) Subscribe(ctx context.Context, req *pb.SubscribeReq) (*pb.SubscribeResp, error)
Subscribe complete the client subscribe operation
func (*PushCli) Unsubscribe ¶
func (p *PushCli) Unsubscribe(ctx context.Context, req *pb.UnsubscribeReq) (*pb.UnsubscribeResp, error)
Unsubscribe complete the client unsubscribe operation