distribute/node_builder
Types
Node configuration builder
pub type NodeBuilder {
NodeBuilder(
name: option.Option(String),
cookie: option.Option(String),
peers: List(String),
auto_register_services: Bool,
)
}
Constructors
-
NodeBuilder( name: option.Option(String), cookie: option.Option(String), peers: List(String), auto_register_services: Bool, )
Result of node startup operations
pub type NodeResult {
NodeResult(
node_started: Bool,
connections: List(String),
registered_services: List(String),
errors: List(String),
)
}
Constructors
-
NodeResult( node_started: Bool, connections: List(String), registered_services: List(String), errors: List(String), )
Values
pub fn connect_to(
builder: NodeBuilder,
peers: List(String),
) -> NodeBuilder
Add peers to connect to
pub fn start(
builder: NodeBuilder,
) -> Result(NodeResult, cluster.StartError)
Start the node with the configured settings
pub fn with_auto_register(builder: NodeBuilder) -> NodeBuilder
Enable auto-registration of common services
pub fn with_cookie(
builder: NodeBuilder,
cookie: String,
) -> NodeBuilder
Set the cookie
pub fn with_name(
builder: NodeBuilder,
name: String,
) -> NodeBuilder
Set the node name