dev

package
v0.11.0 Latest Latest
Warning

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

Go to latest
Published: Jan 4, 2026 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_zorums_proto protoreflect.FileDescriptor

Functions

func Multicast added in v0.11.0

func Multicast(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) error

Multicast plain. Response type is not needed here.

func Multicast2 added in v0.11.0

func Multicast2(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) error

Multicast2 is testing whether multiple streams work.

func Multicast3 added in v0.11.0

func Multicast3(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) error

Multicast3 is testing imported message type.

func Multicast4 added in v0.11.0

func Multicast4(ctx *gorums.ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) error

Multicast4 is testing imported message type.

func QuorumCall added in v0.11.0

func QuorumCall(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response]

QuorumCall plain.

func QuorumCallEmpty added in v0.11.0

func QuorumCallEmpty(ctx *gorums.ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response]

QuorumCallEmpty for testing imported message type.

func QuorumCallEmpty2 added in v0.11.0

func QuorumCallEmpty2(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty]

QuorumCallEmpty2 for testing imported message type.

func QuorumCallStream added in v0.11.0

func QuorumCallStream(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*Response]

QuorumCallStream plain.

func QuorumCallStreamWithEmpty added in v0.11.0

func QuorumCallStreamWithEmpty(ctx *gorums.ConfigContext, in *Request, opts ...gorums.CallOption) *gorums.Responses[*emptypb.Empty]

QuorumCallStreamWithEmpty for testing imported message type.

func QuorumCallStreamWithEmpty2 added in v0.11.0

func QuorumCallStreamWithEmpty2(ctx *gorums.ConfigContext, in *emptypb.Empty, opts ...gorums.CallOption) *gorums.Responses[*Response]

QuorumCallStreamWithEmpty2 for testing imported message type; with same return type as QuorumCallStream: Response.

func RegisterZorumsServiceServer

func RegisterZorumsServiceServer(srv *gorums.Server, impl ZorumsServiceServer)

func Unicast added in v0.11.0

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.

func Unicast2 added in v0.11.0

func Unicast2(ctx *gorums.NodeContext, in *Request, opts ...gorums.CallOption) error

Unicast2 is a unicast call invoked on the node in ctx. No reply is returned to the client.

Types

type AsyncEmpty added in v0.3.0

type AsyncEmpty = *gorums.Async[*emptypb.Empty]

AsyncEmpty is a future for async quorum calls returning *emptypb.Empty.

type AsyncResponse added in v0.3.0

type AsyncResponse = *gorums.Async[*Response]

AsyncResponse is a future for async quorum calls returning *Response.

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

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 CorrectableEmpty

type CorrectableEmpty = *gorums.Correctable[*emptypb.Empty]

CorrectableEmpty is a correctable object for quorum calls returning *emptypb.Empty.

type CorrectableResponse

type CorrectableResponse = *gorums.Correctable[*Response]

CorrectableResponse is a correctable object for quorum calls returning *Response.

type Manager

type Manager = gorums.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 MyResponse

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

func (*MyResponse) GetValue

func (x *MyResponse) GetValue() string

func (*MyResponse) ProtoMessage

func (*MyResponse) ProtoMessage()

func (*MyResponse) ProtoReflect

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

func (*MyResponse) Reset

func (x *MyResponse) Reset()

func (*MyResponse) SetValue added in v0.8.0

func (x *MyResponse) SetValue(v string)

func (*MyResponse) String

func (x *MyResponse) String() string

type MyResponse_builder added in v0.8.0

type MyResponse_builder struct {
	Value string
	// contains filtered or unexported fields
}

func (MyResponse_builder) Build added in v0.8.0

func (b0 MyResponse_builder) Build() *MyResponse

type Node

type Node = gorums.Node

Type aliases for important Gorums types to make them more accessible from user code already interacting with the generated code.

type Request

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

func (*Request) GetValue

func (x *Request) GetValue() string

func (*Request) ProtoMessage

func (*Request) ProtoMessage()

func (*Request) ProtoReflect

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

func (*Request) Reset

func (x *Request) Reset()

func (*Request) SetValue added in v0.8.0

func (x *Request) SetValue(v string)

func (*Request) String

func (x *Request) String() string

type Request_builder added in v0.8.0

type Request_builder struct {
	Value string
	// contains filtered or unexported fields
}

func (Request_builder) Build added in v0.8.0

func (b0 Request_builder) Build() *Request

type Response

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

func GRPCCall added in v0.11.0

func GRPCCall(ctx *gorums.NodeContext, in *Request) (resp *Response, err error)

GRPCCall plain gRPC call; testing that Gorums can ignore these, but that they are added to the _grpc.pb.go generated file.

func (*Response) GetResult

func (x *Response) GetResult() int64

func (*Response) ProtoMessage

func (*Response) ProtoMessage()

func (*Response) ProtoReflect

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

func (*Response) Reset

func (x *Response) Reset()

func (*Response) SetResult added in v0.8.0

func (x *Response) SetResult(v int64)

func (*Response) String

func (x *Response) String() string

type Response_builder added in v0.8.0

type Response_builder struct {
	Result int64
	// contains filtered or unexported fields
}

func (Response_builder) Build added in v0.8.0

func (b0 Response_builder) Build() *Response

type ZorumsServiceServer

type ZorumsServiceServer interface {
	GRPCCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error)
	QuorumCall(ctx gorums.ServerCtx, request *Request) (response *Response, err error)
	QuorumCallEmpty(ctx gorums.ServerCtx, request *emptypb.Empty) (response *Response, err error)
	QuorumCallEmpty2(ctx gorums.ServerCtx, request *Request) (response *emptypb.Empty, err error)
	Multicast(ctx gorums.ServerCtx, request *Request)
	Multicast2(ctx gorums.ServerCtx, request *Request)
	Multicast3(ctx gorums.ServerCtx, request *Request)
	Multicast4(ctx gorums.ServerCtx, request *emptypb.Empty)
	QuorumCallStream(ctx gorums.ServerCtx, request *Request, send func(response *Response) error) error
	QuorumCallStreamWithEmpty(ctx gorums.ServerCtx, request *Request, send func(response *emptypb.Empty) error) error
	QuorumCallStreamWithEmpty2(ctx gorums.ServerCtx, request *emptypb.Empty, send func(response *Response) error) error
	Unicast(ctx gorums.ServerCtx, request *Request)
	Unicast2(ctx gorums.ServerCtx, request *Request)
}

ZorumsService is the server-side API for the ZorumsService Service

Jump to

Keyboard shortcuts

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