GithubHelp home page GithubHelp logo

oxide.rs's Introduction

Oxide SDK and CLI

This repo contains two published crates: the Oxide Rust SDK and the Oxide CLI. The SDK and CLI are derived from the Oxide API OpenAPI spec and provide interfaces for interacting with the Oxide Rack.

Generation

Both the SDK and CLI rely on progenitor for code generation from the OpenAPI description of the Oxide API. Typically progenitor is used via a macro or build.rs, here we use an 'xtask`. Not only is the source OpenAPI document checked in, we also check-in the generated code 1. so that changes in generated output (in addition to input) may be easily tracked and 2. so that navigating from rustdoc to source shows the full code rather than, say, an opaque macro invocation (that yields literally tens of thousands of lines of code).

The Oxide OpenAPI description is in oxide.json. To re-generate the CLI and SDK from an updated API document, run cargo xtask generate. CI ensures that the API description and generated code are in sync.

Note
generation requires that a nightly version of rustfmt is installed.

Hand-written code

While both the SDK and CLI are mostly generated, both include some hand- written code as well.

The SDK includes hand-written code to simplify the use of some aspects of the API and to support the CLI. For example, it includes a clap-related impl block so that the ByteCount type can be specified with a binary suffix (e.g. 64gb).

The CLI includes hand-written code for some of the blocking and tackling. It also has hand-written code to add additional subcommands (e.g. auth) and to augment commands that cannot be fully or optimally generated.

oxide.rs's People

Contributors

ahl avatar augustuswm avatar benjaminleonard avatar david-crespo avatar dependabot[bot] avatar github-actions[bot] avatar iliana avatar jmpesp avatar karencfv avatar lifning avatar luqmana avatar oxide-reflector-bot[bot] avatar rcgoodfellow avatar zephraph avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.