cli

package
v0.7.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2026 License: Apache-2.0 Imports: 19 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Etherpad client

This is the Etherpad client known in the original Etherpad as Etherpad cli client. The arguments changed so please run ./etherpad-go cli --help to see the available options.

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func RunFromCLI

func RunFromCLI(logger *zap.SugaredLogger, args []string)

Types

type Pad

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

func Connect

func Connect(host string, logger *zap.SugaredLogger) *Pad

func NewPad

func NewPad(host, padId string, conn *websocket.Conn, logger *zap.SugaredLogger) *Pad

func (*Pad) Append

func (p *Pad) Append(text string)

func (*Pad) Close

func (p *Pad) Close()

func (*Pad) EnableReconnect added in v0.7.0

func (p *Pad) EnableReconnect(hosts []string)

EnableReconnect makes the pad reconnect when its connection breaks, trying hosts in turn (as a load balancer would pick another instance). Unacknowledged changes are kept and sent again after the reconnect, unless the server reports them as stored.

func (*Pad) On

func (p *Pad) On(event string, handler func(interface{}))

func (*Pad) OnAcceptCommit

func (p *Pad) OnAcceptCommit(callback func(rev int))

func (*Pad) OnConnected

func (p *Pad) OnConnected(callback func(padState *Pad))

OnConnected calls callback once the pad's initial state arrived, also if that happened before OnConnected was called.

func (*Pad) OnDisconnect

func (p *Pad) OnDisconnect(callback func(err interface{}))

func (*Pad) OnMessage

func (p *Pad) OnMessage(callback func(msg map[string]interface{}))

func (*Pad) OnNewContents

func (p *Pad) OnNewContents(callback func(atext apool.AText))

func (*Pad) OnNumConnectedUsers

func (p *Pad) OnNumConnectedUsers(callback func(count int))

func (*Pad) Ready added in v0.7.0

func (p *Pad) Ready() <-chan struct{}

Ready is closed once the pad's initial state arrived. Unlike the "connected" event it cannot be missed by subscribing late.

type PadChangeset

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

type PadState

type PadState struct {
	Host  string
	Path  string
	PadId string
}

Jump to

Keyboard shortcuts

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