pub struct ElixirGenerator;Expand description
Elixir microservice code generator
Implementations§
Source§impl ElixirGenerator
impl ElixirGenerator
Sourcepub fn generate_module(spec: &ServiceSpec) -> Result<String, String>
pub fn generate_module(spec: &ServiceSpec) -> Result<String, String>
Generate a GenServer module from a service specification
Creates a module with use GenServer, requires Logger, and callback stubs including start_link, init, handle_call, and handle_cast.
Sourcepub fn generate_supervision_tree(
services: &[ServiceSpec],
) -> Result<String, String>
pub fn generate_supervision_tree( services: &[ServiceSpec], ) -> Result<String, String>
Generate a supervision tree for a list of services
Creates a Supervisor module with children list and one_for_one strategy. Each service module is configured with restart: :permanent.
Sourcepub fn generate_config(
module_prefix: &str,
config_spec: &Option<String>,
) -> Result<String, String>
pub fn generate_config( module_prefix: &str, config_spec: &Option<String>, ) -> Result<String, String>
Generate a config.exs configuration file
Creates configuration blocks for the application with import of runtime.exs.
Sourcepub fn generate_tests(module_name: &str) -> Result<String, String>
pub fn generate_tests(module_name: &str) -> Result<String, String>
Generate a test file scaffold for a module
Creates an ExUnit test module with test “service starts” assertion.
Sourcepub fn generate_supervision_test() -> Result<String, String>
pub fn generate_supervision_test() -> Result<String, String>
Generate a supervision tree test
Auto Trait Implementations§
impl Freeze for ElixirGenerator
impl RefUnwindSafe for ElixirGenerator
impl Send for ElixirGenerator
impl Sync for ElixirGenerator
impl Unpin for ElixirGenerator
impl UnsafeUnpin for ElixirGenerator
impl UnwindSafe for ElixirGenerator
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> EvidenceKind for T
impl<T> EvidenceKind for T
default fn kind_label(&self) -> &'static str
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more