presence

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Jan 13, 2021 License: Apache-2.0 Imports: 15 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

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

Deprecated: Use Empty.ProtoReflect.Descriptor instead.

func (*Empty) ProtoMessage

func (*Empty) ProtoMessage()

func (*Empty) ProtoReflect

func (x *Empty) ProtoReflect() protoreflect.Message

func (*Empty) Reset

func (x *Empty) Reset()

func (*Empty) String

func (x *Empty) String() string

type Entity

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

func (*Entity) Connect

func (p *Entity) Connect(ctx *crdt.CommandContext, user *User) (*any.Any, error)

func (*Entity) Default

func (p *Entity) Default(ctx *crdt.Context) (crdt.CRDT, error)

func (*Entity) HandleCommand

func (p *Entity) HandleCommand(ctx *crdt.CommandContext, name string, msg proto.Message) (*any.Any, error)

func (*Entity) Monitor

func (p *Entity) Monitor(ctx *crdt.CommandContext, user *User) (*any.Any, error)

func (*Entity) Set

func (p *Entity) Set(ctx *crdt.Context, state crdt.CRDT) error

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) Monitor

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

Deprecated: Use User.ProtoReflect.Descriptor instead.

func (*User) GetName

func (x *User) GetName() string

func (*User) ProtoMessage

func (*User) ProtoMessage()

func (*User) ProtoReflect

func (x *User) ProtoReflect() protoreflect.Message

func (*User) Reset

func (x *User) Reset()

func (*User) String

func (x *User) String() string

Jump to

Keyboard shortcuts

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