libsoratun

command module
v0.0.0-...-fc9d9e6 Latest Latest
Warning

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

Go to latest
Published: Dec 14, 2023 License: MIT Imports: 4 Imported by: 0

README

libsoratun

The C library allows you to embed Soracom Arc connectivity into your own program. You can send a message to the unified endpoint, with Soracom Arc, entirely from userspace (no root privilege is required).

Tested Setup

  • Go 1.21.5 darwin/arm64
  • macOS Sonoma 14.1.2

Prerequisites

  1. You have to have a virtual SIM, along with arc.json which is a configuration file for soratun locally. See documentation for detail.
  2. You have to enable the unified endpoint for your SIM group. See documentation for detail.

Build

$ git clone https://github.com/soracom/libsoratun
$ cd libsoratun
$ make libs

Run Examples

Python

Tested with Python 3.12.0.

$ cd examples/python
$ python3 main.py /path/to/arc.json '{"message": "hey"}'
Node.js

Tested with Node.js v18.19.0.

$ cd examples/nodejs
$ npm install
$ node src/index.js /path/to/arc.json '{"message": "hey"}'
Rust

Tested with Rust 1.74.1. In order to build Rust bindings, you have to install bindgen-cli and its prerequisites.

$ make bindings
$ cd examples/rust
$ cargo run -- --config /path/to/arc.json '{"message": "hey"}'
AWS Lambda

Tested with AWS Lambda Python 3.11 runtime.

  1. Build a shared library on target platform. Tested on arm64.

    $ make libs
    
  2. Place examples/lamdada/lambda_function.py, lib/shared/libsoratun.so, and your arc.json in a same directory.

  3. Zip it up and upload it to AWS Lambda function.

    $ zip -r lambda.zip lambda_function.py libsoratun.so arc.json
    

License

MIT. See LICENSE for detail.

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

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