sequence

package
v0.0.0-...-551f129 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Aug 28, 2023 License: Apache-2.0 Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func NewSequenceEndpoints

func NewSequenceEndpoints() []*api.Endpoint

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) Descriptor() ([]byte, []int)

func (*MaxReq) GetName

func (m *MaxReq) GetName() string

func (*MaxReq) ProtoMessage

func (*MaxReq) ProtoMessage()

func (*MaxReq) Reset

func (m *MaxReq) Reset()

func (*MaxReq) String

func (m *MaxReq) String() string

func (*MaxReq) XXX_DiscardUnknown

func (m *MaxReq) XXX_DiscardUnknown()

func (*MaxReq) XXX_Marshal

func (m *MaxReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaxReq) XXX_Merge

func (m *MaxReq) XXX_Merge(src proto.Message)

func (*MaxReq) XXX_Size

func (m *MaxReq) XXX_Size() int

func (*MaxReq) XXX_Unmarshal

func (m *MaxReq) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*MaxRes) GetValue

func (m *MaxRes) GetValue() uint64

func (*MaxRes) ProtoMessage

func (*MaxRes) ProtoMessage()

func (*MaxRes) Reset

func (m *MaxRes) Reset()

func (*MaxRes) String

func (m *MaxRes) String() string

func (*MaxRes) XXX_DiscardUnknown

func (m *MaxRes) XXX_DiscardUnknown()

func (*MaxRes) XXX_Marshal

func (m *MaxRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*MaxRes) XXX_Merge

func (m *MaxRes) XXX_Merge(src proto.Message)

func (*MaxRes) XXX_Size

func (m *MaxRes) XXX_Size() int

func (*MaxRes) XXX_Unmarshal

func (m *MaxRes) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*NextReq) GetName

func (m *NextReq) GetName() string

func (*NextReq) ProtoMessage

func (*NextReq) ProtoMessage()

func (*NextReq) Reset

func (m *NextReq) Reset()

func (*NextReq) String

func (m *NextReq) String() string

func (*NextReq) XXX_DiscardUnknown

func (m *NextReq) XXX_DiscardUnknown()

func (*NextReq) XXX_Marshal

func (m *NextReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NextReq) XXX_Merge

func (m *NextReq) XXX_Merge(src proto.Message)

func (*NextReq) XXX_Size

func (m *NextReq) XXX_Size() int

func (*NextReq) XXX_Unmarshal

func (m *NextReq) XXX_Unmarshal(b []byte) error

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) Descriptor() ([]byte, []int)

func (*NextRes) GetValue

func (m *NextRes) GetValue() uint64

func (*NextRes) ProtoMessage

func (*NextRes) ProtoMessage()

func (*NextRes) Reset

func (m *NextRes) Reset()

func (*NextRes) String

func (m *NextRes) String() string

func (*NextRes) XXX_DiscardUnknown

func (m *NextRes) XXX_DiscardUnknown()

func (*NextRes) XXX_Marshal

func (m *NextRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)

func (*NextRes) XXX_Merge

func (m *NextRes) XXX_Merge(src proto.Message)

func (*NextRes) XXX_Size

func (m *NextRes) XXX_Size() int

func (*NextRes) XXX_Unmarshal

func (m *NextRes) XXX_Unmarshal(b []byte) error

type SequenceHandler

type SequenceHandler interface {
	// 对请求的序列号,加1之后返回。每个命名的序列号,从1开始。
	Next(context.Context, *NextReq, *NextRes) error
	// 对请求的序列号,返回已分配的最大值。序列号用于终端和后台
	// 的数据同步。考虑到一种情况:终端由于特殊原因收不到新消息
	// 通知,因此终端决定对后台做轮询。当终端来后台收取未读消息
	// 时,Max可以作为第一道检查,避免直接访问消息缓存查找是否
	// 有未读消息。
	Max(context.Context, *MaxReq, *MaxRes) error
}

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL