Documentation
¶
Index ¶
- Variables
- func Multicast(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) error
- func RegisterOnewayTestServer(srv *gorums.Server, impl OnewayTestServer)
- func Unicast(ctx *gorums.NodeContext, in *Request, opts ...gorums.CallOption) error
- type Configuration
- type Empty
- type Empty_builder
- type Manager
- type Node
- type OnewayTestServer
- type Request
- type Request_builder
Constants ¶
This section is empty.
Variables ¶
var File_oneway_oneway_proto protoreflect.FileDescriptor
Functions ¶
func Multicast ¶
func Multicast(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) error
Multicast is a multicast call invoked on all nodes in the configuration in ctx. Use gorums.MapRequest to send different messages to each node. No replies are collected.
func RegisterOnewayTestServer ¶
func RegisterOnewayTestServer(srv *gorums.Server, impl OnewayTestServer)
func Unicast ¶
func Unicast(ctx *gorums.NodeContext, in *Request, opts ...gorums.CallOption) error
Unicast is a unicast call invoked on the node in ctx. No reply is returned to the client.
Types ¶
type Configuration ¶
type Configuration = gorums.Configuration
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
func NewConfig ¶
func NewConfig(opts ...gorums.Option) (Configuration, error)
NewConfig returns a new Configuration based on the provided [gorums.Option]s. It accepts exactly one gorums.NodeListOption and multiple [gorums.ManagerOption]s. You may use this function to create the initial configuration for a new manager.
Example:
cfg, err := NewConfig(
gorums.WithNodeList([]string{"localhost:8080", "localhost:8081", "localhost:8082"}),
gorums.WithDialOptions(grpc.WithTransportCredentials(insecure.NewCredentials())),
)
This is a convenience function for creating a configuration without explicitly creating a manager first. However, the manager can be accessed using the [Configuration.Manager] method. This method should only be used once since it creates a new manager; if a manager already exists, use NewConfiguration instead, and provide the existing manager as the first argument.
func NewConfiguration ¶
func NewConfiguration(mgr *Manager, opt gorums.NodeListOption) (Configuration, error)
NewConfiguration returns a configuration based on the provided list of nodes. Nodes can be supplied using WithNodeMap or WithNodeList, or WithNodeIDs. A new configuration can also be created from an existing configuration, using the And, WithNewNodes, Except, and WithoutNodes methods.
type Empty ¶
type Empty struct {
// contains filtered or unexported fields
}
func (*Empty) ProtoMessage ¶
func (*Empty) ProtoMessage()
func (*Empty) ProtoReflect ¶
func (x *Empty) ProtoReflect() protoreflect.Message
type Empty_builder ¶
type Empty_builder struct {
// contains filtered or unexported fields
}
func (Empty_builder) Build ¶
func (b0 Empty_builder) Build() *Empty
type Manager ¶
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
func NewManager ¶
func NewManager(opts ...gorums.ManagerOption) *Manager
NewManager returns a new Manager for managing connection to nodes added to the manager. This function accepts manager options used to configure various aspects of the manager.
type Node ¶
Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.
type OnewayTestServer ¶
type OnewayTestServer interface {
Unicast(ctx gorums.ServerCtx, request *Request)
Multicast(ctx gorums.ServerCtx, request *Request)
}
OnewayTest is the server-side API for the OnewayTest Service
type Request ¶
type Request struct {
// contains filtered or unexported fields
}
func (*Request) ProtoMessage ¶
func (*Request) ProtoMessage()
func (*Request) ProtoReflect ¶
func (x *Request) ProtoReflect() protoreflect.Message
type Request_builder ¶
type Request_builder struct {
Num uint64
// contains filtered or unexported fields
}
func (Request_builder) Build ¶
func (b0 Request_builder) Build() *Request