kcls / evergreen-universe-rs

Evergreen Universe Rust
MIT License
8 stars 4 forks source link

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

MARC

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 the OpenSRF/Evergreen Redis branches be installed and running.

Other actions, e.g. eg-marc-export, which communicate via database connection do not require special OpenSRF/Evergreen code.

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

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.

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"}