peers

package
v1.9.0 Latest Latest
Warning

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

Go to latest
Published: Nov 19, 2024 License: MIT Imports: 9 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PeerManagement_GetPeers_FullMethodName = "/trtl.peers.v1.PeerManagement/GetPeers"
	PeerManagement_AddPeers_FullMethodName = "/trtl.peers.v1.PeerManagement/AddPeers"
	PeerManagement_RmPeers_FullMethodName  = "/trtl.peers.v1.PeerManagement/RmPeers"
)

Variables

View Source
var File_trtl_peers_v1_peers_proto protoreflect.FileDescriptor
View Source
var PeerManagement_ServiceDesc = grpc.ServiceDesc{
	ServiceName: "trtl.peers.v1.PeerManagement",
	HandlerType: (*PeerManagementServer)(nil),
	Methods: []grpc.MethodDesc{
		{
			MethodName: "GetPeers",
			Handler:    _PeerManagement_GetPeers_Handler,
		},
		{
			MethodName: "AddPeers",
			Handler:    _PeerManagement_AddPeers_Handler,
		},
		{
			MethodName: "RmPeers",
			Handler:    _PeerManagement_RmPeers_Handler,
		},
	},
	Streams:  []grpc.StreamDesc{},
	Metadata: "trtl/peers/v1/peers.proto",
}

PeerManagement_ServiceDesc is the grpc.ServiceDesc for PeerManagement service. It's only intended for direct use with grpc.RegisterService, and not to be introspected or modified (even as a copy)

Functions

func RegisterPeerManagementServer

func RegisterPeerManagementServer(s grpc.ServiceRegistrar, srv PeerManagementServer)

Types

type Peer

type Peer struct {
	Id     uint64 `protobuf:"varint,1,opt,name=id,proto3" json:"id,omitempty"`        // the process id of the peer must be unique in the network; used for distributed versions
	Addr   string `protobuf:"bytes,2,opt,name=addr,proto3" json:"addr,omitempty"`     // the network address to connect to the peer on (don't forget the port!)
	Name   string `protobuf:"bytes,3,opt,name=name,proto3" json:"name,omitempty"`     // optional - a unique, human readable name for the peer
	Region string `protobuf:"bytes,4,opt,name=region,proto3" json:"region,omitempty"` // optional? - the region the peer is running in
	// Logging information timestamps
	Created  string `protobuf:"bytes,9,opt,name=created,proto3" json:"created,omitempty"`
	Modified string `protobuf:"bytes,10,opt,name=modified,proto3" json:"modified,omitempty"`
	// extra information that might be relevant to process-specific functions; e.g. for
	// specific clouds or data that's been parsed (optional).
	Extra map[string]string `` /* 152-byte string literal not displayed */
	// contains filtered or unexported fields
}

Peer contains metadata about how to connect to remote peers in the directory service network. This message services as a data-transfer and exchange mechanism for dynamic networks with changing membership.

func (*Peer) Descriptor deprecated

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

Deprecated: Use Peer.ProtoReflect.Descriptor instead.

func (*Peer) GetAddr

func (x *Peer) GetAddr() string

func (*Peer) GetCreated

func (x *Peer) GetCreated() string

func (*Peer) GetExtra

func (x *Peer) GetExtra() map[string]string

func (*Peer) GetId

func (x *Peer) GetId() uint64

func (*Peer) GetModified

func (x *Peer) GetModified() string

func (*Peer) GetName

func (x *Peer) GetName() string

func (*Peer) GetRegion

func (x *Peer) GetRegion() string

func (*Peer) Key

func (p *Peer) Key() string

func (*Peer) ProtoMessage

func (*Peer) ProtoMessage()

func (*Peer) ProtoReflect

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

func (*Peer) Reset

func (x *Peer) Reset()

func (*Peer) String

func (x *Peer) String() string

type PeerManagementClient

type PeerManagementClient interface {
	GetPeers(ctx context.Context, in *PeersFilter, opts ...grpc.CallOption) (*PeersList, error)
	AddPeers(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*PeersStatus, error)
	RmPeers(ctx context.Context, in *Peer, opts ...grpc.CallOption) (*PeersStatus, error)
}

PeerManagementClient is the client API for PeerManagement service.

For semantics around ctx use and closing/ending streaming RPCs, please refer to https://pkg.go.dev/google.golang.org/grpc/?tab=doc#ClientConn.NewStream.

PeerManagement provides a simple interface for administrators to debug the anti-entropy network and to manage services. Note that administrators can also use Gossip to perform the same requests, but this service simplifies things.

type PeerManagementServer

