comet

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: 21 Imported by: 0

README

comet

订阅和广播通道

Note: This is an unreliable channel. Consider it as a simplified solution like NATS 2.3 and you may also choose nats.ws for an end to end solution. The applicable scenario is something like "bullet-screen comments".

comet is a special service. It has a streaming endpoint Subscribe. A client (usually a web browser such as Google Chrome) subscribes to the server by setting up a WebSocket connection to this streaming endpoint.

Once something happens in the server, a notification event is pushed to the client. The event should not be considered reliable. It is at most once.

The comet API is designed to be simple enough. The rules to keep the persistent connection active under unpredictable mobile networks:

  • On receiving heartbeat-probe, send a heartbeat-keepalive
  • On receiving nothing for a long time, re-connect
  • On error, re-connect with reasonable backoff

Overview

ENDPOINT (WebSocket) /comet/subscribe

REQUEST (first-message)

    {
        "type":"AUTH",
        "auth": { "token": "" },
        "join": { "rid": "" }
    }

REQUEST (heartbeat-keepalive)

    { "type":"HB" }

REQUEST (join-room)

    { "type":"JOIN", "join": { "rid": "" } }

RESPONSE (heartbeat-probe)

    { "type":"HB" }

RESPONSE (server-pushed-event)

    { "type":"PUSH", "push": { "evt": "" } }

Details

See comet.md

Documentation

Index

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 NewCometEndpoints() []*api.Endpoint

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

func (*Auth) GetToken

func (m *Auth) GetToken() string

func (*Auth) ProtoMessage

func (*Auth) ProtoMessage()

func (*Auth) Reset

func (m *Auth) Reset()

func (*Auth) String

func (m *Auth) String() string

func (*Auth) XXX_DiscardUnknown

func (m *Auth) XXX_DiscardUnknown()

func (*Auth) XXX_Marshal

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

func (*Auth) XXX_Merge

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

func (*Auth) XXX_Size

func (m *Auth) XXX_Size() int

func (*Auth) XXX_Unmarshal

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

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 NewComet

func NewComet(namespace string, cli client.Client) *Comet

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

func (*Comet) Subscribe

func (c *Comet) Subscribe(ctx context.Context, stream Comet_SubscribeStream) 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_SubscribeService interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*Uplink) error
	Recv() (*Downlink, error)
}

type Comet_SubscribeStream

type Comet_SubscribeStream interface {
	Context() context.Context
	SendMsg(interface{}) error
	RecvMsg(interface{}) error
	Close() error
	Send(*Downlink) error
	Recv() (*Uplink, error)
}
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) Descriptor() ([]byte, []int)

func (*Downlink) GetHb

func (m *Downlink) GetHb() *Heartbeat

func (*Downlink) GetPush

func (m *Downlink) GetPush() *ServerPush

func (*Downlink) GetType

func (m *Downlink) GetType() Packet

func (*Downlink) ProtoMessage

func (*Downlink) ProtoMessage()

func (*Downlink) Reset

func (m *Downlink) Reset()

func (*Downlink) String

func (m *Downlink) String() string

func (*Downlink) XXX_DiscardUnknown

func (m *Downlink) XXX_DiscardUnknown()

func (*Downlink) XXX_Marshal

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

func (*Downlink) XXX_Merge

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

func (*Downlink) XXX_Size

func (m *Downlink) XXX_Size() int

func (*Downlink) XXX_Unmarshal

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

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

func (*Heartbeat) ProtoMessage

func (*Heartbeat) ProtoMessage()

func (*Heartbeat) Reset

func (m *Heartbeat) Reset()

func (*Heartbeat) String

func (m *Heartbeat) String() string

func (*Heartbeat) XXX_DiscardUnknown

func (m *Heartbeat) XXX_DiscardUnknown()

func (*Heartbeat) XXX_Marshal

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

func (*Heartbeat) XXX_Merge

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

func (*Heartbeat) XXX_Size

func (m *Heartbeat) XXX_Size() int

func (*Heartbeat) XXX_Unmarshal

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

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

func (*JoinRoom) GetRid

func (m *JoinRoom) GetRid() string

func (*JoinRoom) ProtoMessage

func (*JoinRoom) ProtoMessage()

func (*JoinRoom) Reset

func (m *JoinRoom) Reset()

func (*JoinRoom) String

func (m *JoinRoom) String() string

func (*JoinRoom) XXX_DiscardUnknown

func (m *JoinRoom) XXX_DiscardUnknown()

func (*JoinRoom) XXX_Marshal

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

func (*JoinRoom) XXX_Merge

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

func (*JoinRoom) XXX_Size

func (m *JoinRoom) XXX_Size() int

func (*JoinRoom) XXX_Unmarshal

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

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

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

func (Packet) String

func (x Packet) String() string

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

func (*Room) GetRid

func (m *Room) GetRid() string

func (*Room) GetRoom

func (m *Room) GetRoom() []*Session

func (*Room) ProtoMessage

func (*Room) ProtoMessage()

func (*Room) Reset

func (m *Room) Reset()

func (*Room) String

func (m *Room) String() string

func (*Room) XXX_DiscardUnknown

func (m *Room) XXX_DiscardUnknown()

func (*Room) XXX_Marshal

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

func (*Room) XXX_Merge

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

func (*Room) XXX_Size

func (m *Room) XXX_Size() int

func (*Room) XXX_Unmarshal

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

type Server

type Server struct {
	Namespace      string   `json:"namespace"`
	Production     bool     `json:"production"`
	LogOutputPaths []string `json:"logging_output_paths"`
}

func NewServer

func NewServer() *Server

func (*Server) Name

func (s *Server) Name() string

func (*Server) Run

func (s *Server) Run()

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

func (*Session) GetBirth

func (m *Session) GetBirth() string

func (*Session) GetRid

func (m *Session) GetRid() string

func (*Session) GetUid

func (m *Session) GetUid() string

func (*Session) ProtoMessage

func (*Session) ProtoMessage()

func (*Session) Reset

func (m *Session) Reset()

func (*Session) String

func (m *Session) String() string

func (*Session) XXX_DiscardUnknown

func (m *Session) XXX_DiscardUnknown()

func (*Session) XXX_Marshal

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

func (*Session) XXX_Merge

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

func (*Session) XXX_Size

func (m *Session) XXX_Size() int

func (*Session) XXX_Unmarshal

func (m *Session) XXX_Unmarshal(b []byte) error
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) Descriptor() ([]byte, []int)

func (*Uplink) GetAuth

func (m *Uplink) GetAuth() *Auth

func (*Uplink) GetHb

func (m *Uplink) GetHb() *Heartbeat

func (*Uplink) GetJoin

func (m *Uplink) GetJoin() *JoinRoom

func (*Uplink) GetType

func (m *Uplink) GetType() Packet

func (*Uplink) ProtoMessage

func (*Uplink) ProtoMessage()

func (*Uplink) Reset

func (m *Uplink) Reset()

func (*Uplink) String

func (m *Uplink) String() string

func (*Uplink) XXX_DiscardUnknown

func (m *Uplink) XXX_DiscardUnknown()

func (*Uplink) XXX_Marshal

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

func (*Uplink) XXX_Merge

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

func (*Uplink) XXX_Size

func (m *Uplink) XXX_Size() int

func (*Uplink) XXX_Unmarshal

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

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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