Documentation
¶
Index ¶
- func NewSequenceEndpoints() []*api.Endpoint
- func RegisterSequenceHandler(s server.Server, hdlr SequenceHandler, opts ...server.HandlerOption) error
- type MaxReq
- func (*MaxReq) Descriptor() ([]byte, []int)
- func (m *MaxReq) GetName() string
- func (*MaxReq) ProtoMessage()
- func (m *MaxReq) Reset()
- func (m *MaxReq) String() string
- func (m *MaxReq) XXX_DiscardUnknown()
- func (m *MaxReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MaxReq) XXX_Merge(src proto.Message)
- func (m *MaxReq) XXX_Size() int
- func (m *MaxReq) XXX_Unmarshal(b []byte) error
- type MaxRes
- func (*MaxRes) Descriptor() ([]byte, []int)
- func (m *MaxRes) GetValue() uint64
- func (*MaxRes) ProtoMessage()
- func (m *MaxRes) Reset()
- func (m *MaxRes) String() string
- func (m *MaxRes) XXX_DiscardUnknown()
- func (m *MaxRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *MaxRes) XXX_Merge(src proto.Message)
- func (m *MaxRes) XXX_Size() int
- func (m *MaxRes) XXX_Unmarshal(b []byte) error
- type NextReq
- func (*NextReq) Descriptor() ([]byte, []int)
- func (m *NextReq) GetName() string
- func (*NextReq) ProtoMessage()
- func (m *NextReq) Reset()
- func (m *NextReq) String() string
- func (m *NextReq) XXX_DiscardUnknown()
- func (m *NextReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NextReq) XXX_Merge(src proto.Message)
- func (m *NextReq) XXX_Size() int
- func (m *NextReq) XXX_Unmarshal(b []byte) error
- type NextRes
- func (*NextRes) Descriptor() ([]byte, []int)
- func (m *NextRes) GetValue() uint64
- func (*NextRes) ProtoMessage()
- func (m *NextRes) Reset()
- func (m *NextRes) String() string
- func (m *NextRes) XXX_DiscardUnknown()
- func (m *NextRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *NextRes) XXX_Merge(src proto.Message)
- func (m *NextRes) XXX_Size() int
- func (m *NextRes) XXX_Unmarshal(b []byte) error
- type SequenceHandler
- type SequenceService
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSequenceEndpoints ¶
func RegisterSequenceHandler ¶
func RegisterSequenceHandler(s server.Server, hdlr SequenceHandler, opts ...server.HandlerOption) error
Types ¶
type MaxReq ¶
type MaxReq struct {
// 序列号命名。
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*MaxReq) Descriptor ¶
func (*MaxReq) ProtoMessage ¶
func (*MaxReq) ProtoMessage()
func (*MaxReq) XXX_DiscardUnknown ¶
func (m *MaxReq) XXX_DiscardUnknown()
func (*MaxReq) XXX_Marshal ¶
func (*MaxReq) XXX_Unmarshal ¶
type MaxRes ¶
type MaxRes struct {
// 序列号的值。
Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*MaxRes) Descriptor ¶
func (*MaxRes) ProtoMessage ¶
func (*MaxRes) ProtoMessage()
func (*MaxRes) XXX_DiscardUnknown ¶
func (m *MaxRes) XXX_DiscardUnknown()
func (*MaxRes) XXX_Marshal ¶
func (*MaxRes) XXX_Unmarshal ¶
type NextReq ¶
type NextReq struct {
// 序列号命名。每个命名有自己的递增序列号,与其它命名互不影响。
Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*NextReq) Descriptor ¶
func (*NextReq) ProtoMessage ¶
func (*NextReq) ProtoMessage()
func (*NextReq) XXX_DiscardUnknown ¶
func (m *NextReq) XXX_DiscardUnknown()
func (*NextReq) XXX_Marshal ¶
func (*NextReq) XXX_Unmarshal ¶
type NextRes ¶
type NextRes struct {
// 序列号的值。
Value uint64 `protobuf:"varint,2,opt,name=value,proto3" json:"value,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*NextRes) Descriptor ¶
func (*NextRes) ProtoMessage ¶
func (*NextRes) ProtoMessage()
func (*NextRes) XXX_DiscardUnknown ¶
func (m *NextRes) XXX_DiscardUnknown()
func (*NextRes) XXX_Marshal ¶
func (*NextRes) XXX_Unmarshal ¶
type SequenceHandler ¶
type SequenceService ¶
type SequenceService interface {
// 对请求的序列号,加1之后返回。每个命名的序列号,从1开始。
Next(ctx context.Context, in *NextReq, opts ...client.CallOption) (*NextRes, error)
// 对请求的序列号,返回已分配的最大值。序列号用于终端和后台
// 的数据同步。考虑到一种情况:终端由于特殊原因收不到新消息
// 通知,因此终端决定对后台做轮询。当终端来后台收取未读消息
// 时,Max可以作为第一道检查,避免直接访问消息缓存查找是否
// 有未读消息。
Max(ctx context.Context, in *MaxReq, opts ...client.CallOption) (*MaxRes, error)
}
func NewSequenceService ¶
func NewSequenceService(name string, c client.Client) SequenceService
Click to show internal directories.
Click to hide internal directories.