Module embryo

embryo - Library for managing Emergence configuration and embryo objects.

Copyright © 2025 YourCompany

Version: 0.1.0

Authors: YourName.

Description

embryo - Library for managing Emergence configuration and embryo objects

This module provides functions for: - Creating and manipulating embryo objects - Reading Emergence configuration files - Retrieving discovery service URLs - Merging lists of embryos

Data Types

config_map()

config_map() = map()

embryo()

embryo() = #embryo{}

properties()

properties() = map()

Function Index

get_em_disco_url/0Gets the Emergence discovery service URL.
merge_lists_by_url/2Merges two lists of embryos, removing duplicates based on URL.
new/1Creates a new embryo object with the given properties.
read_emergence_conf/0Reads the Emergence configuration file.
to_map/1Converts an embryo record to a map representation.

Function Details

get_em_disco_url/0

get_em_disco_url() -> string()

returns: The discovery service URL as a string

Gets the Emergence discovery service URL.

Tries to get the URL from: 1. Environment variable "server_url" 2. "em_disco/server_url" in the configuration file 3. Falls back to "http://localhost:8080" if not found

merge_lists_by_url/2

merge_lists_by_url(UriList::[embryo()], OtherList::[embryo()]) -> [embryo()]

UriList: First list of embryo records
OtherList: Second list of embryo records

returns: A merged list with duplicates removed

Merges two lists of embryos, removing duplicates based on URL.

new/1

new(Properties::properties()) -> embryo()

Properties: A map of properties for the embryo

returns: A new embryo record

Creates a new embryo object with the given properties.

read_emergence_conf/0

read_emergence_conf() -> config_map() | undefined

returns: Configuration map or 'undefined' if the file doesn't exist

Reads the Emergence configuration file.

Looks for emergence.conf in platform-specific locations: - Unix: ~/.config/emergence/emergence.conf - Windows: %APPDATA%\emergence\emergence.conf or %HOME%\AppData\Roaming\emergence\emergence.conf

to_map/1

to_map(Embryo::embryo()) -> map()

Embryo: The embryo record to convert

returns: A map representation of the embryo

Converts an embryo record to a map representation.


Generated by EDoc