monotone

package module
v0.11.2 Latest Latest
Warning

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

Go to latest
Published: Jan 10, 2026 License: MIT Imports: 13 Imported by: 0

README

Monotone Client for Go

Monotone Client is wrapper native Monotone API using the awesome purego library to call C.

Installing

go get -u github.com/oskoi/monotone-go

Run Examples

  • basic -- basic API usage.

clone repo and run container:

$ git clone https://github.com/oskoi/amelie-go && cd amelie-go
$ docker run --platform linux/amd64 -it -v ./:/home ubuntu:25.04

and run example in container:

$ apt-get update && apt-get install -y git golang libcurl4-openssl-dev
$ cd /home && go run examples/basic/main.go

Documentation

Index

Constants

This section is empty.

Variables

View Source
var ErrClosed = errors.New("closed")

Functions

This section is empty.

Types

type Cursor

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

func (*Cursor) Key

func (c *Cursor) Key() *Event

func (*Cursor) Read

func (c *Cursor) Read(n int) (events []*Event, err error)

func (*Cursor) Stream added in v0.1.1

func (c *Cursor) Stream() (iter.Seq[*Event], func() error)

type Event

type Event struct {
	Id    uint64 `json:"id,omitempty"`
	Key   []byte `json:"key,omitempty"`
	Value []byte `json:"value,omitempty"`
}

func (*Event) Equal added in v0.1.1

func (a *Event) Equal(b *Event) bool

func (*Event) String added in v0.1.1

func (e *Event) String() string

type Monotone

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

func New

func New() *Monotone

func (*Monotone) Close

func (m *Monotone) Close()

func (*Monotone) Cursor

func (m *Monotone) Cursor(key *Event, exclusive bool) (*Cursor, error)

func (*Monotone) Delete

func (m *Monotone) Delete(batch []*Event) error

func (*Monotone) Error

func (m *Monotone) Error() error

func (*Monotone) Execute

func (m *Monotone) Execute(command string) ([]byte, error)

func (*Monotone) Open

func (m *Monotone) Open(s string) error

func (*Monotone) Read added in v0.1.1

func (m *Monotone) Read(key *Event, n int) ([]*Event, error)

func (*Monotone) Write

func (m *Monotone) Write(batch []*Event) error

Directories

Path Synopsis
examples
basic command

Jump to

Keyboard shortcuts

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