refactor: new directory structure where the flake module lives in a directory with the template in a subdirectory
This commit is contained in:
@@ -0,0 +1,27 @@
|
||||
use either::{Either, Either::Left};
|
||||
use serde::Deserialize;
|
||||
|
||||
#[derive(Deserialize, Clone, Debug)]
|
||||
pub struct CommandConfig {
|
||||
/// The port(s) to listen on.
|
||||
///
|
||||
/// If you are using Docker, don't change this, you'll need to map an
|
||||
/// external port to this.
|
||||
///
|
||||
/// To listen on multiple ports, specify a vector e.g. [8080, 8448]
|
||||
///
|
||||
/// default: 8008
|
||||
#[serde(default = "default_port")]
|
||||
pub port: ListeningPort,
|
||||
}
|
||||
|
||||
#[derive(Deserialize, Clone, Debug)]
|
||||
#[serde(transparent)]
|
||||
pub struct ListeningPort {
|
||||
#[serde(with = "either::serde_untagged")]
|
||||
pub ports: Either<u16, Vec<u16>>,
|
||||
}
|
||||
|
||||
fn default_port() -> ListeningPort {
|
||||
ListeningPort { ports: Left(8008) }
|
||||
}
|
||||
Reference in New Issue
Block a user