sync

package
v0.41.0 Latest Latest
Warning

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

Go to latest
Published: Jul 15, 2025 License: MIT Imports: 11 Imported by: 0

README

sync

Client implementation in go for the Freym service sync.

Docs

Please have a look at our documentation.

License

This project is licensed under the MIT License. See the LICENSE file for details.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

type Client[T peer.ServiceClient] interface {
	GetOwnAddress() string
	IteratePeers(ctx context.Context, handler peer.ConnectionHandlerFn[T]) error
	Lock(tenantId string, resource ...string) error
	Unlock(tenantId string, resource ...string)
	RLock(tenantId string, resource ...string) error
	RUnlock(tenantId string, resource ...string)
	GetPeerPool() peer.PeerPool[T]
	Close() error
}

func NewClient

func NewClient[T peer.ServiceClient](
	logger golog.Logger,
	conf *config.Config,
	createServiceClient peer.CreateServiceClientFn[T],
) (Client[T], error)

type MockClient

type MockClient[T peer.ServiceClient] struct {
	mock.Mock
}

func (*MockClient[T]) Close added in v0.38.0

func (c *MockClient[T]) Close() error

func (*MockClient[T]) GetOwnAddress

func (c *MockClient[T]) GetOwnAddress() string

func (*MockClient[T]) GetPeerPool

func (c *MockClient[T]) GetPeerPool() peer.PeerPool[T]

func (*MockClient[T]) IsReady

func (c *MockClient[T]) IsReady() bool

func (*MockClient[T]) IteratePeers

func (c *MockClient[T]) IteratePeers(ctx context.Context, handler peer.ConnectionHandlerFn[T]) error

func (*MockClient[T]) Lock

func (c *MockClient[T]) Lock(tenantId string, resource ...string) error

func (*MockClient[T]) RLock added in v0.32.0

func (c *MockClient[T]) RLock(tenantId string, resource ...string) error

func (*MockClient[T]) RUnlock added in v0.32.0

func (c *MockClient[T]) RUnlock(tenantId string, resource ...string)

func (*MockClient[T]) Unlock

func (c *MockClient[T]) Unlock(tenantId string, resource ...string)

type ParallelPublisher

type ParallelPublisher[T peer.ServiceClient, RequestData any] struct {
	publisher.Publisher[T, RequestData]
	// contains filtered or unexported fields
}

func NewParallelPublisher

func NewParallelPublisher[T peer.ServiceClient, RequestData any](
	logger golog.Logger,
	peerPool peer.PeerPool[T],
	sendFn publisher.SendFn[T, RequestData],
) ParallelPublisher[T, RequestData]

func (*ParallelPublisher[T, RequestData]) Send

func (p *ParallelPublisher[T, RequestData]) Send(
	ctx context.Context,
	data RequestData,
	filter publisher.AddressFilter,
	callback publisher.SendCallback,
) error

Directories

Path Synopsis
internal

Jump to

Keyboard shortcuts

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