type PeerManagementServer interface {
	GetPeers(context.Context, *PeersFilter) (*PeersList, error)
	AddPeers(context.Context, *Peer) (*PeersStatus, error)
	RmPeers(context.Context, *Peer) (*PeersStatus, error)
	// contains filtered or unexported methods
}

PeerManagementServer is the server API for PeerManagement service. All implementations must embed UnimplementedPeerManagementServer for forward compatibility

PeerManagement provides a simple interface for administrators to debug the anti-entropy network and to manage services. Note that administrators can also use Gossip to perform the same requests, but this service simplifies things.

type PeersFilter

type PeersFilter struct {
	Region     []string `protobuf:"bytes,1,rep,name=region,proto3" json:"region,omitempty"`                            // Specify the region(s) to return the peers for. Only effects PeersList not PeersStatus
	StatusOnly bool     `protobuf:"varint,2,opt,name=status_only,json=statusOnly,proto3" json:"status_only,omitempty"` // Return only the peers status, not a list of peers.
	// contains filtered or unexported fields
}

Used to filter the peers that are returned. If no filters are specified then all known peers on the remote replica are returned.

func (*PeersFilter) Descriptor deprecated

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

Deprecated: Use PeersFilter.ProtoReflect.Descriptor instead.

func (*PeersFilter) GetRegion

func (x *PeersFilter) GetRegion() []string

func (*PeersFilter) GetStatusOnly

func (x *PeersFilter) GetStatusOnly() bool

func (*PeersFilter) ProtoMessage

func (*PeersFilter) ProtoMessage()

func (*PeersFilter) ProtoReflect

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

func (*PeersFilter) Reset

func (x *PeersFilter) Reset()

func (*PeersFilter) String

func (x *PeersFilter) String() string

type PeersList

type PeersList struct {
	Peers  []*Peer      `protobuf:"bytes,1,rep,name=peers,proto3" json:"peers,omitempty"`
	Status *PeersStatus `protobuf:"bytes,2,opt,name=status,proto3" json:"status,omitempty"`
	// contains filtered or unexported fields
}

Returns the list of peers currently known to the replica and its peer management status.

func (*PeersList) Descriptor deprecated

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

Deprecated: Use PeersList.ProtoReflect.Descriptor instead.

func (*PeersList) GetPeers

func (x *PeersList) GetPeers() []*Peer

func (*PeersList) GetStatus

func (x *PeersList) GetStatus() *PeersStatus

func (*PeersList) ProtoMessage

func (*PeersList) ProtoMessage()

func (*PeersList) ProtoReflect

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

func (*PeersList) Reset

func (x *PeersList) Reset()

func (*PeersList) String

func (x *PeersList) String() string

type PeersStatus

type PeersStatus struct {
	NetworkSize int64            `protobuf:"varint,1,opt,name=network_size,json=networkSize,proto3" json:"network_size,omitempty"` // The total number of peers known to the replica (including itself)
	Regions     map[string]int64 ``                                                                                                // The number of peers known to the replica per known region
	/* 156-byte string literal not displayed */
	LastSynchronization string `protobuf:"bytes,3,opt,name=last_synchronization,json=lastSynchronization,proto3" json:"last_synchronization,omitempty"` // The timestamp of the last synchronization that exchanged data
	// contains filtered or unexported fields
}

A response to a peer management command that describes the current state of the network.

func (*PeersStatus) Descriptor deprecated

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

Deprecated: Use PeersStatus.ProtoReflect.Descriptor instead.

func (*PeersStatus) GetLastSynchronization added in v1.3.1

func (x *PeersStatus) GetLastSynchronization() string

func (*PeersStatus) GetNetworkSize

func (x *PeersStatus) GetNetworkSize() int64

func (*PeersStatus) GetRegions

func (x *PeersStatus) GetRegions() map[string]int64

func (*PeersStatus) ProtoMessage

func (*PeersStatus) ProtoMessage()

func (*PeersStatus) ProtoReflect

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

func (*PeersStatus) Reset

func (x *PeersStatus) Reset()

func (*PeersStatus) String

func (x *PeersStatus) String() string

type UnimplementedPeerManagementServer

type UnimplementedPeerManagementServer struct {
}

UnimplementedPeerManagementServer must be embedded to have forward compatible implementations.

func (UnimplementedPeerManagementServer) AddPeers

func (UnimplementedPeerManagementServer) GetPeers

func (UnimplementedPeerManagementServer) RmPeers

type UnsafePeerManagementServer

type UnsafePeerManagementServer interface {
	// contains filtered or unexported methods
}

UnsafePeerManagementServer may be embedded to opt out of forward compatibility for this service. Use of this interface is not recommended, as added methods to PeerManagementServer will result in compilation errors.

Jump to

Keyboard shortcuts

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