acedoc

package module
v0.0.0-...-96da279 Latest Latest
Warning

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

Go to latest
Published: Sep 28, 2017 License: MPL-2.0 Imports: 8 Imported by: 1

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Client

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

func (*Client) Close

func (c *Client) Close()

Close closes the client

func (*Client) Error

func (c *Client) Error() error

Error returns any pending errors from pushing deltas to the client.

func (*Client) PushDeltas

func (c *Client) PushDeltas(d ...Delta) error

PushDeltas pushes deltas into the document.

type Delta

type Delta struct {
	Action DeltaAction `json:"action"`
	Lines  []string    `json:"lines"`
	Start  Position    `json:"start"`
	End    Position    `json:"end"`
	// contains filtered or unexported fields
}

func Insert

func Insert(row, col uint, str string) Delta

func Remove

func Remove(row, col uint, str string) Delta

func (Delta) Equal

func (d Delta) Equal(other Delta) bool

func (Delta) String

func (d Delta) String() string

type DeltaAction

type DeltaAction bool
const (
	DeltaInsert DeltaAction = true
	DeltaRemove DeltaAction = false
)

func (DeltaAction) MarshalJSON

func (d DeltaAction) MarshalJSON() ([]byte, error)

func (DeltaAction) String

func (d DeltaAction) String() string

func (*DeltaAction) UnmarshalJSON

func (d *DeltaAction) UnmarshalJSON(b []byte) error

type DeltaHandler

type DeltaHandler interface {
	Handle([]Delta) error
}

type DeltaHandlerFunc

type DeltaHandlerFunc func([]Delta) error

func (DeltaHandlerFunc) Handle

func (fn DeltaHandlerFunc) Handle(d []Delta) error

type Document

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

func NewString

func NewString(str string) *Document

func (*Document) Apply

func (d *Document) Apply(dls ...Delta) error

func (*Document) Client

func (d *Document) Client(h DeltaHandler) *Client

func (*Document) Close

func (d *Document) Close()

func (*Document) Contents

func (d *Document) Contents() string

func (*Document) InDocument

func (d *Document) InDocument(pos Position) bool

func (*Document) LogToFile

func (d *Document) LogToFile(filename string) error

type Position

type Position struct {
	Row    uint `json:"row"`
	Column uint `json:"column"`
}

Jump to

Keyboard shortcuts

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