testpb

package
v0.15.0 Latest Latest
Warning

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

Go to latest
Published: Oct 17, 2026 License: MIT Imports: 10 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Index

Constants

View Source
const EchoProcess = "echo"

EchoProcess is the name a process of the Echo service is registered under on its node.

Variables

View Source
var File_protocgen_testpb_gen_proto protoreflect.FileDescriptor
View Source
var File_protocgen_testpb_nosvc_proto protoreflect.FileDescriptor

Functions

func HandleEchoCall

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.

func HandleRoomCall

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.

Types

type EchoAddr

type EchoAddr struct{ grpcproc.Addr[proto.Message] }

EchoAddr addresses a process of the Echo service; its methods are its rpcs.

Echo answers pings, and takes notes.

func EchoAddrOf

func EchoAddrOf(t grpcproc.Target) EchoAddr

EchoAddrOf addresses t, a PID, a Name or a global name, as a process of the Echo service.

func EchoAt

func EchoAt(node string) EchoAddr

EchoAt addresses the process of the Echo service on node, registered as EchoProcess.

func (EchoAddr) Note

func (c EchoAddr) Note(ctx context.Context, from grpcproc.Caller, req *Note) error

Note is kept; nothing answers it.

func (EchoAddr) Ping

func (c EchoAddr) Ping(ctx context.Context, from grpcproc.Caller, req *Ping) (*Pong, error)

Ping is answered with a Pong of the same n. The message's name is the rpc's, so it is qualified.

type EchoHandler

type EchoHandler interface {
	Ping(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Ping) (*Pong, error)
	Note(p *grpcproc.Process[proto.Message], m grpcproc.Msg[proto.Message], req *Note) 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.

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

Deprecated: Use Note.ProtoReflect.Descriptor instead.

func (*Note) GetText

func (x *Note) GetText() string

func (*Note) ProtoMessage

func (*Note) ProtoMessage()

func (*Note) ProtoReflect

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

func (*Note) Reset

func (x *Note) Reset()

func (*Note) String

func (x *Note) String() string

type Nothing

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

func (*Nothing) Descriptor deprecated

func (*Nothing) Descriptor() ([]byte, []int)

Deprecated: Use Nothing.ProtoReflect.Descriptor instead.

func (*Nothing) ProtoMessage

func (*Nothing) ProtoMessage()

func (*Nothing) ProtoReflect

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

func (*Nothing) Reset

func (x *Nothing) Reset()

func (*Nothing) String

func (x *Nothing) String() string

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

Deprecated: Use Ping.ProtoReflect.Descriptor instead.

func (*Ping) GetN

func (x *Ping) GetN() int64

func (*Ping) ProtoMessage

func (*Ping) ProtoMessage()

func (*Ping) ProtoReflect

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

func (*Ping) Reset

func (x *Ping) Reset()

func (*Ping) String

func (x *Ping) String() string

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

Deprecated: Use Pong.ProtoReflect.Descriptor instead.

func (*Pong) GetN

func (x *Pong) GetN() int64

func (*Pong) ProtoMessage

func (*Pong) ProtoMessage()

func (*Pong) ProtoReflect

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

func (*Pong) Reset

func (x *Pong) Reset()

func (*Pong) String

func (x *Pong) String() string

type RoomAddr

type RoomAddr struct{ grpcproc.Addr[proto.Message] }

RoomAddr addresses a process of the Room service; its methods are its rpcs.

func RoomAddrOf

func RoomAddrOf(t grpcproc.Target) RoomAddr

RoomAddrOf addresses t, a PID, a Name or a global name, as a process of the Room service.

func (RoomAddr) Bounce

func (c RoomAddr) Bounce(ctx context.Context, from grpcproc.Caller, req *Ping) (*Pong, error)

Bounce calls the process with req and waits for its Pong.

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.

Jump to

Keyboard shortcuts

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