pigeon

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: Apr 14, 2022 License: MIT Imports: 8 Imported by: 2

Documentation

Index

Constants

This section is empty.

Variables

View Source
var RoomType_name = map[int32]string{
	0: "ChatRoom",
	1: "LiveRoom",
}
View Source
var RoomType_value = map[string]int32{
	"ChatRoom": 0,
	"LiveRoom": 1,
}

Functions

func NewXClientForPigeonService

func NewXClientForPigeonService(addr string) (client.XClient, error)

NewXClientForPigeonService creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.

func NewXClientForRoomService

func NewXClientForRoomService(addr string) (client.XClient, error)

NewXClientForRoomService creates a XClient. You can configure this client with more options such as etcd registry, serialize type, select algorithm and fail mode.

func ServeForPigeonService

func ServeForPigeonService(addr string) error

ServeForPigeonService starts a server only registers one service. You can register more services and only start one server. It blocks until the application exits.

func ServeForRoomService

func ServeForRoomService(addr string) error

ServeForRoomService starts a server only registers one service. You can register more services and only start one server. It blocks until the application exits.

Types

type BroadcastArgs

type BroadcastArgs struct {
	Op                   uint32   `protobuf:"varint,1,opt,name=op,proto3" json:"op,omitempty"`
	Proto                *Proto   `protobuf:"bytes,2,opt,name=proto,proto3" json:"proto,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*BroadcastArgs) Descriptor

func (*BroadcastArgs) Descriptor() ([]byte, []int)

func (*BroadcastArgs) GetOp

func (m *BroadcastArgs) GetOp() uint32

func (*BroadcastArgs) GetProto

func (m *BroadcastArgs) GetProto() *Proto

func (*BroadcastArgs) ProtoMessage

func (*BroadcastArgs) ProtoMessage()

func (*BroadcastArgs) Reset

func (m *BroadcastArgs) Reset()

func (*BroadcastArgs) String

func (m *BroadcastArgs) String() string

func (*BroadcastArgs) XXX_DiscardUnknown

func (m *BroadcastArgs) XXX_DiscardUnknown()

func (*BroadcastArgs) XXX_Marshal

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

func (*BroadcastArgs) XXX_Merge

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

func (*BroadcastArgs) XXX_Size

func (m *BroadcastArgs) XXX_Size() int

func (*BroadcastArgs) XXX_Unmarshal

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

type JoinRoomArgs

type JoinRoomArgs struct {
	Id                   int64    `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`
	RoomId               int64    `protobuf:"varint,2,opt,name=roomId,proto3" json:"roomId,omitempty"`
	RoomType             RoomType `protobuf:"varint,3,opt,name=roomType,proto3,enum=proto.pigeon.RoomType" json:"roomType,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*JoinRoomArgs) Descriptor

func (*JoinRoomArgs) Descriptor() ([]byte, []int)

func (*JoinRoomArgs) GetId

func (m *JoinRoomArgs) GetId() int64

func (*JoinRoomArgs) GetRoomId

func (m *JoinRoomArgs) GetRoomId() int64

func (*JoinRoomArgs) GetRoomType

func (m *JoinRoomArgs) GetRoomType() RoomType

func (*JoinRoomArgs) ProtoMessage

func (*JoinRoomArgs) ProtoMessage()

func (*JoinRoomArgs) Reset

func (m *JoinRoomArgs) Reset()

func (*JoinRoomArgs) String

func (m *JoinRoomArgs) String() string

func (*JoinRoomArgs) XXX_DiscardUnknown

func (m *JoinRoomArgs) XXX_DiscardUnknown()

func (*JoinRoomArgs) XXX_Marshal

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

func (*JoinRoomArgs) XXX_Merge

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

func (*JoinRoomArgs) XXX_Size

func (m *JoinRoomArgs) XXX_Size() int

func (*JoinRoomArgs) XXX_Unmarshal

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

type PigeonServiceAble

type PigeonServiceAble interface {

	// PushMsgByUser is server rpc method as defined
	PushMsgByUser(ctx context.Context, args *PushMsgByUserArgs, reply *common.Err) (err error)

	// PushMsgByRoom is server rpc method as defined
	PushMsgByRoom(ctx context.Context, args *PushMsgByRoomArgs, reply *common.Err) (err error)

	// PushMsgByClient is server rpc method as defined
	PushMsgByClient(ctx context.Context, args *PushMsgByClientArgs, reply *common.Err) (err error)

	// Broadcast is server rpc method as defined
	Broadcast(ctx context.Context, args *BroadcastArgs, reply *common.Err) (err error)
}

================== interface skeleton ===================

type PigeonServiceClient

type PigeonServiceClient struct {
	// contains filtered or unexported fields
}

================== client stub =================== PigeonService is a client wrapped XClient.

func NewPigeonServiceClient

func NewPigeonServiceClient(xclient client.XClient) *PigeonServiceClient

NewPigeonServiceClient wraps a XClient as PigeonServiceClient. You can pass a shared XClient object created by NewXClientForPigeonService.

func (*PigeonServiceClient) Broadcast

func (c *PigeonServiceClient) Broadcast(ctx context.Context, args *BroadcastArgs) (reply *common.Err, err error)

Broadcast is client rpc method as defined

func (*PigeonServiceClient) PushMsgByClient

func (c *PigeonServiceClient) PushMsgByClient(ctx context.Context, args *PushMsgByClientArgs) (reply *common.Err, err error)

PushMsgByClient is client rpc method as defined

func (*PigeonServiceClient) PushMsgByRoom

func (c *PigeonServiceClient) PushMsgByRoom(ctx context.Context, args *PushMsgByRoomArgs) (reply *common.Err, err error)

PushMsgByRoom is client rpc method as defined

func (*PigeonServiceClient) PushMsgByUser

func (c *PigeonServiceClient) PushMsgByUser(ctx context.Context, args *PushMsgByUserArgs) (reply *common.Err, err error)

PushMsgByUser is client rpc method as defined

type PigeonServiceImpl

type PigeonServiceImpl struct{}

================== server skeleton ===================

func (*PigeonServiceImpl) Broadcast

func (s *PigeonServiceImpl) Broadcast(ctx context.Context, args *BroadcastArgs, reply *common.Err) (err error)

Broadcast is server rpc method as defined

func (*PigeonServiceImpl) PushMsgByClient

func (s *PigeonServiceImpl) PushMsgByClient(ctx context.Context, args *PushMsgByClientArgs, reply *common.Err) (err error)

PushMsgByClient is server rpc method as defined

func (*PigeonServiceImpl) PushMsgByRoom

func (s *PigeonServiceImpl) PushMsgByRoom(ctx context.Context, args *PushMsgByRoomArgs, reply *common.Err) (err error)

PushMsgByRoom is server rpc method as defined

func (*PigeonServiceImpl) PushMsgByUser

func (s *PigeonServiceImpl) PushMsgByUser(ctx context.Context, args *PushMsgByUserArgs, reply *common.Err) (err error)

PushMsgByUser is server rpc method as defined

type PigeonServiceOneClient

type PigeonServiceOneClient struct {
	// contains filtered or unexported fields
}

================== oneclient stub =================== PigeonServiceOneClient is a client wrapped oneClient.

func NewPigeonServiceOneClient

func NewPigeonServiceOneClient(oneclient client.OneClient) *PigeonServiceOneClient

NewPigeonServiceOneClient wraps a OneClient as PigeonServiceOneClient. You can pass a shared OneClient object created by NewOneClientForPigeonService.

func (*PigeonServiceOneClient) Broadcast

func (c *PigeonServiceOneClient) Broadcast(ctx context.Context, args *BroadcastArgs) (reply *common.Err, err error)

Broadcast is client rpc method as defined

func (*PigeonServiceOneClient) PushMsgByClient

func (c *PigeonServiceOneClient) PushMsgByClient(ctx context.Context, args *PushMsgByClientArgs) (reply *common.Err, err error)

PushMsgByClient is client rpc method as defined

func (*PigeonServiceOneClient) PushMsgByRoom

func (c *PigeonServiceOneClient) PushMsgByRoom(ctx context.Context, args *PushMsgByRoomArgs) (reply *common.Err, err error)

PushMsgByRoom is client rpc method as defined

func (*PigeonServiceOneClient) PushMsgByUser

func (c *PigeonServiceOneClient) PushMsgByUser(ctx context.Context, args *PushMsgByUserArgs) (reply *common.Err, err error)

PushMsgByUser is client rpc method as defined

type Proto

type Proto struct {
	DataLen              uint32   `protobuf:"varint,1,opt,name=dataLen,proto3" json:"dataLen,omitempty"`
	Op                   uint32   `protobuf:"varint,2,opt,name=op,proto3" json:"op,omitempty"`
	Ver                  uint32   `protobuf:"varint,3,opt,name=ver,proto3" json:"ver,omitempty"`
	Seq                  uint32   `protobuf:"varint,4,opt,name=seq,proto3" json:"seq,omitempty"`
	Body                 []byte   `protobuf:"bytes,5,opt,name=body,proto3" json:"body,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

v1.0.0 protocol

func (*Proto) Descriptor

func (*Proto) Descriptor() ([]byte, []int)

func (*Proto) GetBody

func (m *Proto) GetBody() []byte

func (*Proto) GetDataLen

func (m *Proto) GetDataLen() uint32

func (*Proto) GetOp

func (m *Proto) GetOp() uint32

func (*Proto) GetSeq

func (m *Proto) GetSeq() uint32

func (*Proto) GetVer

func (m *Proto) GetVer() uint32

func (*Proto) ProtoMessage

func (*Proto) ProtoMessage()

func (*Proto) Reset

func (m *Proto) Reset()

func (*Proto) String

func (m *Proto) String() string

func (*Proto) XXX_DiscardUnknown

func (m *Proto) XXX_DiscardUnknown()

func (*Proto) XXX_Marshal

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

func (*Proto) XXX_Merge

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

func (*Proto) XXX_Size

func (m *Proto) XXX_Size() int

func (*Proto) XXX_Unmarshal

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

type PushMsgByClientArgs

type PushMsgByClientArgs struct {
	CId                  uint64   `protobuf:"varint,1,opt,name=cId,proto3" json:"cId,omitempty"`
	Op                   uint32   `protobuf:"varint,2,opt,name=op,proto3" json:"op,omitempty"`
	Proto                *Proto   `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PushMsgByClientArgs) Descriptor

func (*PushMsgByClientArgs) Descriptor() ([]byte, []int)

func (*PushMsgByClientArgs) GetCId

func (m *PushMsgByClientArgs) GetCId() uint64

func (*PushMsgByClientArgs) GetOp

func (m *PushMsgByClientArgs) GetOp() uint32

func (*PushMsgByClientArgs) GetProto

func (m *PushMsgByClientArgs) GetProto() *Proto

func (*PushMsgByClientArgs) ProtoMessage

func (*PushMsgByClientArgs) ProtoMessage()

func (*PushMsgByClientArgs) Reset

func (m *PushMsgByClientArgs) Reset()

func (*PushMsgByClientArgs) String

func (m *PushMsgByClientArgs) String() string

func (*PushMsgByClientArgs) XXX_DiscardUnknown

func (m *PushMsgByClientArgs) XXX_DiscardUnknown()

func (*PushMsgByClientArgs) XXX_Marshal

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

func (*PushMsgByClientArgs) XXX_Merge

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

func (*PushMsgByClientArgs) XXX_Size

func (m *PushMsgByClientArgs) XXX_Size() int

func (*PushMsgByClientArgs) XXX_Unmarshal

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

type PushMsgByRoomArgs

type PushMsgByRoomArgs struct {
	RId                  int64    `protobuf:"varint,1,opt,name=rId,proto3" json:"rId,omitempty"`
	Op                   uint32   `protobuf:"varint,2,opt,name=op,proto3" json:"op,omitempty"`
	Proto                *Proto   `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PushMsgByRoomArgs) Descriptor

func (*PushMsgByRoomArgs) Descriptor() ([]byte, []int)

func (*PushMsgByRoomArgs) GetOp

func (m *PushMsgByRoomArgs) GetOp() uint32

func (*PushMsgByRoomArgs) GetProto

func (m *PushMsgByRoomArgs) GetProto() *Proto

func (*PushMsgByRoomArgs) GetRId

func (m *PushMsgByRoomArgs) GetRId() int64

func (*PushMsgByRoomArgs) ProtoMessage

func (*PushMsgByRoomArgs) ProtoMessage()

func (*PushMsgByRoomArgs) Reset

func (m *PushMsgByRoomArgs) Reset()

func (*PushMsgByRoomArgs) String

func (m *PushMsgByRoomArgs) String() string

func (*PushMsgByRoomArgs) XXX_DiscardUnknown

func (m *PushMsgByRoomArgs) XXX_DiscardUnknown()

func (*PushMsgByRoomArgs) XXX_Marshal

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

func (*PushMsgByRoomArgs) XXX_Merge

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

func (*PushMsgByRoomArgs) XXX_Size

func (m *PushMsgByRoomArgs) XXX_Size() int

func (*PushMsgByRoomArgs) XXX_Unmarshal

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

type PushMsgByUserArgs

type PushMsgByUserArgs struct {
	UId                  int64    `protobuf:"varint,1,opt,name=uId,proto3" json:"uId,omitempty"`
	Op                   uint32   `protobuf:"varint,2,opt,name=op,proto3" json:"op,omitempty"`
	Proto                *Proto   `protobuf:"bytes,3,opt,name=proto,proto3" json:"proto,omitempty"`
	XXX_NoUnkeyedLiteral struct{} `json:"-"`
	XXX_unrecognized     []byte   `json:"-"`
	XXX_sizecache        int32    `json:"-"`
}

func (*PushMsgByUserArgs) Descriptor

func (*PushMsgByUserArgs) Descriptor() ([]byte, []int)

func (*PushMsgByUserArgs) GetOp

func (m *PushMsgByUserArgs) GetOp() uint32

func (*PushMsgByUserArgs) GetProto

func (m *PushMsgByUserArgs) GetProto() *Proto

func (*PushMsgByUserArgs) GetUId

func (m *PushMsgByUserArgs) GetUId() int64

func (*PushMsgByUserArgs) ProtoMessage

func (*PushMsgByUserArgs) ProtoMessage()

func (*PushMsgByUserArgs) Reset

func (m *PushMsgByUserArgs) Reset()

func (*PushMsgByUserArgs) String

func (m *PushMsgByUserArgs) String() string

func (*PushMsgByUserArgs) XXX_DiscardUnknown

func (m *PushMsgByUserArgs) XXX_DiscardUnknown()

func (*PushMsgByUserArgs) XXX_Marshal

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

func (*PushMsgByUserArgs) XXX_Merge

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

func (*PushMsgByUserArgs) XXX_Size

func (m *PushMsgByUserArgs) XXX_Size() int

func (*PushMsgByUserArgs) XXX_Unmarshal

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

type RoomServiceAble

type RoomServiceAble interface {

	// JoinRoom is server rpc method as defined
	JoinRoom(ctx context.Context, args *JoinRoomArgs, reply *common.Err) (err error)
}

================== interface skeleton ===================

type RoomServiceClient

type RoomServiceClient struct {
	// contains filtered or unexported fields
}

================== client stub =================== RoomService is a client wrapped XClient.

func NewRoomServiceClient

func NewRoomServiceClient(xclient client.XClient) *RoomServiceClient

NewRoomServiceClient wraps a XClient as RoomServiceClient. You can pass a shared XClient object created by NewXClientForRoomService.

func (*RoomServiceClient) JoinRoom

func (c *RoomServiceClient) JoinRoom(ctx context.Context, args *JoinRoomArgs) (reply *common.Err, err error)

JoinRoom is client rpc method as defined

type RoomServiceImpl

type RoomServiceImpl struct{}

================== server skeleton ===================

func (*RoomServiceImpl) JoinRoom

func (s *RoomServiceImpl) JoinRoom(ctx context.Context, args *JoinRoomArgs, reply *common.Err) (err error)

JoinRoom is server rpc method as defined

type RoomServiceOneClient

type RoomServiceOneClient struct {
	// contains filtered or unexported fields
}

================== oneclient stub =================== RoomServiceOneClient is a client wrapped oneClient.

func NewRoomServiceOneClient

func NewRoomServiceOneClient(oneclient client.OneClient) *RoomServiceOneClient

NewRoomServiceOneClient wraps a OneClient as RoomServiceOneClient. You can pass a shared OneClient object created by NewOneClientForRoomService.

func (*RoomServiceOneClient) JoinRoom

func (c *RoomServiceOneClient) JoinRoom(ctx context.Context, args *JoinRoomArgs) (reply *common.Err, err error)

JoinRoom is client rpc method as defined

type RoomType

type RoomType int32
const (
	RoomType_ChatRoom RoomType = 0
	RoomType_LiveRoom RoomType = 1
)

func (RoomType) EnumDescriptor

func (RoomType) EnumDescriptor() ([]byte, []int)

func (RoomType) String

func (x RoomType) String() string

Jump to

Keyboard shortcuts

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