newton-regorus 0.2.0

A fast, lightweight Rego (OPA policy language) interpreter with Newton extensions
Documentation
// Copyright (c) Microsoft Corporation.
// Licensed under the MIT License.

use crate::{
    ast::{Expr, Ref},
    builtins,
    builtins::utils::ensure_args_count,
};

use crate::{lexer::Span, value::Value};

use anyhow::Result;

pub fn register(m: &mut builtins::BuiltinsMap<&'static str, builtins::BuiltinFcn>) {
    m.insert("http.send", (send, 1));
}

fn send(span: &Span, params: &[Ref<Expr>], args: &[Value], _strict: bool) -> Result<Value> {
    let name = "http.send";
    ensure_args_count(span, name, params, args, 1)?;
    Ok(Value::Undefined)
}