client

package
v0.0.0-...-71befac Latest Latest
Warning

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

Go to latest
Published: Mar 1, 2024 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	ErrClientNotAvailable = fmt.Errorf("could not dial Client")
	ErrClientInjector     = fmt.Errorf("client could not create injector")
)

Functions

This section is empty.

Types

type Client

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

func New

func New(ctx context.Context, wg *sync.WaitGroup, data any, peer net.TCPAddr, errs chan *slog.Record, settings *settings.Settings) (*Client, error)

New creates a new client that connects to the given peer. The given data is used to synchronize the local state with the remote one. The given errors channel is used to send log records. The given settings are used to control the behavior of the client.

func (*Client) AddExtHandler

func (c *Client) AddExtHandler(ext func() error)

func (*Client) AddInjHandler

func (c *Client) AddInjHandler(inj func() error)

func (*Client) Changes

func (c *Client) Changes()

func (*Client) Init

func (c *Client) Init()

Init requests to init data from the server.

func (*Client) PushPull

func (c *Client) PushPull()

func (*Client) Running

func (c *Client) Running() bool

func (*Client) ShutdownRemoteServer

func (c *Client) ShutdownRemoteServer()

ShutdownRemoteServer requests to shut down the server.

Jump to

Keyboard shortcuts

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