Documentation
¶
Index ¶
- Constants
- Variables
- func NewCometEndpoints() []*api.Endpoint
- func RegisterCometHandler(s server.Server, hdlr CometHandler, opts ...server.HandlerOption) error
- type Auth
- func (*Auth) Descriptor() ([]byte, []int)
- func (m *Auth) GetToken() string
- func (*Auth) ProtoMessage()
- func (m *Auth) Reset()
- func (m *Auth) String() string
- func (m *Auth) XXX_DiscardUnknown()
- func (m *Auth) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Auth) XXX_Merge(src proto.Message)
- func (m *Auth) XXX_Size() int
- func (m *Auth) XXX_Unmarshal(b []byte) error
- type BroadcastReq
- func (*BroadcastReq) Descriptor() ([]byte, []int)
- func (m *BroadcastReq) GetEvt() string
- func (m *BroadcastReq) GetRid() string
- func (*BroadcastReq) ProtoMessage()
- func (m *BroadcastReq) Reset()
- func (m *BroadcastReq) String() string
- func (m *BroadcastReq) XXX_DiscardUnknown()
- func (m *BroadcastReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BroadcastReq) XXX_Merge(src proto.Message)
- func (m *BroadcastReq) XXX_Size() int
- func (m *BroadcastReq) XXX_Unmarshal(b []byte) error
- type BroadcastRes
- func (*BroadcastRes) Descriptor() ([]byte, []int)
- func (*BroadcastRes) ProtoMessage()
- func (m *BroadcastRes) Reset()
- func (m *BroadcastRes) String() string
- func (m *BroadcastRes) XXX_DiscardUnknown()
- func (m *BroadcastRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *BroadcastRes) XXX_Merge(src proto.Message)
- func (m *BroadcastRes) XXX_Size() int
- func (m *BroadcastRes) XXX_Unmarshal(b []byte) error
- type Comet
- func (c *Comet) Broadcast(ctx context.Context, req *BroadcastReq, res *BroadcastRes) error
- func (c *Comet) DumpSession(ctx context.Context, req *DumpSessionReq, res *DumpSessionRes) error
- func (c *Comet) Publish(ctx context.Context, req *PublishReq, res *PublishRes) error
- func (c *Comet) Subscribe(ctx context.Context, stream Comet_SubscribeStream) error
- type CometHandler
- type CometService
- type Comet_SubscribeService
- type Comet_SubscribeStream
- type Downlink
- func (*Downlink) Descriptor() ([]byte, []int)
- func (m *Downlink) GetHb() *Heartbeat
- func (m *Downlink) GetPush() *ServerPush
- func (m *Downlink) GetType() Packet
- func (*Downlink) ProtoMessage()
- func (m *Downlink) Reset()
- func (m *Downlink) String() string
- func (m *Downlink) XXX_DiscardUnknown()
- func (m *Downlink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Downlink) XXX_Merge(src proto.Message)
- func (m *Downlink) XXX_Size() int
- func (m *Downlink) XXX_Unmarshal(b []byte) error
- type DumpSessionReq
- func (*DumpSessionReq) Descriptor() ([]byte, []int)
- func (*DumpSessionReq) ProtoMessage()
- func (m *DumpSessionReq) Reset()
- func (m *DumpSessionReq) String() string
- func (m *DumpSessionReq) XXX_DiscardUnknown()
- func (m *DumpSessionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DumpSessionReq) XXX_Merge(src proto.Message)
- func (m *DumpSessionReq) XXX_Size() int
- func (m *DumpSessionReq) XXX_Unmarshal(b []byte) error
- type DumpSessionRes
- func (*DumpSessionRes) Descriptor() ([]byte, []int)
- func (m *DumpSessionRes) GetRooms() []*Room
- func (m *DumpSessionRes) GetWorld() []*Session
- func (*DumpSessionRes) ProtoMessage()
- func (m *DumpSessionRes) Reset()
- func (m *DumpSessionRes) String() string
- func (m *DumpSessionRes) XXX_DiscardUnknown()
- func (m *DumpSessionRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *DumpSessionRes) XXX_Merge(src proto.Message)
- func (m *DumpSessionRes) XXX_Size() int
- func (m *DumpSessionRes) XXX_Unmarshal(b []byte) error
- type Heartbeat
- func (*Heartbeat) Descriptor() ([]byte, []int)
- func (*Heartbeat) ProtoMessage()
- func (m *Heartbeat) Reset()
- func (m *Heartbeat) String() string
- func (m *Heartbeat) XXX_DiscardUnknown()
- func (m *Heartbeat) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Heartbeat) XXX_Merge(src proto.Message)
- func (m *Heartbeat) XXX_Size() int
- func (m *Heartbeat) XXX_Unmarshal(b []byte) error
- type JoinRoom
- func (*JoinRoom) Descriptor() ([]byte, []int)
- func (m *JoinRoom) GetRid() string
- func (*JoinRoom) ProtoMessage()
- func (m *JoinRoom) Reset()
- func (m *JoinRoom) String() string
- func (m *JoinRoom) XXX_DiscardUnknown()
- func (m *JoinRoom) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *JoinRoom) XXX_Merge(src proto.Message)
- func (m *JoinRoom) XXX_Size() int
- func (m *JoinRoom) XXX_Unmarshal(b []byte) error
- type Packet
- type PublishReq
- func (*PublishReq) Descriptor() ([]byte, []int)
- func (m *PublishReq) GetEvt() string
- func (m *PublishReq) GetUid() string
- func (*PublishReq) ProtoMessage()
- func (m *PublishReq) Reset()
- func (m *PublishReq) String() string
- func (m *PublishReq) XXX_DiscardUnknown()
- func (m *PublishReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PublishReq) XXX_Merge(src proto.Message)
- func (m *PublishReq) XXX_Size() int
- func (m *PublishReq) XXX_Unmarshal(b []byte) error
- type PublishRes
- func (*PublishRes) Descriptor() ([]byte, []int)
- func (*PublishRes) ProtoMessage()
- func (m *PublishRes) Reset()
- func (m *PublishRes) String() string
- func (m *PublishRes) XXX_DiscardUnknown()
- func (m *PublishRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *PublishRes) XXX_Merge(src proto.Message)
- func (m *PublishRes) XXX_Size() int
- func (m *PublishRes) XXX_Unmarshal(b []byte) error
- type Room
- func (*Room) Descriptor() ([]byte, []int)
- func (m *Room) GetRid() string
- func (m *Room) GetRoom() []*Session
- func (*Room) ProtoMessage()
- func (m *Room) Reset()
- func (m *Room) String() string
- func (m *Room) XXX_DiscardUnknown()
- func (m *Room) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Room) XXX_Merge(src proto.Message)
- func (m *Room) XXX_Size() int
- func (m *Room) XXX_Unmarshal(b []byte) error
- type Server
- type ServerPush
- func (*ServerPush) Descriptor() ([]byte, []int)
- func (m *ServerPush) GetEvt() string
- func (*ServerPush) ProtoMessage()
- func (m *ServerPush) Reset()
- func (m *ServerPush) String() string
- func (m *ServerPush) XXX_DiscardUnknown()
- func (m *ServerPush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *ServerPush) XXX_Merge(src proto.Message)
- func (m *ServerPush) XXX_Size() int
- func (m *ServerPush) XXX_Unmarshal(b []byte) error
- type Session
- func (*Session) Descriptor() ([]byte, []int)
- func (m *Session) GetBirth() string
- func (m *Session) GetRid() string
- func (m *Session) GetUid() string
- func (*Session) ProtoMessage()
- func (m *Session) Reset()
- func (m *Session) String() string
- func (m *Session) XXX_DiscardUnknown()
- func (m *Session) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Session) XXX_Merge(src proto.Message)
- func (m *Session) XXX_Size() int
- func (m *Session) XXX_Unmarshal(b []byte) error
- type Uplink
- func (*Uplink) Descriptor() ([]byte, []int)
- func (m *Uplink) GetAuth() *Auth
- func (m *Uplink) GetHb() *Heartbeat
- func (m *Uplink) GetJoin() *JoinRoom
- func (m *Uplink) GetType() Packet
- func (*Uplink) ProtoMessage()
- func (m *Uplink) Reset()
- func (m *Uplink) String() string
- func (m *Uplink) XXX_DiscardUnknown()
- func (m *Uplink) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
- func (m *Uplink) XXX_Merge(src proto.Message)
- func (m *Uplink) XXX_Size() int
- func (m *Uplink) XXX_Unmarshal(b []byte) error
Constants ¶
View Source
const (
ServiceName = "comet"
)
Variables ¶
View Source
var Packet_name = map[int32]string{
0: "HB",
1: "AUTH",
2: "JOIN",
3: "PUSH",
}
View Source
var Packet_value = map[string]int32{
"HB": 0,
"AUTH": 1,
"JOIN": 2,
"PUSH": 3,
}
Functions ¶
func NewCometEndpoints ¶
func RegisterCometHandler ¶
func RegisterCometHandler(s server.Server, hdlr CometHandler, opts ...server.HandlerOption) error
Types ¶
type Auth ¶
type Auth struct {
// Usually a JWT is used. Comet.Subscribe extracts user's account information from this token.
Token string `protobuf:"bytes,1,opt,name=token,proto3" json:"token,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Auth) Descriptor ¶
func (*Auth) ProtoMessage ¶
func (*Auth) ProtoMessage()
func (*Auth) XXX_DiscardUnknown ¶
func (m *Auth) XXX_DiscardUnknown()
func (*Auth) XXX_Unmarshal ¶
type BroadcastReq ¶
type BroadcastReq struct {
// The room identity, default (empty) to do a world broadcast, which means all the clients on
// this comet instance are published with the event. Otherwise, the broadcast is delivered to
// the clients within the room.
Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid,omitempty"`
// The server-sent event goes through the downlink to the client.
// Its content is opaque, which means what is published here reaches client unmodified.
// Only the concrete business can explain this event.
Evt string `protobuf:"bytes,2,opt,name=evt,proto3" json:"evt,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*BroadcastReq) Descriptor ¶
func (*BroadcastReq) Descriptor() ([]byte, []int)
func (*BroadcastReq) GetEvt ¶
func (m *BroadcastReq) GetEvt() string
func (*BroadcastReq) GetRid ¶
func (m *BroadcastReq) GetRid() string
func (*BroadcastReq) ProtoMessage ¶
func (*BroadcastReq) ProtoMessage()
func (*BroadcastReq) Reset ¶
func (m *BroadcastReq) Reset()
func (*BroadcastReq) String ¶
func (m *BroadcastReq) String() string
func (*BroadcastReq) XXX_DiscardUnknown ¶
func (m *BroadcastReq) XXX_DiscardUnknown()
func (*BroadcastReq) XXX_Marshal ¶
func (m *BroadcastReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BroadcastReq) XXX_Merge ¶
func (m *BroadcastReq) XXX_Merge(src proto.Message)
func (*BroadcastReq) XXX_Size ¶
func (m *BroadcastReq) XXX_Size() int
func (*BroadcastReq) XXX_Unmarshal ¶
func (m *BroadcastReq) XXX_Unmarshal(b []byte) error
type BroadcastRes ¶
type BroadcastRes struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*BroadcastRes) Descriptor ¶
func (*BroadcastRes) Descriptor() ([]byte, []int)
func (*BroadcastRes) ProtoMessage ¶
func (*BroadcastRes) ProtoMessage()
func (*BroadcastRes) Reset ¶
func (m *BroadcastRes) Reset()
func (*BroadcastRes) String ¶
func (m *BroadcastRes) String() string
func (*BroadcastRes) XXX_DiscardUnknown ¶
func (m *BroadcastRes) XXX_DiscardUnknown()
func (*BroadcastRes) XXX_Marshal ¶
func (m *BroadcastRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*BroadcastRes) XXX_Merge ¶
func (m *BroadcastRes) XXX_Merge(src proto.Message)
func (*BroadcastRes) XXX_Size ¶
func (m *BroadcastRes) XXX_Size() int
func (*BroadcastRes) XXX_Unmarshal ¶
func (m *BroadcastRes) XXX_Unmarshal(b []byte) error
type Comet ¶
type Comet struct {
// contains filtered or unexported fields
}
func (*Comet) Broadcast ¶
func (c *Comet) Broadcast(ctx context.Context, req *BroadcastReq, res *BroadcastRes) error
func (*Comet) DumpSession ¶
func (c *Comet) DumpSession(ctx context.Context, req *DumpSessionReq, res *DumpSessionRes) error
func (*Comet) Publish ¶
func (c *Comet) Publish(ctx context.Context, req *PublishReq, res *PublishRes) error
type CometHandler ¶
type CometHandler interface {
// Subscribe for downlink messages while also sending uplink messages.
Subscribe(context.Context, Comet_SubscribeStream) error
// Publish an event to a specific client who is landing on this comet instance.
// Publish or Broadcast is not reliable innately! The event may not reach the client in
// case of comet restarts or broken connection. So it is not necessary to retry automatically.
// Usually you should design a SYNC protocol between client and server to achieve the
// reliable broadcasting.
Publish(context.Context, *PublishReq, *PublishRes) error
// Broadcast an event to all the clients in a specific room on this comet instance.
Broadcast(context.Context, *BroadcastReq, *BroadcastRes) error
// Dump all the clients' session on this comet instance. It is a debugging method.
DumpSession(context.Context, *DumpSessionReq, *DumpSessionRes) error
}
type CometService ¶
type CometService interface {
// Subscribe for downlink messages while also sending uplink messages.
Subscribe(ctx context.Context, opts ...client.CallOption) (Comet_SubscribeService, error)
// Publish an event to a specific client who is landing on this comet instance.
// Publish or Broadcast is not reliable innately! The event may not reach the client in
// case of comet restarts or broken connection. So it is not necessary to retry automatically.
// Usually you should design a SYNC protocol between client and server to achieve the
// reliable broadcasting.
Publish(ctx context.Context, in *PublishReq, opts ...client.CallOption) (*PublishRes, error)
// Broadcast an event to all the clients in a specific room on this comet instance.
Broadcast(ctx context.Context, in *BroadcastReq, opts ...client.CallOption) (*BroadcastRes, error)
// Dump all the clients' session on this comet instance. It is a debugging method.
DumpSession(ctx context.Context, in *DumpSessionReq, opts ...client.CallOption) (*DumpSessionRes, error)
}
func NewCometService ¶
func NewCometService(name string, c client.Client) CometService
type Comet_SubscribeService ¶
type Comet_SubscribeStream ¶
type Downlink ¶
type Downlink struct {
// type is used to differentiate what this downlink message is
Type Packet `protobuf:"varint,1,opt,name=type,proto3,enum=comet.Packet" json:"type,omitempty"`
Hb *Heartbeat `protobuf:"bytes,2,opt,name=hb,proto3" json:"hb,omitempty"`
Push *ServerPush `protobuf:"bytes,3,opt,name=push,proto3" json:"push,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Downlink) Descriptor ¶
func (*Downlink) GetPush ¶
func (m *Downlink) GetPush() *ServerPush
func (*Downlink) ProtoMessage ¶
func (*Downlink) ProtoMessage()
func (*Downlink) XXX_DiscardUnknown ¶
func (m *Downlink) XXX_DiscardUnknown()
func (*Downlink) XXX_Marshal ¶
func (*Downlink) XXX_Unmarshal ¶
type DumpSessionReq ¶
type DumpSessionReq struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*DumpSessionReq) Descriptor ¶
func (*DumpSessionReq) Descriptor() ([]byte, []int)
func (*DumpSessionReq) ProtoMessage ¶
func (*DumpSessionReq) ProtoMessage()
func (*DumpSessionReq) Reset ¶
func (m *DumpSessionReq) Reset()
func (*DumpSessionReq) String ¶
func (m *DumpSessionReq) String() string
func (*DumpSessionReq) XXX_DiscardUnknown ¶
func (m *DumpSessionReq) XXX_DiscardUnknown()
func (*DumpSessionReq) XXX_Marshal ¶
func (m *DumpSessionReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DumpSessionReq) XXX_Merge ¶
func (m *DumpSessionReq) XXX_Merge(src proto.Message)
func (*DumpSessionReq) XXX_Size ¶
func (m *DumpSessionReq) XXX_Size() int
func (*DumpSessionReq) XXX_Unmarshal ¶
func (m *DumpSessionReq) XXX_Unmarshal(b []byte) error
type DumpSessionRes ¶
type DumpSessionRes struct {
// All the sessions in the world in this comet instance
World []*Session `protobuf:"bytes,1,rep,name=world,proto3" json:"world,omitempty"`
// All the rooms in this comet instance
Rooms []*Room `protobuf:"bytes,2,rep,name=rooms,proto3" json:"rooms,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*DumpSessionRes) Descriptor ¶
func (*DumpSessionRes) Descriptor() ([]byte, []int)
func (*DumpSessionRes) GetRooms ¶
func (m *DumpSessionRes) GetRooms() []*Room
func (*DumpSessionRes) GetWorld ¶
func (m *DumpSessionRes) GetWorld() []*Session
func (*DumpSessionRes) ProtoMessage ¶
func (*DumpSessionRes) ProtoMessage()
func (*DumpSessionRes) Reset ¶
func (m *DumpSessionRes) Reset()
func (*DumpSessionRes) String ¶
func (m *DumpSessionRes) String() string
func (*DumpSessionRes) XXX_DiscardUnknown ¶
func (m *DumpSessionRes) XXX_DiscardUnknown()
func (*DumpSessionRes) XXX_Marshal ¶
func (m *DumpSessionRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*DumpSessionRes) XXX_Merge ¶
func (m *DumpSessionRes) XXX_Merge(src proto.Message)
func (*DumpSessionRes) XXX_Size ¶
func (m *DumpSessionRes) XXX_Size() int
func (*DumpSessionRes) XXX_Unmarshal ¶
func (m *DumpSessionRes) XXX_Unmarshal(b []byte) error
type Heartbeat ¶
type Heartbeat struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Heartbeat) Descriptor ¶
func (*Heartbeat) ProtoMessage ¶
func (*Heartbeat) ProtoMessage()
func (*Heartbeat) XXX_DiscardUnknown ¶
func (m *Heartbeat) XXX_DiscardUnknown()
func (*Heartbeat) XXX_Marshal ¶
func (*Heartbeat) XXX_Unmarshal ¶
type JoinRoom ¶
type JoinRoom struct {
// The room identity, default (empty) to quit any room and stay only in the world.
Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*JoinRoom) Descriptor ¶
func (*JoinRoom) ProtoMessage ¶
func (*JoinRoom) ProtoMessage()
func (*JoinRoom) XXX_DiscardUnknown ¶
func (m *JoinRoom) XXX_DiscardUnknown()
func (*JoinRoom) XXX_Marshal ¶
func (*JoinRoom) XXX_Unmarshal ¶
type Packet ¶
type Packet int32
The type of packet that is transferring on the wire of uplink and downlink
const ( // Heartbeat is sent on downlink and uplink, to keep the persistent connection alive Packet_HB Packet = 0 // Auth is sent on uplink as the first message for Comet.Subscribe Packet_AUTH Packet = 1 // JoinRoom is sent on uplink to join the specified room. JOIN can be sent together with AUTH, // which means connect to comet and join the specified room immediately. A client follows // only one room at a time. If a client is already in a room, JOIN a different room implies // quitting the last room where the client stays; JOIN the same room is a no-op. A connected // client is always considered in the world in spite of maybe in a room. Packet_JOIN Packet = 2 // ServerPush is sent on downlink to push event to client Packet_PUSH Packet = 3 )
func (Packet) EnumDescriptor ¶
type PublishReq ¶
type PublishReq struct {
// The unique user identity.
// Please note if an end-user has multiple terminals such as a phone, a pad, and a desktop,
// every terminal should use a unique identity if these devices are treated differently.
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
// The server-sent event goes through the downlink to the client.
// Its content is opaque, which means what is published here reaches client unmodified.
// Only the concrete business can explain this event.
Evt string `protobuf:"bytes,2,opt,name=evt,proto3" json:"evt,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PublishReq) Descriptor ¶
func (*PublishReq) Descriptor() ([]byte, []int)
func (*PublishReq) GetEvt ¶
func (m *PublishReq) GetEvt() string
func (*PublishReq) GetUid ¶
func (m *PublishReq) GetUid() string
func (*PublishReq) ProtoMessage ¶
func (*PublishReq) ProtoMessage()
func (*PublishReq) Reset ¶
func (m *PublishReq) Reset()
func (*PublishReq) String ¶
func (m *PublishReq) String() string
func (*PublishReq) XXX_DiscardUnknown ¶
func (m *PublishReq) XXX_DiscardUnknown()
func (*PublishReq) XXX_Marshal ¶
func (m *PublishReq) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PublishReq) XXX_Merge ¶
func (m *PublishReq) XXX_Merge(src proto.Message)
func (*PublishReq) XXX_Size ¶
func (m *PublishReq) XXX_Size() int
func (*PublishReq) XXX_Unmarshal ¶
func (m *PublishReq) XXX_Unmarshal(b []byte) error
type PublishRes ¶
type PublishRes struct {
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*PublishRes) Descriptor ¶
func (*PublishRes) Descriptor() ([]byte, []int)
func (*PublishRes) ProtoMessage ¶
func (*PublishRes) ProtoMessage()
func (*PublishRes) Reset ¶
func (m *PublishRes) Reset()
func (*PublishRes) String ¶
func (m *PublishRes) String() string
func (*PublishRes) XXX_DiscardUnknown ¶
func (m *PublishRes) XXX_DiscardUnknown()
func (*PublishRes) XXX_Marshal ¶
func (m *PublishRes) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*PublishRes) XXX_Merge ¶
func (m *PublishRes) XXX_Merge(src proto.Message)
func (*PublishRes) XXX_Size ¶
func (m *PublishRes) XXX_Size() int
func (*PublishRes) XXX_Unmarshal ¶
func (m *PublishRes) XXX_Unmarshal(b []byte) error
type Room ¶
type Room struct {
// The room identity
Rid string `protobuf:"bytes,1,opt,name=rid,proto3" json:"rid,omitempty"`
// All the sessions in this room.
Room []*Session `protobuf:"bytes,2,rep,name=room,proto3" json:"room,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Room is a (virtual) place where session gathers.
func (*Room) Descriptor ¶
func (*Room) ProtoMessage ¶
func (*Room) ProtoMessage()
func (*Room) XXX_DiscardUnknown ¶
func (m *Room) XXX_DiscardUnknown()
func (*Room) XXX_Unmarshal ¶
type Server ¶
type ServerPush ¶
type ServerPush struct {
// The server-sent event goes through the downlink to the client.
// Its content is opaque, which means what is published reaches client unmodified.
// Only the concrete business can explain this event.
Evt string `protobuf:"bytes,1,opt,name=evt,proto3" json:"evt,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*ServerPush) Descriptor ¶
func (*ServerPush) Descriptor() ([]byte, []int)
func (*ServerPush) GetEvt ¶
func (m *ServerPush) GetEvt() string
func (*ServerPush) ProtoMessage ¶
func (*ServerPush) ProtoMessage()
func (*ServerPush) Reset ¶
func (m *ServerPush) Reset()
func (*ServerPush) String ¶
func (m *ServerPush) String() string
func (*ServerPush) XXX_DiscardUnknown ¶
func (m *ServerPush) XXX_DiscardUnknown()
func (*ServerPush) XXX_Marshal ¶
func (m *ServerPush) XXX_Marshal(b []byte, deterministic bool) ([]byte, error)
func (*ServerPush) XXX_Merge ¶
func (m *ServerPush) XXX_Merge(src proto.Message)
func (*ServerPush) XXX_Size ¶
func (m *ServerPush) XXX_Size() int
func (*ServerPush) XXX_Unmarshal ¶
func (m *ServerPush) XXX_Unmarshal(b []byte) error
type Session ¶
type Session struct {
// The unique user identity
Uid string `protobuf:"bytes,1,opt,name=uid,proto3" json:"uid,omitempty"`
// The room identity
Rid string `protobuf:"bytes,2,opt,name=rid,proto3" json:"rid,omitempty"`
// When is the session created
Birth string `protobuf:"bytes,3,opt,name=birth,proto3" json:"birth,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
Session is a user's session. It is created when a client subscribes to this comet, and destroyed when the client disconnected.
func (*Session) Descriptor ¶
func (*Session) ProtoMessage ¶
func (*Session) ProtoMessage()
func (*Session) XXX_DiscardUnknown ¶
func (m *Session) XXX_DiscardUnknown()
func (*Session) XXX_Marshal ¶
func (*Session) XXX_Unmarshal ¶
type Uplink ¶
type Uplink struct {
// type is used to differentiate what this uplink message is
Type Packet `protobuf:"varint,1,opt,name=type,proto3,enum=comet.Packet" json:"type,omitempty"`
Hb *Heartbeat `protobuf:"bytes,2,opt,name=hb,proto3" json:"hb,omitempty"`
Auth *Auth `protobuf:"bytes,3,opt,name=auth,proto3" json:"auth,omitempty"`
Join *JoinRoom `protobuf:"bytes,4,opt,name=join,proto3" json:"join,omitempty"`
XXX_NoUnkeyedLiteral struct{} `json:"-"`
XXX_unrecognized []byte `json:"-"`
XXX_sizecache int32 `json:"-"`
}
func (*Uplink) Descriptor ¶
func (*Uplink) ProtoMessage ¶
func (*Uplink) ProtoMessage()
func (*Uplink) XXX_DiscardUnknown ¶
func (m *Uplink) XXX_DiscardUnknown()
func (*Uplink) XXX_Marshal ¶
func (*Uplink) XXX_Unmarshal ¶
Click to show internal directories.
Click to hide internal directories.