Documentation ¶
Index ¶
- Variables
- func RegisterPresenceServer(s grpc.ServiceRegistrar, srv PresenceServer)
- type Empty
- type Entity
- func (p *Entity) Connect(ctx *crdt.CommandContext, user *User) (*any.Any, error)
- func (p *Entity) Default(ctx *crdt.Context) (crdt.CRDT, error)
- func (p *Entity) HandleCommand(ctx *crdt.CommandContext, name string, msg proto.Message) (*any.Any, error)
- func (p *Entity) Monitor(ctx *crdt.CommandContext, user *User) (*any.Any, error)
- func (p *Entity) Set(ctx *crdt.Context, state crdt.CRDT) error
- type OnlineStatus
- type PresenceClient
- type PresenceServer
- type Presence_ConnectClient
- type Presence_ConnectServer
- type Presence_MonitorClient
- type Presence_MonitorServer
- type UnimplementedPresenceServer
- type UnsafePresenceServer
- type User
Constants ¶
This section is empty.
Variables ¶
var File_presence_proto protoreflect.FileDescriptor
Functions ¶
func RegisterPresenceServer ¶
func RegisterPresenceServer(s grpc.ServiceRegistrar, srv PresenceServer)
Types ¶
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) Descriptor
deprecated
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Entity ¶
type Entity struct {
// contains filtered or unexported fields
}
func (*Entity) HandleCommand ¶
type OnlineStatus ¶
type OnlineStatus struct { Online bool `protobuf:"varint,1,opt,name=online,proto3" json:"online,omitempty"` // contains filtered or unexported fields }
func (*OnlineStatus) Descriptor
deprecated
func (*OnlineStatus) Descriptor() ([]byte, []int)
Deprecated: Use OnlineStatus.ProtoReflect.Descriptor instead.
func (*OnlineStatus) GetOnline ¶
func (x *OnlineStatus) GetOnline() bool
func (*OnlineStatus) ProtoMessage ¶
func (*OnlineStatus) ProtoMessage()
func (*OnlineStatus) ProtoReflect ¶
func (x *OnlineStatus) ProtoReflect() protoreflect.Message
func (*OnlineStatus) Reset ¶
func (x *OnlineStatus) Reset()
func (*OnlineStatus) String ¶
func (x *OnlineStatus) String() string
type PresenceClient ¶
type PresenceClient interface { // Connect the given user. They will stay connected as long as the stream stays open. Connect(ctx context.Context, in *User, opts ...grpc.CallOption) (Presence_ConnectClient, error) // Monitor the online status of the given user. Monitor(ctx context.Context, in *User, opts ...grpc.CallOption) (Presence_MonitorClient, error) }
PresenceClient is the client API for Presence service.
For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.
func NewPresenceClient ¶
func NewPresenceClient(cc grpc.ClientConnInterface) PresenceClient
type PresenceServer ¶
type PresenceServer interface { // Connect the given user. They will stay connected as long as the stream stays open. Connect(*User, Presence_ConnectServer) error // Monitor the online status of the given user. Monitor(*User, Presence_MonitorServer) error // contains filtered or unexported methods }
PresenceServer is the server API for Presence service. All implementations must embed UnimplementedPresenceServer for forward compatibility
type Presence_ConnectClient ¶
type Presence_ConnectClient interface { Recv() (*Empty, error) grpc.ClientStream }
type Presence_ConnectServer ¶
type Presence_ConnectServer interface { Send(*Empty) error grpc.ServerStream }
type Presence_MonitorClient ¶
type Presence_MonitorClient interface { Recv() (*OnlineStatus, error) grpc.ClientStream }
type Presence_MonitorServer ¶
type Presence_MonitorServer interface { Send(*OnlineStatus) error grpc.ServerStream }
type UnimplementedPresenceServer ¶
type UnimplementedPresenceServer struct { }
UnimplementedPresenceServer must be embedded to have forward compatible implementations.
func (UnimplementedPresenceServer) Connect ¶
func (UnimplementedPresenceServer) Connect(*User, Presence_ConnectServer) error
func (UnimplementedPresenceServer) Monitor ¶
func (UnimplementedPresenceServer) Monitor(*User, Presence_MonitorServer) error
type UnsafePresenceServer ¶ added in v0.3.0
type UnsafePresenceServer interface {
// contains filtered or unexported methods
}
UnsafePresenceServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PresenceServer will result in compilation errors.
type User ¶
type User struct { Name string `protobuf:"bytes,1,opt,name=name,proto3" json:"name,omitempty"` // contains filtered or unexported fields }
func (*User) Descriptor
deprecated
func (*User) ProtoMessage ¶
func (*User) ProtoMessage()
func (*User) ProtoReflect ¶
func (x *User) ProtoReflect() protoreflect.Message