Documentation
¶
Index ¶
- Constants
- Variables
- func EchoStatsAt(node string) pubsub.Topic[*Pong]
- func HandleEchoCall(s EchoHandler, p *grpcproc.Process[proto.Message], ...) (proto.Message, error)
- func HandleEchoMessage(s EchoHandler, p *grpcproc.Process[proto.Message], ...) error
- func HandleRoomCall(s RoomHandler, p *grpcproc.Process[proto.Message], ...) (proto.Message, error)
- func HandleRoomMessage(s RoomHandler, p *grpcproc.Process[proto.Message], ...) error
- func HandleSinkCall(s SinkHandler, p *grpcproc.Process[proto.Message], ...) (proto.Message, error)
- func HandleSinkMessage(s SinkHandler, p *grpcproc.Process[proto.Message], ...) error
- func RoomEventsAt(node, id string) pubsub.Topic[*Note]
- func RoomEventsTopic(id string) string
- func RoomProcess(id string) string
- type Clear
- type Count
- type EchoAddr
- func (c EchoAddr) Clear(ctx context.Context, from grpcproc.Caller) error
- func (c EchoAddr) ClearAfter[M proto.Message](p *grpcproc.Process[M], d time.Duration) *grpcproc.Timer
- func (c EchoAddr) Count(ctx context.Context, from grpcproc.Caller) (*Pong, error)
- func (c EchoAddr) Note(ctx context.Context, from grpcproc.Caller, req *Note) error
- func (c EchoAddr) NoteAfter[M proto.Message](p *grpcproc.Process[M], d time.Duration, req *Note) *grpcproc.Timer
- func (c EchoAddr) Ping(ctx context.Context, from grpcproc.Caller, req *Ping) (*Pong, error)
- type EchoHandler
- type Kind
- type Note
- type Nothing
- type Ping
- type Pong
- type Room
- type RoomAddr
- type RoomHandler
- type Room_Addr
- type Room_Seat
- type Room_State
- type SinkAddr
- type SinkHandler
- type UnimplementedEchoHandler
- func (UnimplementedEchoHandler) Clear(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
- func (UnimplementedEchoHandler) Count(*grpcproc.Process[proto.Message], grpcproc.Msg[proto.Message]) (*Pong, error)
- func (UnimplementedEchoHandler) Note(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Note) error
- func (UnimplementedEchoHandler) Ping(*grpcproc.Process[proto.Message], grpcproc.Msg[proto.Message], *Ping) (*Pong, error)
- type UnimplementedRoomHandler
- type UnimplementedSinkHandler
Constants ¶
const EchoProcess = "echo"
EchoProcess is the name a process of the Echo service is registered under on its node.
const EchoStatsTopic = "echo-stats"
EchoStatsTopic is the name the Stats topic of the Echo service is registered under on its process's node.
Variables ¶
var ( Kind_name = map[int32]string{ 0: "KIND_UNSPECIFIED", } Kind_value = map[string]int32{ "KIND_UNSPECIFIED": 0, } )
Enum value maps for Kind.
var ( Room_State_name = map[int32]string{ 0: "STATE_UNSPECIFIED", } Room_State_value = map[string]int32{ "STATE_UNSPECIFIED": 0, } )
Enum value maps for Room_State.
var File_protocgen_testpb_gen_proto protoreflect.FileDescriptor
var File_protocgen_testpb_nosvc_proto protoreflect.FileDescriptor
Functions ¶
func EchoStatsAt ¶ added in v0.16.0
EchoStatsAt is the Stats topic of the Echo service on node, whose events are Pong.
Stats is the topic the echo publishes a Pong to for each ping.
func HandleEchoCall ¶
func HandleEchoCall(s EchoHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) (proto.Message, error)
HandleEchoCall answers a call to a process of the Echo service through s, for an actor.CallHandler's HandleCall; a call of another type is answered grpcproc.ErrType.
func HandleEchoMessage ¶
func HandleEchoMessage(s EchoHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
HandleEchoMessage takes a send to a process of the Echo service through s, for an actor.Handler's HandleMessage; a message of another type is logged and dropped, as actor.CallsOnly drops one. A message the process takes from elsewhere, a topic's events say, is declared as a send too.
func HandleRoomCall ¶
func HandleRoomCall(s RoomHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) (proto.Message, error)
HandleRoomCall answers a call to a process of the Room service through s, for an actor.CallHandler's HandleCall; a call of another type is answered grpcproc.ErrType.
func HandleRoomMessage ¶
func HandleRoomMessage(s RoomHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
HandleRoomMessage takes a send to a process of the Room service through s, for an actor.Handler's HandleMessage; a message of another type is logged and dropped, as actor.CallsOnly drops one. A message the process takes from elsewhere, a topic's events say, is declared as a send too.
func HandleSinkCall ¶ added in v0.16.0
func HandleSinkCall(s SinkHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) (proto.Message, error)
HandleSinkCall answers a call to a process of the Sink service through s, for an actor.CallHandler's HandleCall; a call of another type is answered grpcproc.ErrType.
func HandleSinkMessage ¶ added in v0.16.0
func HandleSinkMessage(s SinkHandler, p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
HandleSinkMessage takes a send to a process of the Sink service through s, for an actor.Handler's HandleMessage; a message of another type is logged and dropped, as actor.CallsOnly drops one. A message the process takes from elsewhere, a topic's events say, is declared as a send too.
func RoomEventsAt ¶ added in v0.16.0
RoomEventsAt is the Events topic of the Room service's process for id on node, whose events are Note.
func RoomEventsTopic ¶ added in v0.16.0
RoomEventsTopic is the name the Events topic of the Room service's process for id is registered under on its node.
func RoomProcess ¶ added in v0.16.0
RoomProcess is the name the process of the Room service for id is registered under on its node.
Types ¶
type Clear ¶ added in v0.16.0
type Clear struct {
// contains filtered or unexported fields
}
Clear forgets the notes: a send with no fields.
func (*Clear) Descriptor
deprecated
added in
v0.16.0
func (*Clear) ProtoMessage ¶ added in v0.16.0
func (*Clear) ProtoMessage()
func (*Clear) ProtoReflect ¶ added in v0.16.0
func (x *Clear) ProtoReflect() protoreflect.Message
type Count ¶ added in v0.16.0
type Count struct {
// contains filtered or unexported fields
}
Count asks how many notes were kept: a request with no fields.
func (*Count) Descriptor
deprecated
added in
v0.16.0
func (*Count) ProtoMessage ¶ added in v0.16.0
func (*Count) ProtoMessage()
func (*Count) ProtoReflect ¶ added in v0.16.0
func (x *Count) ProtoReflect() protoreflect.Message
type EchoAddr ¶
EchoAddr addresses a process of the Echo service; its methods are its rpcs.
Echo answers pings, and takes notes.
func EchoAddrOf ¶
EchoAddrOf addresses t, a PID, a Name or a global name, as a process of the Echo service.
func EchoGlobal ¶ added in v0.16.0
func EchoGlobal() EchoAddr
EchoGlobal addresses the process of the Echo service that holds the global name EchoProcess, wherever it runs.
func (EchoAddr) ClearAfter ¶ added in v0.16.0
func (c EchoAddr) ClearAfter[M proto.Message](p *grpcproc.Process[M], d time.Duration) *grpcproc.Timer
ClearAfter sends a Clear to the process after d, from p; the timer can stop it.
func (EchoAddr) Count ¶ added in v0.16.0
Count calls the process with a Count and waits for its Pong.
type EchoHandler ¶
type EchoHandler interface {
Ping(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Ping) (*Pong, error)
Count(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) (*Pong, error)
Note(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Note) error
Clear(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
}
EchoHandler is what a process of the Echo service does with what it is sent: a method per call, whose result is the reply, as actor.CallHandler's is, and one per send. HandleEchoCall and HandleEchoMessage dispatch to it; UnimplementedEchoHandler answers for the methods an implementation leaves out.
type Kind ¶ added in v0.16.0
type Kind int32
Kind is an enum of the file's own, whose Go name is taken too.
const (
Kind_KIND_UNSPECIFIED Kind = 0
)
func (Kind) Descriptor ¶ added in v0.16.0
func (Kind) Descriptor() protoreflect.EnumDescriptor
func (Kind) EnumDescriptor
deprecated
added in
v0.16.0
func (Kind) Number ¶ added in v0.16.0
func (x Kind) Number() protoreflect.EnumNumber
func (Kind) Type ¶ added in v0.16.0
func (Kind) Type() protoreflect.EnumType
type Note ¶
type Note struct {
Text string `protobuf:"bytes,1,opt,name=text,proto3" json:"text,omitempty"`
// contains filtered or unexported fields
}
func (*Note) Descriptor
deprecated
func (*Note) ProtoMessage ¶
func (*Note) ProtoMessage()
func (*Note) ProtoReflect ¶
func (x *Note) ProtoReflect() protoreflect.Message
type Nothing ¶
type Nothing struct {
// contains filtered or unexported fields
}
func (*Nothing) Descriptor
deprecated
func (*Nothing) ProtoMessage ¶
func (*Nothing) ProtoMessage()
func (*Nothing) ProtoReflect ¶
func (x *Nothing) ProtoReflect() protoreflect.Message
type Ping ¶
type Ping struct {
N int64 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"`
// contains filtered or unexported fields
}
func (*Ping) Descriptor
deprecated
func (*Ping) ProtoMessage ¶
func (*Ping) ProtoMessage()
func (*Ping) ProtoReflect ¶
func (x *Ping) ProtoReflect() protoreflect.Message
type Pong ¶
type Pong struct {
N int64 `protobuf:"varint,1,opt,name=n,proto3" json:"n,omitempty"`
// contains filtered or unexported fields
}
func (*Pong) Descriptor
deprecated
func (*Pong) ProtoMessage ¶
func (*Pong) ProtoMessage()
func (*Pong) ProtoReflect ¶
func (x *Pong) ProtoReflect() protoreflect.Message
type Room ¶ added in v0.16.0
type Room struct {
Id string `protobuf:"bytes,1,opt,name=id,proto3" json:"id,omitempty"`
// A oneof's wrappers are Go types of their own, Room_Addr here.
//
// Types that are valid to be assigned to Target:
//
// *Room_Addr
Target isRoom_Target `protobuf_oneof:"target"`
// contains filtered or unexported fields
}
func (*Room) Descriptor
deprecated
added in
v0.16.0
func (*Room) ProtoMessage ¶ added in v0.16.0
func (*Room) ProtoMessage()
func (*Room) ProtoReflect ¶ added in v0.16.0
func (x *Room) ProtoReflect() protoreflect.Message
type RoomAddr ¶
RoomAddr addresses a process of the Room service; its methods are its rpcs.
RoomProcess is a room, named per instance: "room:" + id. Its Go name is Room, which the message of that name keeps it from being in the proto.
func RoomAddrOf ¶
RoomAddrOf addresses t, a PID, a Name or a global name, as a process of the Room service.
func RoomAt ¶ added in v0.16.0
RoomAt addresses the process of the Room service for id on node, registered as RoomProcess(id).
func RoomGlobal ¶ added in v0.16.0
RoomGlobal addresses the process of the Room service that holds the global name RoomProcess(id), wherever it runs.
type RoomHandler ¶
type RoomHandler interface {
Bounce(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Ping) (*Pong, error)
}
RoomHandler is what a process of the Room service does with what it is sent: a method per call, whose result is the reply, as actor.CallHandler's is, and one per send. HandleRoomCall and HandleRoomMessage dispatch to it; UnimplementedRoomHandler answers for the methods an implementation leaves out.
type Room_Addr ¶ added in v0.16.0
type Room_Addr struct {
Addr string `protobuf:"bytes,2,opt,name=addr,proto3,oneof"`
}
type Room_Seat ¶ added in v0.16.0
type Room_Seat struct {
// contains filtered or unexported fields
}
Seat and State are nested, which the generator's own names may not clash with either.
func (*Room_Seat) Descriptor
deprecated
added in
v0.16.0
func (*Room_Seat) ProtoMessage ¶ added in v0.16.0
func (*Room_Seat) ProtoMessage()
func (*Room_Seat) ProtoReflect ¶ added in v0.16.0
func (x *Room_Seat) ProtoReflect() protoreflect.Message
type Room_State ¶ added in v0.16.0
type Room_State int32
const (
Room_STATE_UNSPECIFIED Room_State = 0
)
func (Room_State) Descriptor ¶ added in v0.16.0
func (Room_State) Descriptor() protoreflect.EnumDescriptor
func (Room_State) Enum ¶ added in v0.16.0
func (x Room_State) Enum() *Room_State
func (Room_State) EnumDescriptor
deprecated
added in
v0.16.0
func (Room_State) EnumDescriptor() ([]byte, []int)
Deprecated: Use Room_State.Descriptor instead.
func (Room_State) Number ¶ added in v0.16.0
func (x Room_State) Number() protoreflect.EnumNumber
func (Room_State) String ¶ added in v0.16.0
func (x Room_State) String() string
func (Room_State) Type ¶ added in v0.16.0
func (Room_State) Type() protoreflect.EnumType
type SinkAddr ¶ added in v0.16.0
SinkAddr addresses a process of the Sink service; its methods are its rpcs.
Sink takes a Clear and nothing else: a process with no name and no prefix, addressed by PID or by a name of the application's, with a send only, whose request has no fields.
func SinkAddrOf ¶ added in v0.16.0
SinkAddrOf addresses t, a PID, a Name or a global name, as a process of the Sink service.
type SinkHandler ¶ added in v0.16.0
type SinkHandler interface {
Flush(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message]) error
}
SinkHandler is what a process of the Sink service does with what it is sent: a method per call, whose result is the reply, as actor.CallHandler's is, and one per send. HandleSinkCall and HandleSinkMessage dispatch to it; UnimplementedSinkHandler answers for the methods an implementation leaves out.
type UnimplementedEchoHandler ¶ added in v0.16.0
type UnimplementedEchoHandler struct{}
UnimplementedEchoHandler answers grpcproc.ErrType to every call and drops every send, for an implementation to embed and override what it handles.
type UnimplementedRoomHandler ¶ added in v0.16.0
type UnimplementedRoomHandler struct{}
UnimplementedRoomHandler answers grpcproc.ErrType to every call and drops every send, for an implementation to embed and override what it handles.
type UnimplementedSinkHandler ¶ added in v0.16.0
type UnimplementedSinkHandler struct{}
UnimplementedSinkHandler answers grpcproc.ErrType to every call and drops every send, for an implementation to embed and override what it handles.