server

package
v0.55.4 Latest Latest
Warning

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

Go to latest
Published: Jan 22, 2026 License: Unlicense Imports: 10 Imported by: 0

Documentation

Overview

Package server provides the gRPC server implementation for negentropy sync.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Service

type Service struct {
	negentropyv1.UnimplementedNegentropyServiceServer
	// contains filtered or unexported fields
}

Service implements the NegentropyServiceServer interface.

func NewService

func NewService(db database.Database, mgr *negentropy.Manager) *Service

NewService creates a new negentropy gRPC service.

func (*Service) AddPeer

AddPeer adds a peer for negentropy sync.

func (*Service) CloseSession

func (s *Service) CloseSession(ctx context.Context, req *negentropyv1.CloseSessionRequest) (*commonv1.Empty, error)

CloseSession forcefully closes a client session.

func (*Service) GetPeerSyncState

GetPeerSyncState returns sync state for a specific peer.

func (*Service) GetPeers

GetPeers returns the list of negentropy sync peers.

func (*Service) GetSyncStatus

func (s *Service) GetSyncStatus(ctx context.Context, _ *commonv1.Empty) (*negentropyv1.SyncStatusResponse, error)

GetSyncStatus returns the current sync status.

func (*Service) HandleNegClose

func (s *Service) HandleNegClose(ctx context.Context, req *negentropyv1.NegCloseRequest) (*commonv1.Empty, error)

HandleNegClose processes a NEG-CLOSE message from a client.

func (*Service) HandleNegMsg

HandleNegMsg processes a NEG-MSG message from a client.

func (*Service) HandleNegOpen

HandleNegOpen processes a NEG-OPEN message from a client.

func (*Service) ListSessions

ListSessions returns active client negentropy sessions.

func (*Service) Ready

Ready returns whether the service is ready to serve requests.

func (*Service) RemovePeer

RemovePeer removes a peer from negentropy sync.

func (*Service) Start

func (s *Service) Start(ctx context.Context, _ *commonv1.Empty) (*commonv1.Empty, error)

Start starts the background relay-to-relay sync.

func (*Service) Stop

func (s *Service) Stop(ctx context.Context, _ *commonv1.Empty) (*commonv1.Empty, error)

Stop stops the background sync.

func (*Service) SyncWithPeer

SyncWithPeer initiates negentropy sync with a specific peer relay.

func (*Service) TriggerSync

func (s *Service) TriggerSync(ctx context.Context, req *negentropyv1.TriggerSyncRequest) (*commonv1.Empty, error)

TriggerSync manually triggers sync with a specific peer or all peers.

Source Files

  • service.go

Jump to

Keyboard shortcuts

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