mod metrics;
pub mod context;
pub mod logging;
pub mod proto;
pub mod request;
pub mod resource;
pub mod response;
pub mod server;
pub use server::{Args, Server, serve};
#[derive(Debug, thiserror::Error)]
pub enum Error {
#[error("JSON conversion failed: {0}")]
Json(#[from] serde_json::Error),
#[error("source must serialize to a JSON object")]
NotAnObject,
#[error("the request has no function input")]
MissingInput,
#[error("the resource has no JSON representation")]
MissingResource,
#[error("cannot parse listen address: {0}")]
InvalidAddress(#[from] std::net::AddrParseError),
#[error("no credentials were provided - supply --tls-certs-dir or use --insecure")]
MissingTlsCertsDir,
#[error("cannot read TLS certificate or key from {path}: {source}")]
ReadCertificate {
path: std::path::PathBuf,
source: std::io::Error,
},
#[error("gRPC server error: {0}")]
Transport(#[from] tonic::transport::Error),
#[error("cannot build gRPC reflection service: {0}")]
Reflection(#[from] tonic_reflection::server::Error),
#[error("the function did not become ready: {0}")]
NotReady(Box<dyn std::error::Error + Send + Sync>),
}