/evergreen-universe-rs

Evergreen Universe Rust

Primary LanguageRustMIT LicenseMIT

Evergreen Universe / Rust

Rust bindings, libs, and binaries for Evergreen and related projects.

Included Packages

MPTC

General purpose threaded server, similar to Perl Net::Server.

Evergreen

Evergreen + OpenSRF bindings with OpenSRF server, nascent services, and other binaries.

README

MARCTK

Library for reading/writing MARC Binary, MARC XML, and MARC Breaker.

README

SIP2

SIP2 client library

README

SIP2-Mediator

SIP2 Mediator

README

Evergreen Rust Primer

Currently assumes Ubuntu 22.04.

Setup

Actions that communicate via OpenSRF require OpenSRF/Evergreen Redis.

Install OpenSRF / Evergreen with Redis

Ansible Version

Follow these ansible instructions to install on a server/VM.

Docker Version

Follow these instructions to create a Docker container.

Setup Rust

sudo apt install git build-essential pkg-config libssl-dev rust-all 
git clone https://github.com/kcls/evergreen-universe-rs                              

Build Everything and Run Tests

Makefile Note

Build and install commands are compiled into a Makefile for convenience and documentation. See the Makefile for individual cargo commands.

Build and Test

cd evergreen-universe-rs

# This will also download and compile dependencies.
make build

# Run unit tests
make test

# To also run the live tests.
# These require a locally running Evergreen instance with
# Concerto data.
cargo test --package evergreen --test live -- --ignored --nocapture

# OPTIONAL: Install compiled binaries to /usr/local/bin/
sudo make install-bin

# OPTIONAL: Install compiled binaries and systemd service files.
sudo make install

Example: Running egsh ("eggshell")

egsh is an Evergreen-aware srfsh clone

cargo run --package evergreen --bin egsh

NOTE: If binaries are installed, the above command may be shortened to just egsh (or /usr/local/bin/egsh).

Some Commands

egsh# help

egsh# login admin demo123

# This uses the authtoken stored from last successful use of 'login'
# as the implicit first parameter to the pcrud API call.
egsh# reqauth open-ils.pcrud open-ils.pcrud.retrieve.au 1

egsh# req opensrf.settings opensrf.system.echo {"a b c":123} "12" [1,2,3]

egsh# cstore retrieve actor::user 1

egsh# cstore search aou {"shortname":"BR1"}