testpb

package
v0.16.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: 12 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.

View Source
const EchoStatsTopic = "echo-stats"

EchoStatsTopic is the name the Stats topic of the Echo service is registered under on its process's node.

Variables

View Source
var (
	Kind_name = map[int32]string{
		0: "KIND_UNSPECIFIED",
	}
	Kind_value = map[string]int32{
		"KIND_UNSPECIFIED": 0,
	}
)

Enum value maps for Kind.

View Source
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.

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

Functions

func EchoStatsAt added in v0.16.0

func EchoStatsAt(node string) pubsub.Topic[*Pong]

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

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

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

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

func RoomEventsAt(node, id string) pubsub.Topic[*Note]

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

func RoomEventsTopic(id string) string

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

func RoomProcess(id string) string

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

Deprecated: Use Clear.ProtoReflect.Descriptor instead.

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

func (*Clear) Reset added in v0.16.0

func (x *Clear) Reset()

func (*Clear) String added in v0.16.0

func (x *Clear) String() string

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

Deprecated: Use Count.ProtoReflect.Descriptor instead.

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

func (*Count) Reset added in v0.16.0

func (x *Count) Reset()

func (*Count) String added in v0.16.0

func (x *Count) String() string

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 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) Clear added in v0.16.0

func (c EchoAddr) Clear(ctx context.Context, from grpcproc.Caller) error

Clear sends a Clear to the process, which answers nothing.

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

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

Count calls the process with a Count and waits for its Pong.

func (EchoAddr) Note

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

Note is kept; nothing answers it.

func (EchoAddr) NoteAfter added in v0.16.0

func (c EchoAddr) NoteAfter[M proto.Message](p *grpcproc.Process[M], d time.Duration, req *Note) *grpcproc.Timer

NoteAfter sends req to the process after d, from p; the timer can stop 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

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) Enum added in v0.16.0

func (x Kind) Enum() *Kind

func (Kind) EnumDescriptor deprecated added in v0.16.0

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

Deprecated: Use Kind.Descriptor instead.

func (Kind) Number added in v0.16.0

func (x Kind) Number() protoreflect.EnumNumber

func (Kind) String added in v0.16.0

func (x Kind) String() string

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

Deprecated: Use Room.ProtoReflect.Descriptor instead.

func (*Room) GetAddr added in v0.16.0

func (x *Room) GetAddr() string

func (*Room) GetId added in v0.16.0

func (x *Room) GetId() string

func (*Room) GetTarget added in v0.16.0

func (x *Room) GetTarget() isRoom_Target

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

func (*Room) Reset added in v0.16.0

func (x *Room) Reset()

func (*Room) String added in v0.16.0

func (x *Room) String() string

type RoomAddr

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

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

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 RoomAt added in v0.16.0

func RoomAt(node, id string) RoomAddr

RoomAt addresses the process of the Room service for id on node, registered as RoomProcess(id).

func RoomGlobal added in v0.16.0

func RoomGlobal(id string) RoomAddr

RoomGlobal addresses the process of the Room service that holds the global name RoomProcess(id), wherever it runs.

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

Deprecated: Use Room_Seat.ProtoReflect.Descriptor instead.

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

func (*Room_Seat) Reset added in v0.16.0

func (x *Room_Seat) Reset()

func (*Room_Seat) String added in v0.16.0

func (x *Room_Seat) String() string

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

type SinkAddr added in v0.16.0

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

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

func SinkAddrOf(t grpcproc.Target) SinkAddr

SinkAddrOf addresses t, a PID, a Name or a global name, as a process of the Sink service.

func (SinkAddr) Flush added in v0.16.0

func (c SinkAddr) Flush(ctx context.Context, from grpcproc.Caller) error

Flush sends a Clear to the process, which answers nothing.

func (SinkAddr) FlushAfter added in v0.16.0

func (c SinkAddr) FlushAfter[M proto.Message](p *grpcproc.Process[M], d time.Duration) *grpcproc.Timer

FlushAfter sends a Clear to the process after d, from p; the timer can stop it.

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.

func (UnimplementedEchoHandler) Clear added in v0.16.0

func (UnimplementedEchoHandler) Count added in v0.16.0

func (UnimplementedEchoHandler) Note added in v0.16.0

func (UnimplementedEchoHandler) Ping added in v0.16.0

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.

func (UnimplementedRoomHandler) Bounce added in v0.16.0

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.

func (UnimplementedSinkHandler) Flush added in v0.16.0

Jump to

Keyboard shortcuts

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