Skip to content

EpicGames/lore-go

Lore Go SDK

About

This repository contains the Go SDK for integrating with Lore.

Lore is an open source version control system that is designed for unprecedented scalability of both data and teams. It is optimized for projects that combine code with large binary assets, including games and entertainment, and caters to the needs of developers and artists alike.

For full Lore documentation, architecture details, and contribution guidelines, visit the main Lore repository.

Install

Stable Release

go get github.com/EpicGames/lore-go@latest

Install the Lore native library

The Go SDK binds against the Lore C library (liblore.so / liblore.dylib / lore.dll). Run fetch-lore-lib once per build to install the matching version next to your application binary:

go run github.com/EpicGames/lore-go/cmd/fetch-lore-lib
  • -o <output_dir> — destination directory (defaults to the current directory)
  • -os <target_os> and -arch <target_arch> — fetch the library for a different platform (e.g. -os linux -arch amd64 for cross-compilation)

To automate this, add a directive to your main.go so go generate ./... installs the library:

//go:generate go run github.com/EpicGames/lore-go/cmd/fetch-lore-lib

Source priority for fetch-lore-lib:

  1. LORE_LIB_PATH — if set, the file at that path is copied. This env var is also honored by the SDK at runtime (point it at a .so / .dylib / .dll file and both fetch-time and runtime use it).
  2. Otherwise the library is downloaded from LORE_RELEASE_BASE_URL, falling back to the URL baked into the SDK at build time (see Generate the Go bindings). The URL is constructed as <base>/<versionTag>/<artifactName>.

At runtime the SDK also searches next to the compiled executable, so a go generate-installed library is found automatically.

Minimal example

The default package (github.com/EpicGames/lore-go) exposes the high-level fluent API. A low-level, C-like wrapper around the underlying FFI is also available under github.com/EpicGames/lore-go/native for advanced use cases.

import (
    "fmt"

    "github.com/EpicGames/lore-go"
    "github.com/EpicGames/lore-go/types"
)

lore.LogConfigure(&types.LoreLogConfigFFI{
    File:     true,
    FilePath: "/path/to/log/directory",
    Level:    types.LoreLogLevel_DEBUG,
})

globals := types.LoreGlobalArgsFFI{
    RepositoryPath: "/path/to/local/repository",
}
args := types.LoreRepositoryStatusArgsFFI{
    Staged: true,
    Scan:   true,
}
_, err := lore.RepositoryStatus(&globals, &args).
    Callback(func(event types.LoreEvent) {
        if event.Tag == types.LoreEventTag_REPOSITORY_STATUS_FILE {
            fmt.Println(event.Data)
        }
    }).
    Wait()

For comprehensive examples, see examples/fluent/fluent.go (fluent) and examples/native/native.go (low-level).

Contributing

Set up your dev environment

  1. Clone the Lore Go SDK repository:
git clone https://github.com/EpicGames/lore-go
  1. (Optional) Create a Python virtual environment for the binding generator:
uv venv .venv
source .venv/bin/activate
  1. Install the Python modules used by the binding generator:
uv pip install jinja2 pycparser

Get the Lore library

The SDK binds against the Lore C library. Pick one of the two options below depending on whether you're also modifying the Lore core.

Option A — build the library from Lore source

Use this when you're changing the Lore C/Rust core alongside the Go SDK.

  1. Clone Lore's repository and build it:
cargo build --release

Option B — fetch a pre-built Lore library

Use this when you only need to develop the Go SDK against an existing Lore version.

  1. Download the header and binaries from the Lore repository release page.

Generate the Go bindings

  1. Point LORE_BUILD_PATH at the library directory from the previous section:
export LORE_BUILD_PATH="<path-to>/lore/"
  1. (Optional) Set LORE_RELEASE_BASE_URL and LORE_VERSION to bake a default download base URL into cmd/fetch-lore-lib/version.go. End users of the published SDK will use this URL when running fetch-lore-lib without overriding it themselves. If unset, generation falls back to the public Lore release URL.
export LORE_RELEASE_BASE_URL="https://github.com/EpicGames/lore/releases/download"
export LORE_VERSION="0.8.2"
  1. Generate the bindings and build the SDK:
uv run python find_lorelib.py
uv run python generator/generate.py
go build -C lore_go
  1. Any edits you now make under lore_go/ are picked up by re-running go build. If you change anything under generator/templates/ or pull a new Lore pre-built binary, re-run step 3 to regenerate the bindings.

Run the examples

With the dev environment set up, a Lore library available, and the Go bindings generated, run an example from the repository root:

export LORE_LIB_PATH="lore/lib/lorelib-arm64-apple-darwin.dylib"
go generate -C examples ./...
go build -C examples -o fluent ./fluent
examples/fluent/fluent

To run the low-level native example instead, swap fluent for native.

Run the test suite

go test -C lore_go ./... -v

About

Go SDK for Lore, a next-generation, open source revision control system

Topics

Resources

License

Code of conduct

Contributing

Security policy

Stars

Watchers

Forks

Packages

 
 
 

Contributors