my_service

package
v0.2.1 Latest Latest
Warning

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

Go to latest
Published: Dec 27, 2022 License: Apache-2.0 Imports: 7 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

This section is empty.

Variables

View Source
var File_my_service_proto protoreflect.FileDescriptor

Functions

This section is empty.

Types

type Ignored

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

func (*Ignored) Descriptor deprecated

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

Deprecated: Use Ignored.ProtoReflect.Descriptor instead.

func (*Ignored) ProtoMessage

func (*Ignored) ProtoMessage()

func (*Ignored) ProtoReflect

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

func (*Ignored) Reset

func (x *Ignored) Reset()

func (*Ignored) String

func (x *Ignored) String() string

type MyRequest

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

func (*MyRequest) Descriptor deprecated

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

Deprecated: Use MyRequest.ProtoReflect.Descriptor instead.

func (*MyRequest) ProtoMessage

func (*MyRequest) ProtoMessage()

func (*MyRequest) ProtoReflect

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

func (*MyRequest) Reset

func (x *MyRequest) Reset()

func (*MyRequest) String

func (x *MyRequest) String() string

type MyResponse

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

func (*MyResponse) Descriptor deprecated

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

Deprecated: Use MyResponse.ProtoReflect.Descriptor instead.

func (*MyResponse) ProtoMessage

func (*MyResponse) ProtoMessage()

func (*MyResponse) ProtoReflect

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

func (*MyResponse) Reset

func (x *MyResponse) Reset()

func (*MyResponse) String

func (x *MyResponse) String() string

type MyServiceClient

type MyServiceClient interface {
	// A normal RPC - one request, one response. The request will be handled by the first available server
	NormalRPC(context.Context, *MyRequest, ...psrpc1.RequestOption) (*MyResponse, error)

	// An RPC with a server affinity function for handler selection.
	IntensiveRPC(context.Context, *MyRequest, ...psrpc1.RequestOption) (*MyResponse, error)

	// A multi-rpc - a client will send one request, and receive one response each from every server
	GetStats(context.Context, *MyRequest, ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*MyResponse], error)

	// An RPC with topics - a client can send one request, and receive one response from each server in one region
	GetRegionStats(context.Context, string, *MyRequest, ...psrpc1.RequestOption) (<-chan *psrpc1.Response[*MyResponse], error)

	// A queue subscription - even if multiple clients are subscribed, only one will receive this update.
	// The request parameter (Ignored) will be ignored when generating go files.
	SubscribeProcessUpdate(context.Context) (psrpc1.Subscription[*MyUpdate], error)

	// A subscription with topics - every client subscribed to the topic will receive every update.
	// The request parameter (Ignored) will be ignored when generating go files.
	SubscribeUpdateRegionState(context.Context, string) (psrpc1.Subscription[*MyUpdate], error)
}

func NewMyServiceClient

func NewMyServiceClient(clientID string, bus psrpc1.MessageBus, opts ...psrpc1.ClientOption) (MyServiceClient, error)

NewMyServiceClient creates a psrpc client that implements the MyServiceClient interface.

type MyServiceServer

type MyServiceServer interface {
	// An RPC with topics - a client can send one request, and receive one response from each server in one region
	RegisterGetRegionStatsTopic(string) error
	DeregisterGetRegionStatsTopic(string)

	// A queue subscription - even if multiple clients are subscribed, only one will receive this update.
	// The request parameter (Ignored) will be ignored when generating go files.
	PublishProcessUpdate(context.Context, *MyUpdate) error

	// A subscription with topics - every client subscribed to the topic will receive every update.
	// The request parameter (Ignored) will be ignored when generating go files.
	PublishUpdateRegionState(context.Context, string, *MyUpdate) error

	// Close and wait for pending RPCs to complete
	Shutdown()

	// Close immediately, without waiting for pending RPCs
	Kill()
}

func NewMyServiceServer

func NewMyServiceServer(serverID string, svc MyServiceServerImpl, bus psrpc1.MessageBus, opts ...psrpc1.ServerOption) (MyServiceServer, error)

NewMyServiceServer builds a RPCServer that will route requests to the corresponding method in the provided svc implementation.

type MyServiceServerImpl

type MyServiceServerImpl interface {
	// A normal RPC - one request, one response. The request will be handled by the first available server
	NormalRPC(context.Context, *MyRequest) (*MyResponse, error)

	// An RPC with a server affinity function for handler selection.
	IntensiveRPC(context.Context, *MyRequest) (*MyResponse, error)
	IntensiveRPCAffinity(*MyRequest) float32

	// A multi-rpc - a client will send one request, and receive one response each from every server
	GetStats(context.Context, *MyRequest) (*MyResponse, error)

	// An RPC with topics - a client can send one request, and receive one response from each server in one region
	GetRegionStats(context.Context, *MyRequest) (*MyResponse, error)
}

type MyUpdate

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

func (*MyUpdate) Descriptor deprecated

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

Deprecated: Use MyUpdate.ProtoReflect.Descriptor instead.

func (*MyUpdate) ProtoMessage

func (*MyUpdate) ProtoMessage()

func (*MyUpdate) ProtoReflect

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

func (*MyUpdate) Reset

func (x *MyUpdate) Reset()

func (*MyUpdate) String

func (x *MyUpdate) String() string

Jump to

Keyboard shortcuts

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