metadata

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: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var File_metadata_metadata_proto protoreflect.FileDescriptor

Functions

func RegisterMetadataTestServer

func RegisterMetadataTestServer(srv *gorums.Server, impl MetadataTestServer)

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 IPAddr

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

func WhatIP

func WhatIP(ctx *gorums.NodeContext, in *emptypb.Empty) (resp *IPAddr, err error)

WhatIP returns the address of the client that calls it.

func (*IPAddr) GetAddr

func (x *IPAddr) GetAddr() string

func (*IPAddr) ProtoMessage

func (*IPAddr) ProtoMessage()

func (*IPAddr) ProtoReflect

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

func (*IPAddr) Reset

func (x *IPAddr) Reset()

func (*IPAddr) SetAddr

func (x *IPAddr) SetAddr(v string)

func (*IPAddr) String

func (x *IPAddr) String() string

type IPAddr_builder

type IPAddr_builder struct {
	Addr string
	// contains filtered or unexported fields
}

func (IPAddr_builder) Build

func (b0 IPAddr_builder) Build() *IPAddr

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 MetadataTestServer

type MetadataTestServer interface {
	IDFromMD(ctx gorums.ServerCtx, request *emptypb.Empty) (response *NodeID, err error)
	WhatIP(ctx gorums.ServerCtx, request *emptypb.Empty) (response *IPAddr, err error)
}

MetadataTest is the server-side API for the MetadataTest Service

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 NodeID

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

func IDFromMD

func IDFromMD(ctx *gorums.NodeContext, in *emptypb.Empty) (resp *NodeID, err error)

IDFromMD returns the 'id' field from the metadata.

func (*NodeID) GetID

func (x *NodeID) GetID() uint32

func (*NodeID) ProtoMessage

func (*NodeID) ProtoMessage()

func (*NodeID) ProtoReflect

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

func (*NodeID) Reset

func (x *NodeID) Reset()

func (*NodeID) SetID

func (x *NodeID) SetID(v uint32)

func (*NodeID) String

func (x *NodeID) String() string

type NodeID_builder

type NodeID_builder struct {
	ID uint32
	// contains filtered or unexported fields
}

func (NodeID_builder) Build

func (b0 NodeID_builder) Build() *NodeID

Jump to

Keyboard shortcuts

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