aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMelody Horn / boringcactus <melody@boringcactus.com>2021-06-12 21:06:06 -0600
committerMelody Horn / boringcactus <melody@boringcactus.com>2021-06-12 21:06:06 -0600
commit582124d59afa438e2cb88cc024d6b19232236e1e (patch)
tree6b1bc48d5e3a405434f4900c7e20daf0d186de5a /src
parentfcc13328ff82326d25e39504732701b27f894e22 (diff)
downloadtosin-582124d59afa438e2cb88cc024d6b19232236e1e.tar.gz
tosin-582124d59afa438e2cb88cc024d6b19232236e1e.zip
stub out basic implementation
Diffstat (limited to 'src')
-rw-r--r--src/contrib/admin/mod.rs1
-rw-r--r--src/contrib/admin/site/mod.rs1
-rw-r--r--src/contrib/admin/site/urls.rs3
-rw-r--r--src/contrib/mod.rs1
-rw-r--r--src/http/mod.rs3
-rw-r--r--src/lib.rs12
-rw-r--r--src/urls/mod.rs16
7 files changed, 31 insertions, 6 deletions
diff --git a/src/contrib/admin/mod.rs b/src/contrib/admin/mod.rs
new file mode 100644
index 0000000..4d481aa
--- /dev/null
+++ b/src/contrib/admin/mod.rs
@@ -0,0 +1 @@
+pub mod site;
diff --git a/src/contrib/admin/site/mod.rs b/src/contrib/admin/site/mod.rs
new file mode 100644
index 0000000..c8faf42
--- /dev/null
+++ b/src/contrib/admin/site/mod.rs
@@ -0,0 +1 @@
+pub mod urls;
diff --git a/src/contrib/admin/site/urls.rs b/src/contrib/admin/site/urls.rs
new file mode 100644
index 0000000..5e81c4e
--- /dev/null
+++ b/src/contrib/admin/site/urls.rs
@@ -0,0 +1,3 @@
+use crate::urls::Path;
+
+pub const URL_PATTERNS: &[Path] = &[];
diff --git a/src/contrib/mod.rs b/src/contrib/mod.rs
new file mode 100644
index 0000000..92918b0
--- /dev/null
+++ b/src/contrib/mod.rs
@@ -0,0 +1 @@
+pub mod admin;
diff --git a/src/http/mod.rs b/src/http/mod.rs
new file mode 100644
index 0000000..69a0706
--- /dev/null
+++ b/src/http/mod.rs
@@ -0,0 +1,3 @@
+pub struct Request {}
+
+pub struct Response(pub &'static str);
diff --git a/src/lib.rs b/src/lib.rs
index 31e1bb2..28e6ab9 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -1,7 +1,7 @@
-#[cfg(test)]
-mod tests {
- #[test]
- fn it_works() {
- assert_eq!(2 + 2, 4);
- }
+pub mod contrib;
+pub mod http;
+pub mod urls;
+
+pub fn run_server(url_patterns: &[urls::Path]) {
+ todo!();
}
diff --git a/src/urls/mod.rs b/src/urls/mod.rs
new file mode 100644
index 0000000..1acf186
--- /dev/null
+++ b/src/urls/mod.rs
@@ -0,0 +1,16 @@
+use crate::http::{Request, Response};
+
+pub type View = fn(Request) -> Response;
+
+pub enum Path {
+ View {
+ url: &'static str,
+ view: View,
+ name: &'static str,
+ },
+
+ Include {
+ url: &'static str,
+ content: &'static [Path],
+ },
+}