From cc3d3562094bce971927088b652ff767ceb92560 Mon Sep 17 00:00:00 2001 From: Rob Ede Date: Fri, 18 Feb 2022 02:01:48 +0000 Subject: [PATCH] restructure folders --- Cargo.lock | 1 + Cargo.toml | 68 +++++++++--------- {security => auth}/casbin/Cargo.toml | 0 {security => auth}/casbin/README.md | 0 .../casbin/rbac/rbac_model.conf | 0 .../casbin/rbac/rbac_policy.csv | 0 {security => auth}/casbin/src/main.rs | 0 {session => auth}/cookie-auth/Cargo.toml | 0 {session => auth}/cookie-auth/README.md | 0 {session => auth}/cookie-auth/src/main.rs | 0 {session => auth}/cookie-session/Cargo.toml | 0 {session => auth}/cookie-session/README.md | 0 {session => auth}/cookie-session/src/main.rs | 0 {session => auth}/redis-session/Cargo.toml | 0 {session => auth}/redis-session/README.md | 0 {session => auth}/redis-session/src/main.rs | 0 .../simple-auth-server/Cargo.toml | 1 - .../simple-auth-server/README.md | 0 .../simple-auth-server/diesel.toml | 0 .../simple-auth-server/migrations/.gitkeep | 0 .../down.sql | 0 .../up.sql | 0 .../2018-10-09-101948_users/down.sql | 0 .../migrations/2018-10-09-101948_users/up.sql | 0 .../2018-10-16-095633_invitations/down.sql | 0 .../2018-10-16-095633_invitations/up.sql | 0 .../simple-auth-server/src/auth_handler.rs | 0 .../simple-auth-server/src/email_service.rs | 0 .../simple-auth-server/src/errors.rs | 0 .../src/invitation_handler.rs | 0 .../simple-auth-server/src/main.rs | 0 .../simple-auth-server/src/models.rs | 0 .../src/register_handler.rs | 0 .../simple-auth-server/src/schema.rs | 0 .../simple-auth-server/src/utils.rs | 0 .../simple-auth-server/static/index.html | 0 .../simple-auth-server/static/main.css | 0 .../simple-auth-server/static/main.js | 0 .../simple-auth-server/static/register.html | 0 basics/static_index/.gitattributes | 2 - basics/static_index/Cargo.toml | 3 +- basics/static_index/src/main.rs | 11 +-- {security/web-cors => cors}/README.md | 0 .../web-cors => cors}/backend/Cargo.toml | 0 .../web-cors => cors}/backend/src/main.rs | 0 .../web-cors => cors}/backend/src/user.rs | 0 .../web-cors => cors}/frontend/.gitignore | 0 .../web-cors => cors}/frontend/index.html | 0 .../web-cors => cors}/frontend/package.json | 0 .../web-cors => cors}/frontend/src/app.vue | 0 .../web-cors => cors}/frontend/src/main.js | 0 .../data_factory => data_factory}/Cargo.toml | 0 .../data_factory => data_factory}/README.md | 0 .../data_factory => data_factory}/src/main.rs | 0 database_interactions/diesel/.env | 1 - database_interactions/rbatis/README.md | 5 -- .../diesel/.gitignore | 0 .../diesel/Cargo.toml | 0 .../diesel/README.md | 0 .../20170124012402_create_users/down.sql | 0 .../20170124012402_create_users/up.sql | 0 .../diesel/src/actions.rs | 0 .../diesel/src/main.rs | 0 .../diesel/src/models.rs | 0 .../diesel/src/schema.rs | 0 .../mongodb/Cargo.toml | 0 .../mongodb/README.md | 0 .../mongodb/src/main.rs | 0 .../mongodb/src/model.rs | 0 .../mongodb/src/test.rs | 0 .../pg => databases/postgres}/.gitignore | 0 .../pg => databases/postgres}/Cargo.toml | 0 .../pg => databases/postgres}/README.md | 0 .../postgres}/sql/add_user.sql | 0 .../postgres}/sql/get_users.sql | 0 .../pg => databases/postgres}/sql/schema.sql | 0 .../pg => databases/postgres}/src/main.rs | 0 databases/rbatis/README.md | 5 ++ .../redis/Cargo.toml | 0 .../redis/README.md | 0 .../redis/src/main.rs | 0 .../basic => databases/sqlite}/.gitignore | 0 .../basic => databases/sqlite}/Cargo.toml | 0 .../basic => databases/sqlite}/README.md | 0 .../sqlite}/db/GHCND_documentation.pdf | Bin .../basic => databases/sqlite}/db/README.md | 0 .../basic => databases/sqlite}/db/db.sql | 0 .../sqlite}/db/nyc_centralpark_weather.csv | 0 .../basic => databases/sqlite}/db/setup_db.sh | 0 .../basic => databases/sqlite}/src/db.rs | 0 .../basic => databases/sqlite}/src/main.rs | 0 .../docker_sample => docker}/.dockerignore | 0 {basics/docker_sample => docker}/Cargo.toml | 0 {basics/docker_sample => docker}/Dockerfile | 0 {basics/docker_sample => docker}/README.MD | 0 {basics/docker_sample => docker}/src/main.rs | 0 {other/http-proxy => http-proxy}/Cargo.toml | 0 {other/http-proxy => http-proxy}/README.md | 0 {other/http-proxy => http-proxy}/src/main.rs | 0 {security => https-tls}/awc_https/Cargo.toml | 0 {security => https-tls}/awc_https/README.md | 0 {security => https-tls}/awc_https/src/main.rs | 0 .../openssl-auto-le/Cargo.toml | 0 .../openssl-auto-le/README.md | 0 .../openssl-auto-le/src/main.rs | 0 {security => https-tls}/openssl/Cargo.toml | 0 {security => https-tls}/openssl/README.md | 0 {security => https-tls}/openssl/cert.pem | 0 {security => https-tls}/openssl/key.pem | 0 {security => https-tls}/openssl/src/main.rs | 0 .../rustls-client-cert/Cargo.toml | 0 .../rustls-client-cert/README.md | 0 .../rustls-client-cert/certs/client-cert.pem | 0 .../rustls-client-cert/certs/client-key.pem | 0 .../rustls-client-cert/certs/rootCA-key.pem | 0 .../rustls-client-cert/certs/rootCA.pem | 0 .../rustls-client-cert/certs/server-cert.pem | 0 .../rustls-client-cert/certs/server-key.pem | 0 .../rustls-client-cert/src/main.rs | 0 {security => https-tls}/rustls/Cargo.toml | 0 {security => https-tls}/rustls/README.md | 0 {security => https-tls}/rustls/cert.pem | 0 {security => https-tls}/rustls/key.pem | 0 {security => https-tls}/rustls/src/main.rs | 0 .../middleware-ext-mut/Cargo.toml | 0 .../middleware-ext-mut/README.md | 0 .../middleware-ext-mut/src/add_msg.rs | 0 .../middleware-ext-mut/src/main.rs | 0 .../middleware-http-to-https/Cargo.toml | 0 .../middleware-http-to-https/README.md | 0 .../middleware-http-to-https/cert.pem | 0 .../middleware-http-to-https/key.pem | 0 .../middleware-http-to-https/src/main.rs | 0 {basics => middleware}/middleware/Cargo.toml | 0 {basics => middleware}/middleware/README.md | 0 {basics => middleware}/middleware/src/main.rs | 0 .../middleware/src/read_request_body.rs | 0 .../middleware/src/read_response_body.rs | 0 .../middleware/src/redirect.rs | 0 .../middleware/src/simple.rs | 0 {other/protobuf => protobuf}/.gitignore | 0 {other/protobuf => protobuf}/Cargo.toml | 0 {other/protobuf => protobuf}/README.md | 0 {other/protobuf => protobuf}/client.py | 0 {other/protobuf => protobuf}/src/main.rs | 0 {other/protobuf => protobuf}/test.proto | 0 {other/protobuf => protobuf}/test_pb2.py | 0 .../Cargo.toml | 0 .../src/main.rs | 4 ++ .../Cargo.toml | 0 .../README.md | 0 .../benchmark.js | 0 .../drain.js | 0 .../src/broadcast.rs | 0 .../src/index.html | 0 .../src/main.rs | 0 .../Cargo.toml | 0 .../README.md | 0 .../src/main.rs | 0 .../askama/Cargo.toml | 0 .../askama/src/main.rs | 0 .../askama/templates/index.html | 0 .../askama/templates/user.html | 0 .../handlebars/Cargo.toml | 0 .../handlebars/README.md | 0 .../handlebars/src/main.rs | 0 .../handlebars/static/templates/error.html | 0 .../handlebars/static/templates/index.html | 0 .../handlebars/static/templates/user.html | 0 .../sailfish/Cargo.toml | 0 .../sailfish/README.md | 0 .../sailfish/src/main.rs | 0 .../sailfish/templates/actix.stpl | 0 .../sailfish/templates/page.stpl | 0 .../tera/Cargo.toml | 0 .../tera/README.md | 0 .../tera/src/main.rs | 0 .../tera/templates/error.html | 0 .../tera/templates/index.html | 0 .../tera/templates/user.html | 0 .../tinytemplate/Cargo.toml | 0 .../tinytemplate/README.md | 0 .../tinytemplate/src/main.rs | 0 .../tinytemplate/templates/error.html | 0 .../tinytemplate/templates/index.html | 0 .../tinytemplate/templates/user.html | 0 .../yarte/Cargo.toml | 0 .../yarte/README.md | 0 .../yarte/build.rs | 0 .../yarte/src/main.rs | 0 .../yarte/templates/base.hbs | 0 .../yarte/templates/deep/more/card/form.hbs | 0 .../yarte/templates/deep/more/card/hi.hbs | 0 .../templates/deep/more/deep/welcome.hbs | 0 .../yarte/templates/deep/more/doc/head.hbs | 0 .../yarte/templates/deep/more/doc/t.hbs | 0 .../yarte/templates/index.hbs | 0 .../yarte/yarte.toml | 0 {other/unix-socket => unix-socket}/Cargo.toml | 0 {other/unix-socket => unix-socket}/README.md | 0 .../unix-socket => unix-socket}/src/main.rs | 0 201 files changed, 52 insertions(+), 49 deletions(-) rename {security => auth}/casbin/Cargo.toml (100%) rename {security => auth}/casbin/README.md (100%) rename {security => auth}/casbin/rbac/rbac_model.conf (100%) rename {security => auth}/casbin/rbac/rbac_policy.csv (100%) rename {security => auth}/casbin/src/main.rs (100%) rename {session => auth}/cookie-auth/Cargo.toml (100%) rename {session => auth}/cookie-auth/README.md (100%) rename {session => auth}/cookie-auth/src/main.rs (100%) rename {session => auth}/cookie-session/Cargo.toml (100%) rename {session => auth}/cookie-session/README.md (100%) rename {session => auth}/cookie-session/src/main.rs (100%) rename {session => auth}/redis-session/Cargo.toml (100%) rename {session => auth}/redis-session/README.md (100%) rename {session => auth}/redis-session/src/main.rs (100%) rename {database_interactions => auth}/simple-auth-server/Cargo.toml (96%) rename {database_interactions => auth}/simple-auth-server/README.md (100%) rename {database_interactions => auth}/simple-auth-server/diesel.toml (100%) rename {database_interactions => auth}/simple-auth-server/migrations/.gitkeep (100%) rename {database_interactions => auth}/simple-auth-server/migrations/00000000000000_diesel_initial_setup/down.sql (100%) rename {database_interactions => auth}/simple-auth-server/migrations/00000000000000_diesel_initial_setup/up.sql (100%) rename {database_interactions => auth}/simple-auth-server/migrations/2018-10-09-101948_users/down.sql (100%) rename {database_interactions => auth}/simple-auth-server/migrations/2018-10-09-101948_users/up.sql (100%) rename {database_interactions => auth}/simple-auth-server/migrations/2018-10-16-095633_invitations/down.sql (100%) rename {database_interactions => auth}/simple-auth-server/migrations/2018-10-16-095633_invitations/up.sql (100%) rename {database_interactions => auth}/simple-auth-server/src/auth_handler.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/email_service.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/errors.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/invitation_handler.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/main.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/models.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/register_handler.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/schema.rs (100%) rename {database_interactions => auth}/simple-auth-server/src/utils.rs (100%) rename {database_interactions => auth}/simple-auth-server/static/index.html (100%) rename {database_interactions => auth}/simple-auth-server/static/main.css (100%) rename {database_interactions => auth}/simple-auth-server/static/main.js (100%) rename {database_interactions => auth}/simple-auth-server/static/register.html (100%) delete mode 100644 basics/static_index/.gitattributes rename {security/web-cors => cors}/README.md (100%) rename {security/web-cors => cors}/backend/Cargo.toml (100%) rename {security/web-cors => cors}/backend/src/main.rs (100%) rename {security/web-cors => cors}/backend/src/user.rs (100%) rename {security/web-cors => cors}/frontend/.gitignore (100%) rename {security/web-cors => cors}/frontend/index.html (100%) rename {security/web-cors => cors}/frontend/package.json (100%) rename {security/web-cors => cors}/frontend/src/app.vue (100%) rename {security/web-cors => cors}/frontend/src/main.js (100%) rename {other/data_factory => data_factory}/Cargo.toml (100%) rename {other/data_factory => data_factory}/README.md (100%) rename {other/data_factory => data_factory}/src/main.rs (100%) delete mode 100644 database_interactions/diesel/.env delete mode 100644 database_interactions/rbatis/README.md rename {database_interactions => databases}/diesel/.gitignore (100%) rename {database_interactions => databases}/diesel/Cargo.toml (100%) rename {database_interactions => databases}/diesel/README.md (100%) rename {database_interactions => databases}/diesel/migrations/20170124012402_create_users/down.sql (100%) rename {database_interactions => databases}/diesel/migrations/20170124012402_create_users/up.sql (100%) rename {database_interactions => databases}/diesel/src/actions.rs (100%) rename {database_interactions => databases}/diesel/src/main.rs (100%) rename {database_interactions => databases}/diesel/src/models.rs (100%) rename {database_interactions => databases}/diesel/src/schema.rs (100%) rename {database_interactions => databases}/mongodb/Cargo.toml (100%) rename {database_interactions => databases}/mongodb/README.md (100%) rename {database_interactions => databases}/mongodb/src/main.rs (100%) rename {database_interactions => databases}/mongodb/src/model.rs (100%) rename {database_interactions => databases}/mongodb/src/test.rs (100%) rename {database_interactions/pg => databases/postgres}/.gitignore (100%) rename {database_interactions/pg => databases/postgres}/Cargo.toml (100%) rename {database_interactions/pg => databases/postgres}/README.md (100%) rename {database_interactions/pg => databases/postgres}/sql/add_user.sql (100%) rename {database_interactions/pg => databases/postgres}/sql/get_users.sql (100%) rename {database_interactions/pg => databases/postgres}/sql/schema.sql (100%) rename {database_interactions/pg => databases/postgres}/src/main.rs (100%) create mode 100644 databases/rbatis/README.md rename {database_interactions => databases}/redis/Cargo.toml (100%) rename {database_interactions => databases}/redis/README.md (100%) rename {database_interactions => databases}/redis/src/main.rs (100%) rename {database_interactions/basic => databases/sqlite}/.gitignore (100%) rename {database_interactions/basic => databases/sqlite}/Cargo.toml (100%) rename {database_interactions/basic => databases/sqlite}/README.md (100%) rename {database_interactions/basic => databases/sqlite}/db/GHCND_documentation.pdf (100%) rename {database_interactions/basic => databases/sqlite}/db/README.md (100%) rename {database_interactions/basic => databases/sqlite}/db/db.sql (100%) rename {database_interactions/basic => databases/sqlite}/db/nyc_centralpark_weather.csv (100%) rename {database_interactions/basic => databases/sqlite}/db/setup_db.sh (100%) rename {database_interactions/basic => databases/sqlite}/src/db.rs (100%) rename {database_interactions/basic => databases/sqlite}/src/main.rs (100%) rename {basics/docker_sample => docker}/.dockerignore (100%) rename {basics/docker_sample => docker}/Cargo.toml (100%) rename {basics/docker_sample => docker}/Dockerfile (100%) rename {basics/docker_sample => docker}/README.MD (100%) rename {basics/docker_sample => docker}/src/main.rs (100%) rename {other/http-proxy => http-proxy}/Cargo.toml (100%) rename {other/http-proxy => http-proxy}/README.md (100%) rename {other/http-proxy => http-proxy}/src/main.rs (100%) rename {security => https-tls}/awc_https/Cargo.toml (100%) rename {security => https-tls}/awc_https/README.md (100%) rename {security => https-tls}/awc_https/src/main.rs (100%) rename {security => https-tls}/openssl-auto-le/Cargo.toml (100%) rename {security => https-tls}/openssl-auto-le/README.md (100%) rename {security => https-tls}/openssl-auto-le/src/main.rs (100%) rename {security => https-tls}/openssl/Cargo.toml (100%) rename {security => https-tls}/openssl/README.md (100%) rename {security => https-tls}/openssl/cert.pem (100%) rename {security => https-tls}/openssl/key.pem (100%) rename {security => https-tls}/openssl/src/main.rs (100%) rename {security => https-tls}/rustls-client-cert/Cargo.toml (100%) rename {security => https-tls}/rustls-client-cert/README.md (100%) rename {security => https-tls}/rustls-client-cert/certs/client-cert.pem (100%) rename {security => https-tls}/rustls-client-cert/certs/client-key.pem (100%) rename {security => https-tls}/rustls-client-cert/certs/rootCA-key.pem (100%) rename {security => https-tls}/rustls-client-cert/certs/rootCA.pem (100%) rename {security => https-tls}/rustls-client-cert/certs/server-cert.pem (100%) rename {security => https-tls}/rustls-client-cert/certs/server-key.pem (100%) rename {security => https-tls}/rustls-client-cert/src/main.rs (100%) rename {security => https-tls}/rustls/Cargo.toml (100%) rename {security => https-tls}/rustls/README.md (100%) rename {security => https-tls}/rustls/cert.pem (100%) rename {security => https-tls}/rustls/key.pem (100%) rename {security => https-tls}/rustls/src/main.rs (100%) rename {basics => middleware}/middleware-ext-mut/Cargo.toml (100%) rename {basics => middleware}/middleware-ext-mut/README.md (100%) rename {basics => middleware}/middleware-ext-mut/src/add_msg.rs (100%) rename {basics => middleware}/middleware-ext-mut/src/main.rs (100%) rename {basics => middleware}/middleware-http-to-https/Cargo.toml (100%) rename {basics => middleware}/middleware-http-to-https/README.md (100%) rename {basics => middleware}/middleware-http-to-https/cert.pem (100%) rename {basics => middleware}/middleware-http-to-https/key.pem (100%) rename {basics => middleware}/middleware-http-to-https/src/main.rs (100%) rename {basics => middleware}/middleware/Cargo.toml (100%) rename {basics => middleware}/middleware/README.md (100%) rename {basics => middleware}/middleware/src/main.rs (100%) rename {basics => middleware}/middleware/src/read_request_body.rs (100%) rename {basics => middleware}/middleware/src/read_response_body.rs (100%) rename {basics => middleware}/middleware/src/redirect.rs (100%) rename {basics => middleware}/middleware/src/simple.rs (100%) rename {other/protobuf => protobuf}/.gitignore (100%) rename {other/protobuf => protobuf}/Cargo.toml (100%) rename {other/protobuf => protobuf}/README.md (100%) rename {other/protobuf => protobuf}/client.py (100%) rename {other/protobuf => protobuf}/src/main.rs (100%) rename {other/protobuf => protobuf}/test.proto (100%) rename {other/protobuf => protobuf}/test_pb2.py (100%) rename {other/run-in-thread => run-in-thread}/Cargo.toml (100%) rename {other/run-in-thread => run-in-thread}/src/main.rs (85%) rename {other/server-sent-events => server-sent-events}/Cargo.toml (100%) rename {other/server-sent-events => server-sent-events}/README.md (100%) rename {other/server-sent-events => server-sent-events}/benchmark.js (100%) rename {other/server-sent-events => server-sent-events}/drain.js (100%) rename {other/server-sent-events => server-sent-events}/src/broadcast.rs (100%) rename {other/server-sent-events => server-sent-events}/src/index.html (100%) rename {other/server-sent-events => server-sent-events}/src/main.rs (100%) rename {basics/shutdown-server => shutdown-server}/Cargo.toml (100%) rename {basics/shutdown-server => shutdown-server}/README.md (100%) rename {basics/shutdown-server => shutdown-server}/src/main.rs (100%) rename {template_engines => templating}/askama/Cargo.toml (100%) rename {template_engines => templating}/askama/src/main.rs (100%) rename {template_engines => templating}/askama/templates/index.html (100%) rename {template_engines => templating}/askama/templates/user.html (100%) rename {template_engines => templating}/handlebars/Cargo.toml (100%) rename {template_engines => templating}/handlebars/README.md (100%) rename {template_engines => templating}/handlebars/src/main.rs (100%) rename {template_engines => templating}/handlebars/static/templates/error.html (100%) rename {template_engines => templating}/handlebars/static/templates/index.html (100%) rename {template_engines => templating}/handlebars/static/templates/user.html (100%) rename {template_engines => templating}/sailfish/Cargo.toml (100%) rename {template_engines => templating}/sailfish/README.md (100%) rename {template_engines => templating}/sailfish/src/main.rs (100%) rename {template_engines => templating}/sailfish/templates/actix.stpl (100%) rename {template_engines => templating}/sailfish/templates/page.stpl (100%) rename {template_engines => templating}/tera/Cargo.toml (100%) rename {template_engines => templating}/tera/README.md (100%) rename {template_engines => templating}/tera/src/main.rs (100%) rename {template_engines => templating}/tera/templates/error.html (100%) rename {template_engines => templating}/tera/templates/index.html (100%) rename {template_engines => templating}/tera/templates/user.html (100%) rename {template_engines => templating}/tinytemplate/Cargo.toml (100%) rename {template_engines => templating}/tinytemplate/README.md (100%) rename {template_engines => templating}/tinytemplate/src/main.rs (100%) rename {template_engines => templating}/tinytemplate/templates/error.html (100%) rename {template_engines => templating}/tinytemplate/templates/index.html (100%) rename {template_engines => templating}/tinytemplate/templates/user.html (100%) rename {template_engines => templating}/yarte/Cargo.toml (100%) rename {template_engines => templating}/yarte/README.md (100%) rename {template_engines => templating}/yarte/build.rs (100%) rename {template_engines => templating}/yarte/src/main.rs (100%) rename {template_engines => templating}/yarte/templates/base.hbs (100%) rename {template_engines => templating}/yarte/templates/deep/more/card/form.hbs (100%) rename {template_engines => templating}/yarte/templates/deep/more/card/hi.hbs (100%) rename {template_engines => templating}/yarte/templates/deep/more/deep/welcome.hbs (100%) rename {template_engines => templating}/yarte/templates/deep/more/doc/head.hbs (100%) rename {template_engines => templating}/yarte/templates/deep/more/doc/t.hbs (100%) rename {template_engines => templating}/yarte/templates/index.hbs (100%) rename {template_engines => templating}/yarte/yarte.toml (100%) rename {other/unix-socket => unix-socket}/Cargo.toml (100%) rename {other/unix-socket => unix-socket}/README.md (100%) rename {other/unix-socket => unix-socket}/src/main.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 8ff87ef..c87a07a 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5279,6 +5279,7 @@ dependencies = [ "actix-files", "actix-web", "env_logger", + "log", ] [[package]] diff --git a/Cargo.toml b/Cargo.toml index 3977d8f..460e454 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,60 +1,60 @@ [workspace] members = [ + "auth/casbin", + "auth/cookie-auth", + "auth/cookie-session", + "auth/redis-session", + "auth/simple-auth-server", "basics/basics", - "basics/docker_sample", "basics/error_handling", "basics/hello-world", "basics/json-validation", - "basics/middleware-ext-mut", - "basics/middleware-http-to-https", - "basics/middleware", "basics/nested-routing", - "basics/shutdown-server", "basics/state", "basics/static_index", "basics/todo", - "database_interactions/basic", + "cors/backend", + "data_factory", # example uses incompatible libsqlite-sys to other examples - # "database_interactions/diesel", - "database_interactions/mongodb", - "database_interactions/pg", - "database_interactions/redis", - "database_interactions/simple-auth-server", + # "databases/diesel", + "databases/mongodb", + "databases/postgres", + "databases/redis", + "databases/sqlite", + "docker", "forms/form", "forms/multipart-s3", "forms/multipart", "graphql/async-graphql", "graphql/juniper-advanced", "graphql/juniper", + "http-proxy", + "https-tls/awc_https", + "https-tls/openssl-auto-le", + "https-tls/openssl", + "https-tls/rustls-client-cert", + "https-tls/rustls", "json/json_decode_error", "json/json_error", "json/json", "json/jsonrpc", - "other/data_factory", - "other/http-proxy", - "other/protobuf", - "other/run-in-thread", - "other/server-sent-events", - "other/unix-socket", - "security/awc_https", - "security/casbin", - "security/openssl", - "security/openssl-auto-le", - "security/rustls-client-cert", - "security/rustls", - "security/web-cors/backend", - "session/cookie-auth", - "session/cookie-session", - "session/redis-session", - "template_engines/askama", - "template_engines/handlebars", - "template_engines/tera", - "template_engines/tinytemplate", - "template_engines/yarte", - "template_engines/sailfish", + "middleware/middleware-ext-mut", + "middleware/middleware-http-to-https", + "middleware/middleware", + "protobuf", + "run-in-thread", + "server-sent-events", + "shutdown-server", + "templating/askama", + "templating/handlebars", + "templating/sailfish", + "templating/tera", + "templating/tinytemplate", + "templating/yarte", + "unix-socket", "websockets/autobahn", - "websockets/chat", "websockets/chat-broker", "websockets/chat-tcp", + "websockets/chat", "websockets/echo", ] diff --git a/security/casbin/Cargo.toml b/auth/casbin/Cargo.toml similarity index 100% rename from security/casbin/Cargo.toml rename to auth/casbin/Cargo.toml diff --git a/security/casbin/README.md b/auth/casbin/README.md similarity index 100% rename from security/casbin/README.md rename to auth/casbin/README.md diff --git a/security/casbin/rbac/rbac_model.conf b/auth/casbin/rbac/rbac_model.conf similarity index 100% rename from security/casbin/rbac/rbac_model.conf rename to auth/casbin/rbac/rbac_model.conf diff --git a/security/casbin/rbac/rbac_policy.csv b/auth/casbin/rbac/rbac_policy.csv similarity index 100% rename from security/casbin/rbac/rbac_policy.csv rename to auth/casbin/rbac/rbac_policy.csv diff --git a/security/casbin/src/main.rs b/auth/casbin/src/main.rs similarity index 100% rename from security/casbin/src/main.rs rename to auth/casbin/src/main.rs diff --git a/session/cookie-auth/Cargo.toml b/auth/cookie-auth/Cargo.toml similarity index 100% rename from session/cookie-auth/Cargo.toml rename to auth/cookie-auth/Cargo.toml diff --git a/session/cookie-auth/README.md b/auth/cookie-auth/README.md similarity index 100% rename from session/cookie-auth/README.md rename to auth/cookie-auth/README.md diff --git a/session/cookie-auth/src/main.rs b/auth/cookie-auth/src/main.rs similarity index 100% rename from session/cookie-auth/src/main.rs rename to auth/cookie-auth/src/main.rs diff --git a/session/cookie-session/Cargo.toml b/auth/cookie-session/Cargo.toml similarity index 100% rename from session/cookie-session/Cargo.toml rename to auth/cookie-session/Cargo.toml diff --git a/session/cookie-session/README.md b/auth/cookie-session/README.md similarity index 100% rename from session/cookie-session/README.md rename to auth/cookie-session/README.md diff --git a/session/cookie-session/src/main.rs b/auth/cookie-session/src/main.rs similarity index 100% rename from session/cookie-session/src/main.rs rename to auth/cookie-session/src/main.rs diff --git a/session/redis-session/Cargo.toml b/auth/redis-session/Cargo.toml similarity index 100% rename from session/redis-session/Cargo.toml rename to auth/redis-session/Cargo.toml diff --git a/session/redis-session/README.md b/auth/redis-session/README.md similarity index 100% rename from session/redis-session/README.md rename to auth/redis-session/README.md diff --git a/session/redis-session/src/main.rs b/auth/redis-session/src/main.rs similarity index 100% rename from session/redis-session/src/main.rs rename to auth/redis-session/src/main.rs diff --git a/database_interactions/simple-auth-server/Cargo.toml b/auth/simple-auth-server/Cargo.toml similarity index 96% rename from database_interactions/simple-auth-server/Cargo.toml rename to auth/simple-auth-server/Cargo.toml index 7efb1da..4d8ed24 100644 --- a/database_interactions/simple-auth-server/Cargo.toml +++ b/auth/simple-auth-server/Cargo.toml @@ -2,7 +2,6 @@ name = "simple-auth-server" version = "1.0.0" edition = "2021" -workspace = "../.." [dependencies] actix-web = "4.0.0-beta.21" diff --git a/database_interactions/simple-auth-server/README.md b/auth/simple-auth-server/README.md similarity index 100% rename from database_interactions/simple-auth-server/README.md rename to auth/simple-auth-server/README.md diff --git a/database_interactions/simple-auth-server/diesel.toml b/auth/simple-auth-server/diesel.toml similarity index 100% rename from database_interactions/simple-auth-server/diesel.toml rename to auth/simple-auth-server/diesel.toml diff --git a/database_interactions/simple-auth-server/migrations/.gitkeep b/auth/simple-auth-server/migrations/.gitkeep similarity index 100% rename from database_interactions/simple-auth-server/migrations/.gitkeep rename to auth/simple-auth-server/migrations/.gitkeep diff --git a/database_interactions/simple-auth-server/migrations/00000000000000_diesel_initial_setup/down.sql b/auth/simple-auth-server/migrations/00000000000000_diesel_initial_setup/down.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/00000000000000_diesel_initial_setup/down.sql rename to auth/simple-auth-server/migrations/00000000000000_diesel_initial_setup/down.sql diff --git a/database_interactions/simple-auth-server/migrations/00000000000000_diesel_initial_setup/up.sql b/auth/simple-auth-server/migrations/00000000000000_diesel_initial_setup/up.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/00000000000000_diesel_initial_setup/up.sql rename to auth/simple-auth-server/migrations/00000000000000_diesel_initial_setup/up.sql diff --git a/database_interactions/simple-auth-server/migrations/2018-10-09-101948_users/down.sql b/auth/simple-auth-server/migrations/2018-10-09-101948_users/down.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/2018-10-09-101948_users/down.sql rename to auth/simple-auth-server/migrations/2018-10-09-101948_users/down.sql diff --git a/database_interactions/simple-auth-server/migrations/2018-10-09-101948_users/up.sql b/auth/simple-auth-server/migrations/2018-10-09-101948_users/up.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/2018-10-09-101948_users/up.sql rename to auth/simple-auth-server/migrations/2018-10-09-101948_users/up.sql diff --git a/database_interactions/simple-auth-server/migrations/2018-10-16-095633_invitations/down.sql b/auth/simple-auth-server/migrations/2018-10-16-095633_invitations/down.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/2018-10-16-095633_invitations/down.sql rename to auth/simple-auth-server/migrations/2018-10-16-095633_invitations/down.sql diff --git a/database_interactions/simple-auth-server/migrations/2018-10-16-095633_invitations/up.sql b/auth/simple-auth-server/migrations/2018-10-16-095633_invitations/up.sql similarity index 100% rename from database_interactions/simple-auth-server/migrations/2018-10-16-095633_invitations/up.sql rename to auth/simple-auth-server/migrations/2018-10-16-095633_invitations/up.sql diff --git a/database_interactions/simple-auth-server/src/auth_handler.rs b/auth/simple-auth-server/src/auth_handler.rs similarity index 100% rename from database_interactions/simple-auth-server/src/auth_handler.rs rename to auth/simple-auth-server/src/auth_handler.rs diff --git a/database_interactions/simple-auth-server/src/email_service.rs b/auth/simple-auth-server/src/email_service.rs similarity index 100% rename from database_interactions/simple-auth-server/src/email_service.rs rename to auth/simple-auth-server/src/email_service.rs diff --git a/database_interactions/simple-auth-server/src/errors.rs b/auth/simple-auth-server/src/errors.rs similarity index 100% rename from database_interactions/simple-auth-server/src/errors.rs rename to auth/simple-auth-server/src/errors.rs diff --git a/database_interactions/simple-auth-server/src/invitation_handler.rs b/auth/simple-auth-server/src/invitation_handler.rs similarity index 100% rename from database_interactions/simple-auth-server/src/invitation_handler.rs rename to auth/simple-auth-server/src/invitation_handler.rs diff --git a/database_interactions/simple-auth-server/src/main.rs b/auth/simple-auth-server/src/main.rs similarity index 100% rename from database_interactions/simple-auth-server/src/main.rs rename to auth/simple-auth-server/src/main.rs diff --git a/database_interactions/simple-auth-server/src/models.rs b/auth/simple-auth-server/src/models.rs similarity index 100% rename from database_interactions/simple-auth-server/src/models.rs rename to auth/simple-auth-server/src/models.rs diff --git a/database_interactions/simple-auth-server/src/register_handler.rs b/auth/simple-auth-server/src/register_handler.rs similarity index 100% rename from database_interactions/simple-auth-server/src/register_handler.rs rename to auth/simple-auth-server/src/register_handler.rs diff --git a/database_interactions/simple-auth-server/src/schema.rs b/auth/simple-auth-server/src/schema.rs similarity index 100% rename from database_interactions/simple-auth-server/src/schema.rs rename to auth/simple-auth-server/src/schema.rs diff --git a/database_interactions/simple-auth-server/src/utils.rs b/auth/simple-auth-server/src/utils.rs similarity index 100% rename from database_interactions/simple-auth-server/src/utils.rs rename to auth/simple-auth-server/src/utils.rs diff --git a/database_interactions/simple-auth-server/static/index.html b/auth/simple-auth-server/static/index.html similarity index 100% rename from database_interactions/simple-auth-server/static/index.html rename to auth/simple-auth-server/static/index.html diff --git a/database_interactions/simple-auth-server/static/main.css b/auth/simple-auth-server/static/main.css similarity index 100% rename from database_interactions/simple-auth-server/static/main.css rename to auth/simple-auth-server/static/main.css diff --git a/database_interactions/simple-auth-server/static/main.js b/auth/simple-auth-server/static/main.js similarity index 100% rename from database_interactions/simple-auth-server/static/main.js rename to auth/simple-auth-server/static/main.js diff --git a/database_interactions/simple-auth-server/static/register.html b/auth/simple-auth-server/static/register.html similarity index 100% rename from database_interactions/simple-auth-server/static/register.html rename to auth/simple-auth-server/static/register.html diff --git a/basics/static_index/.gitattributes b/basics/static_index/.gitattributes deleted file mode 100644 index dfe0770..0000000 --- a/basics/static_index/.gitattributes +++ /dev/null @@ -1,2 +0,0 @@ -# Auto detect text files and perform LF normalization -* text=auto diff --git a/basics/static_index/Cargo.toml b/basics/static_index/Cargo.toml index 001b05e..eee0661 100644 --- a/basics/static_index/Cargo.toml +++ b/basics/static_index/Cargo.toml @@ -4,6 +4,7 @@ version = "1.0.0" edition = "2021" [dependencies] -actix-web = "4.0.0-rc.1" +actix-web = "4.0.0-rc.3" actix-files = "0.6.0-beta.15" env_logger = "0.9.0" +log = "0.4" diff --git a/basics/static_index/src/main.rs b/basics/static_index/src/main.rs index f82818b..1a15d63 100644 --- a/basics/static_index/src/main.rs +++ b/basics/static_index/src/main.rs @@ -1,15 +1,14 @@ use actix_files::Files; -use actix_web::{middleware, App, HttpServer}; +use actix_web::{middleware::Logger, App, HttpServer}; #[actix_web::main] async fn main() -> std::io::Result<()> { - std::env::set_var("RUST_LOG", "actix_web=info"); - env_logger::init(); + env_logger::init_from_env(env_logger::Env::new().default_filter_or("info")); + + log::info!("starting HTTP server at http://localhost:8080"); HttpServer::new(|| { App::new() - // Enable the logger. - .wrap(middleware::Logger::default()) // We allow the visitor to see an index of the images at `/images`. .service(Files::new("/images", "static/images/").show_files_listing()) // Serve a tree of static files at the web root and specify the index file. @@ -17,6 +16,8 @@ async fn main() -> std::io::Result<()> { // resolved in the order they are defined. If this would be placed before the `/images` // path then the service for the static images would never be reached. .service(Files::new("/", "./static/root/").index_file("index.html")) + // Enable the logger. + .wrap(Logger::default()) }) .bind(("127.0.0.1", 8080))? .run() diff --git a/security/web-cors/README.md b/cors/README.md similarity index 100% rename from security/web-cors/README.md rename to cors/README.md diff --git a/security/web-cors/backend/Cargo.toml b/cors/backend/Cargo.toml similarity index 100% rename from security/web-cors/backend/Cargo.toml rename to cors/backend/Cargo.toml diff --git a/security/web-cors/backend/src/main.rs b/cors/backend/src/main.rs similarity index 100% rename from security/web-cors/backend/src/main.rs rename to cors/backend/src/main.rs diff --git a/security/web-cors/backend/src/user.rs b/cors/backend/src/user.rs similarity index 100% rename from security/web-cors/backend/src/user.rs rename to cors/backend/src/user.rs diff --git a/security/web-cors/frontend/.gitignore b/cors/frontend/.gitignore similarity index 100% rename from security/web-cors/frontend/.gitignore rename to cors/frontend/.gitignore diff --git a/security/web-cors/frontend/index.html b/cors/frontend/index.html similarity index 100% rename from security/web-cors/frontend/index.html rename to cors/frontend/index.html diff --git a/security/web-cors/frontend/package.json b/cors/frontend/package.json similarity index 100% rename from security/web-cors/frontend/package.json rename to cors/frontend/package.json diff --git a/security/web-cors/frontend/src/app.vue b/cors/frontend/src/app.vue similarity index 100% rename from security/web-cors/frontend/src/app.vue rename to cors/frontend/src/app.vue diff --git a/security/web-cors/frontend/src/main.js b/cors/frontend/src/main.js similarity index 100% rename from security/web-cors/frontend/src/main.js rename to cors/frontend/src/main.js diff --git a/other/data_factory/Cargo.toml b/data_factory/Cargo.toml similarity index 100% rename from other/data_factory/Cargo.toml rename to data_factory/Cargo.toml diff --git a/other/data_factory/README.md b/data_factory/README.md similarity index 100% rename from other/data_factory/README.md rename to data_factory/README.md diff --git a/other/data_factory/src/main.rs b/data_factory/src/main.rs similarity index 100% rename from other/data_factory/src/main.rs rename to data_factory/src/main.rs diff --git a/database_interactions/diesel/.env b/database_interactions/diesel/.env deleted file mode 100644 index 186be7c..0000000 --- a/database_interactions/diesel/.env +++ /dev/null @@ -1 +0,0 @@ -DATABASE_URL=test.db diff --git a/database_interactions/rbatis/README.md b/database_interactions/rbatis/README.md deleted file mode 100644 index e1cee6e..0000000 --- a/database_interactions/rbatis/README.md +++ /dev/null @@ -1,5 +0,0 @@ -People developing rbatis have an example on usage with Actix Web. -
-You can find the example in the [rbatis/example/src/actix_web](https://github.com/rbatis/rbatis/blob/master/example/src/actix_web/main.rs) directory. -
-Tutorial on how to get started with the example is placed inside of the [rbatis/example](https://github.com/rbatis/rbatis/tree/master/example) directory diff --git a/database_interactions/diesel/.gitignore b/databases/diesel/.gitignore similarity index 100% rename from database_interactions/diesel/.gitignore rename to databases/diesel/.gitignore diff --git a/database_interactions/diesel/Cargo.toml b/databases/diesel/Cargo.toml similarity index 100% rename from database_interactions/diesel/Cargo.toml rename to databases/diesel/Cargo.toml diff --git a/database_interactions/diesel/README.md b/databases/diesel/README.md similarity index 100% rename from database_interactions/diesel/README.md rename to databases/diesel/README.md diff --git a/database_interactions/diesel/migrations/20170124012402_create_users/down.sql b/databases/diesel/migrations/20170124012402_create_users/down.sql similarity index 100% rename from database_interactions/diesel/migrations/20170124012402_create_users/down.sql rename to databases/diesel/migrations/20170124012402_create_users/down.sql diff --git a/database_interactions/diesel/migrations/20170124012402_create_users/up.sql b/databases/diesel/migrations/20170124012402_create_users/up.sql similarity index 100% rename from database_interactions/diesel/migrations/20170124012402_create_users/up.sql rename to databases/diesel/migrations/20170124012402_create_users/up.sql diff --git a/database_interactions/diesel/src/actions.rs b/databases/diesel/src/actions.rs similarity index 100% rename from database_interactions/diesel/src/actions.rs rename to databases/diesel/src/actions.rs diff --git a/database_interactions/diesel/src/main.rs b/databases/diesel/src/main.rs similarity index 100% rename from database_interactions/diesel/src/main.rs rename to databases/diesel/src/main.rs diff --git a/database_interactions/diesel/src/models.rs b/databases/diesel/src/models.rs similarity index 100% rename from database_interactions/diesel/src/models.rs rename to databases/diesel/src/models.rs diff --git a/database_interactions/diesel/src/schema.rs b/databases/diesel/src/schema.rs similarity index 100% rename from database_interactions/diesel/src/schema.rs rename to databases/diesel/src/schema.rs diff --git a/database_interactions/mongodb/Cargo.toml b/databases/mongodb/Cargo.toml similarity index 100% rename from database_interactions/mongodb/Cargo.toml rename to databases/mongodb/Cargo.toml diff --git a/database_interactions/mongodb/README.md b/databases/mongodb/README.md similarity index 100% rename from database_interactions/mongodb/README.md rename to databases/mongodb/README.md diff --git a/database_interactions/mongodb/src/main.rs b/databases/mongodb/src/main.rs similarity index 100% rename from database_interactions/mongodb/src/main.rs rename to databases/mongodb/src/main.rs diff --git a/database_interactions/mongodb/src/model.rs b/databases/mongodb/src/model.rs similarity index 100% rename from database_interactions/mongodb/src/model.rs rename to databases/mongodb/src/model.rs diff --git a/database_interactions/mongodb/src/test.rs b/databases/mongodb/src/test.rs similarity index 100% rename from database_interactions/mongodb/src/test.rs rename to databases/mongodb/src/test.rs diff --git a/database_interactions/pg/.gitignore b/databases/postgres/.gitignore similarity index 100% rename from database_interactions/pg/.gitignore rename to databases/postgres/.gitignore diff --git a/database_interactions/pg/Cargo.toml b/databases/postgres/Cargo.toml similarity index 100% rename from database_interactions/pg/Cargo.toml rename to databases/postgres/Cargo.toml diff --git a/database_interactions/pg/README.md b/databases/postgres/README.md similarity index 100% rename from database_interactions/pg/README.md rename to databases/postgres/README.md diff --git a/database_interactions/pg/sql/add_user.sql b/databases/postgres/sql/add_user.sql similarity index 100% rename from database_interactions/pg/sql/add_user.sql rename to databases/postgres/sql/add_user.sql diff --git a/database_interactions/pg/sql/get_users.sql b/databases/postgres/sql/get_users.sql similarity index 100% rename from database_interactions/pg/sql/get_users.sql rename to databases/postgres/sql/get_users.sql diff --git a/database_interactions/pg/sql/schema.sql b/databases/postgres/sql/schema.sql similarity index 100% rename from database_interactions/pg/sql/schema.sql rename to databases/postgres/sql/schema.sql diff --git a/database_interactions/pg/src/main.rs b/databases/postgres/src/main.rs similarity index 100% rename from database_interactions/pg/src/main.rs rename to databases/postgres/src/main.rs diff --git a/databases/rbatis/README.md b/databases/rbatis/README.md new file mode 100644 index 0000000..25bf17d --- /dev/null +++ b/databases/rbatis/README.md @@ -0,0 +1,5 @@ +The `rbatis` ORM developers keep their own example on usage with Actix Web. + +You can find the example in the [rbatis/example/src/actix_web](https://github.com/rbatis/rbatis/blob/master/example/src/actix_web/main.rs) directory. + +See the [`example` folder readme](https://github.com/rbatis/rbatis/tree/master/example) for a guide on how to get started with the example. diff --git a/database_interactions/redis/Cargo.toml b/databases/redis/Cargo.toml similarity index 100% rename from database_interactions/redis/Cargo.toml rename to databases/redis/Cargo.toml diff --git a/database_interactions/redis/README.md b/databases/redis/README.md similarity index 100% rename from database_interactions/redis/README.md rename to databases/redis/README.md diff --git a/database_interactions/redis/src/main.rs b/databases/redis/src/main.rs similarity index 100% rename from database_interactions/redis/src/main.rs rename to databases/redis/src/main.rs diff --git a/database_interactions/basic/.gitignore b/databases/sqlite/.gitignore similarity index 100% rename from database_interactions/basic/.gitignore rename to databases/sqlite/.gitignore diff --git a/database_interactions/basic/Cargo.toml b/databases/sqlite/Cargo.toml similarity index 100% rename from database_interactions/basic/Cargo.toml rename to databases/sqlite/Cargo.toml diff --git a/database_interactions/basic/README.md b/databases/sqlite/README.md similarity index 100% rename from database_interactions/basic/README.md rename to databases/sqlite/README.md diff --git a/database_interactions/basic/db/GHCND_documentation.pdf b/databases/sqlite/db/GHCND_documentation.pdf similarity index 100% rename from database_interactions/basic/db/GHCND_documentation.pdf rename to databases/sqlite/db/GHCND_documentation.pdf diff --git a/database_interactions/basic/db/README.md b/databases/sqlite/db/README.md similarity index 100% rename from database_interactions/basic/db/README.md rename to databases/sqlite/db/README.md diff --git a/database_interactions/basic/db/db.sql b/databases/sqlite/db/db.sql similarity index 100% rename from database_interactions/basic/db/db.sql rename to databases/sqlite/db/db.sql diff --git a/database_interactions/basic/db/nyc_centralpark_weather.csv b/databases/sqlite/db/nyc_centralpark_weather.csv similarity index 100% rename from database_interactions/basic/db/nyc_centralpark_weather.csv rename to databases/sqlite/db/nyc_centralpark_weather.csv diff --git a/database_interactions/basic/db/setup_db.sh b/databases/sqlite/db/setup_db.sh similarity index 100% rename from database_interactions/basic/db/setup_db.sh rename to databases/sqlite/db/setup_db.sh diff --git a/database_interactions/basic/src/db.rs b/databases/sqlite/src/db.rs similarity index 100% rename from database_interactions/basic/src/db.rs rename to databases/sqlite/src/db.rs diff --git a/database_interactions/basic/src/main.rs b/databases/sqlite/src/main.rs similarity index 100% rename from database_interactions/basic/src/main.rs rename to databases/sqlite/src/main.rs diff --git a/basics/docker_sample/.dockerignore b/docker/.dockerignore similarity index 100% rename from basics/docker_sample/.dockerignore rename to docker/.dockerignore diff --git a/basics/docker_sample/Cargo.toml b/docker/Cargo.toml similarity index 100% rename from basics/docker_sample/Cargo.toml rename to docker/Cargo.toml diff --git a/basics/docker_sample/Dockerfile b/docker/Dockerfile similarity index 100% rename from basics/docker_sample/Dockerfile rename to docker/Dockerfile diff --git a/basics/docker_sample/README.MD b/docker/README.MD similarity index 100% rename from basics/docker_sample/README.MD rename to docker/README.MD diff --git a/basics/docker_sample/src/main.rs b/docker/src/main.rs similarity index 100% rename from basics/docker_sample/src/main.rs rename to docker/src/main.rs diff --git a/other/http-proxy/Cargo.toml b/http-proxy/Cargo.toml similarity index 100% rename from other/http-proxy/Cargo.toml rename to http-proxy/Cargo.toml diff --git a/other/http-proxy/README.md b/http-proxy/README.md similarity index 100% rename from other/http-proxy/README.md rename to http-proxy/README.md diff --git a/other/http-proxy/src/main.rs b/http-proxy/src/main.rs similarity index 100% rename from other/http-proxy/src/main.rs rename to http-proxy/src/main.rs diff --git a/security/awc_https/Cargo.toml b/https-tls/awc_https/Cargo.toml similarity index 100% rename from security/awc_https/Cargo.toml rename to https-tls/awc_https/Cargo.toml diff --git a/security/awc_https/README.md b/https-tls/awc_https/README.md similarity index 100% rename from security/awc_https/README.md rename to https-tls/awc_https/README.md diff --git a/security/awc_https/src/main.rs b/https-tls/awc_https/src/main.rs similarity index 100% rename from security/awc_https/src/main.rs rename to https-tls/awc_https/src/main.rs diff --git a/security/openssl-auto-le/Cargo.toml b/https-tls/openssl-auto-le/Cargo.toml similarity index 100% rename from security/openssl-auto-le/Cargo.toml rename to https-tls/openssl-auto-le/Cargo.toml diff --git a/security/openssl-auto-le/README.md b/https-tls/openssl-auto-le/README.md similarity index 100% rename from security/openssl-auto-le/README.md rename to https-tls/openssl-auto-le/README.md diff --git a/security/openssl-auto-le/src/main.rs b/https-tls/openssl-auto-le/src/main.rs similarity index 100% rename from security/openssl-auto-le/src/main.rs rename to https-tls/openssl-auto-le/src/main.rs diff --git a/security/openssl/Cargo.toml b/https-tls/openssl/Cargo.toml similarity index 100% rename from security/openssl/Cargo.toml rename to https-tls/openssl/Cargo.toml diff --git a/security/openssl/README.md b/https-tls/openssl/README.md similarity index 100% rename from security/openssl/README.md rename to https-tls/openssl/README.md diff --git a/security/openssl/cert.pem b/https-tls/openssl/cert.pem similarity index 100% rename from security/openssl/cert.pem rename to https-tls/openssl/cert.pem diff --git a/security/openssl/key.pem b/https-tls/openssl/key.pem similarity index 100% rename from security/openssl/key.pem rename to https-tls/openssl/key.pem diff --git a/security/openssl/src/main.rs b/https-tls/openssl/src/main.rs similarity index 100% rename from security/openssl/src/main.rs rename to https-tls/openssl/src/main.rs diff --git a/security/rustls-client-cert/Cargo.toml b/https-tls/rustls-client-cert/Cargo.toml similarity index 100% rename from security/rustls-client-cert/Cargo.toml rename to https-tls/rustls-client-cert/Cargo.toml diff --git a/security/rustls-client-cert/README.md b/https-tls/rustls-client-cert/README.md similarity index 100% rename from security/rustls-client-cert/README.md rename to https-tls/rustls-client-cert/README.md diff --git a/security/rustls-client-cert/certs/client-cert.pem b/https-tls/rustls-client-cert/certs/client-cert.pem similarity index 100% rename from security/rustls-client-cert/certs/client-cert.pem rename to https-tls/rustls-client-cert/certs/client-cert.pem diff --git a/security/rustls-client-cert/certs/client-key.pem b/https-tls/rustls-client-cert/certs/client-key.pem similarity index 100% rename from security/rustls-client-cert/certs/client-key.pem rename to https-tls/rustls-client-cert/certs/client-key.pem diff --git a/security/rustls-client-cert/certs/rootCA-key.pem b/https-tls/rustls-client-cert/certs/rootCA-key.pem similarity index 100% rename from security/rustls-client-cert/certs/rootCA-key.pem rename to https-tls/rustls-client-cert/certs/rootCA-key.pem diff --git a/security/rustls-client-cert/certs/rootCA.pem b/https-tls/rustls-client-cert/certs/rootCA.pem similarity index 100% rename from security/rustls-client-cert/certs/rootCA.pem rename to https-tls/rustls-client-cert/certs/rootCA.pem diff --git a/security/rustls-client-cert/certs/server-cert.pem b/https-tls/rustls-client-cert/certs/server-cert.pem similarity index 100% rename from security/rustls-client-cert/certs/server-cert.pem rename to https-tls/rustls-client-cert/certs/server-cert.pem diff --git a/security/rustls-client-cert/certs/server-key.pem b/https-tls/rustls-client-cert/certs/server-key.pem similarity index 100% rename from security/rustls-client-cert/certs/server-key.pem rename to https-tls/rustls-client-cert/certs/server-key.pem diff --git a/security/rustls-client-cert/src/main.rs b/https-tls/rustls-client-cert/src/main.rs similarity index 100% rename from security/rustls-client-cert/src/main.rs rename to https-tls/rustls-client-cert/src/main.rs diff --git a/security/rustls/Cargo.toml b/https-tls/rustls/Cargo.toml similarity index 100% rename from security/rustls/Cargo.toml rename to https-tls/rustls/Cargo.toml diff --git a/security/rustls/README.md b/https-tls/rustls/README.md similarity index 100% rename from security/rustls/README.md rename to https-tls/rustls/README.md diff --git a/security/rustls/cert.pem b/https-tls/rustls/cert.pem similarity index 100% rename from security/rustls/cert.pem rename to https-tls/rustls/cert.pem diff --git a/security/rustls/key.pem b/https-tls/rustls/key.pem similarity index 100% rename from security/rustls/key.pem rename to https-tls/rustls/key.pem diff --git a/security/rustls/src/main.rs b/https-tls/rustls/src/main.rs similarity index 100% rename from security/rustls/src/main.rs rename to https-tls/rustls/src/main.rs diff --git a/basics/middleware-ext-mut/Cargo.toml b/middleware/middleware-ext-mut/Cargo.toml similarity index 100% rename from basics/middleware-ext-mut/Cargo.toml rename to middleware/middleware-ext-mut/Cargo.toml diff --git a/basics/middleware-ext-mut/README.md b/middleware/middleware-ext-mut/README.md similarity index 100% rename from basics/middleware-ext-mut/README.md rename to middleware/middleware-ext-mut/README.md diff --git a/basics/middleware-ext-mut/src/add_msg.rs b/middleware/middleware-ext-mut/src/add_msg.rs similarity index 100% rename from basics/middleware-ext-mut/src/add_msg.rs rename to middleware/middleware-ext-mut/src/add_msg.rs diff --git a/basics/middleware-ext-mut/src/main.rs b/middleware/middleware-ext-mut/src/main.rs similarity index 100% rename from basics/middleware-ext-mut/src/main.rs rename to middleware/middleware-ext-mut/src/main.rs diff --git a/basics/middleware-http-to-https/Cargo.toml b/middleware/middleware-http-to-https/Cargo.toml similarity index 100% rename from basics/middleware-http-to-https/Cargo.toml rename to middleware/middleware-http-to-https/Cargo.toml diff --git a/basics/middleware-http-to-https/README.md b/middleware/middleware-http-to-https/README.md similarity index 100% rename from basics/middleware-http-to-https/README.md rename to middleware/middleware-http-to-https/README.md diff --git a/basics/middleware-http-to-https/cert.pem b/middleware/middleware-http-to-https/cert.pem similarity index 100% rename from basics/middleware-http-to-https/cert.pem rename to middleware/middleware-http-to-https/cert.pem diff --git a/basics/middleware-http-to-https/key.pem b/middleware/middleware-http-to-https/key.pem similarity index 100% rename from basics/middleware-http-to-https/key.pem rename to middleware/middleware-http-to-https/key.pem diff --git a/basics/middleware-http-to-https/src/main.rs b/middleware/middleware-http-to-https/src/main.rs similarity index 100% rename from basics/middleware-http-to-https/src/main.rs rename to middleware/middleware-http-to-https/src/main.rs diff --git a/basics/middleware/Cargo.toml b/middleware/middleware/Cargo.toml similarity index 100% rename from basics/middleware/Cargo.toml rename to middleware/middleware/Cargo.toml diff --git a/basics/middleware/README.md b/middleware/middleware/README.md similarity index 100% rename from basics/middleware/README.md rename to middleware/middleware/README.md diff --git a/basics/middleware/src/main.rs b/middleware/middleware/src/main.rs similarity index 100% rename from basics/middleware/src/main.rs rename to middleware/middleware/src/main.rs diff --git a/basics/middleware/src/read_request_body.rs b/middleware/middleware/src/read_request_body.rs similarity index 100% rename from basics/middleware/src/read_request_body.rs rename to middleware/middleware/src/read_request_body.rs diff --git a/basics/middleware/src/read_response_body.rs b/middleware/middleware/src/read_response_body.rs similarity index 100% rename from basics/middleware/src/read_response_body.rs rename to middleware/middleware/src/read_response_body.rs diff --git a/basics/middleware/src/redirect.rs b/middleware/middleware/src/redirect.rs similarity index 100% rename from basics/middleware/src/redirect.rs rename to middleware/middleware/src/redirect.rs diff --git a/basics/middleware/src/simple.rs b/middleware/middleware/src/simple.rs similarity index 100% rename from basics/middleware/src/simple.rs rename to middleware/middleware/src/simple.rs diff --git a/other/protobuf/.gitignore b/protobuf/.gitignore similarity index 100% rename from other/protobuf/.gitignore rename to protobuf/.gitignore diff --git a/other/protobuf/Cargo.toml b/protobuf/Cargo.toml similarity index 100% rename from other/protobuf/Cargo.toml rename to protobuf/Cargo.toml diff --git a/other/protobuf/README.md b/protobuf/README.md similarity index 100% rename from other/protobuf/README.md rename to protobuf/README.md diff --git a/other/protobuf/client.py b/protobuf/client.py similarity index 100% rename from other/protobuf/client.py rename to protobuf/client.py diff --git a/other/protobuf/src/main.rs b/protobuf/src/main.rs similarity index 100% rename from other/protobuf/src/main.rs rename to protobuf/src/main.rs diff --git a/other/protobuf/test.proto b/protobuf/test.proto similarity index 100% rename from other/protobuf/test.proto rename to protobuf/test.proto diff --git a/other/protobuf/test_pb2.py b/protobuf/test_pb2.py similarity index 100% rename from other/protobuf/test_pb2.py rename to protobuf/test_pb2.py diff --git a/other/run-in-thread/Cargo.toml b/run-in-thread/Cargo.toml similarity index 100% rename from other/run-in-thread/Cargo.toml rename to run-in-thread/Cargo.toml diff --git a/other/run-in-thread/src/main.rs b/run-in-thread/src/main.rs similarity index 85% rename from other/run-in-thread/src/main.rs rename to run-in-thread/src/main.rs index 088b7f8..8de935e 100644 --- a/other/run-in-thread/src/main.rs +++ b/run-in-thread/src/main.rs @@ -1,3 +1,7 @@ +//! Since Actix Web v4, this method is not necessary in order to spawn additional servers alongside +//! your web server since the `Server` object can simply be `spawn`ed. This is kept to illustrate +//! how to run Actix Web from a sync context. + use std::{sync::mpsc, thread, time}; use actix_web::{dev::ServerHandle, middleware, rt, web, App, HttpRequest, HttpServer}; diff --git a/other/server-sent-events/Cargo.toml b/server-sent-events/Cargo.toml similarity index 100% rename from other/server-sent-events/Cargo.toml rename to server-sent-events/Cargo.toml diff --git a/other/server-sent-events/README.md b/server-sent-events/README.md similarity index 100% rename from other/server-sent-events/README.md rename to server-sent-events/README.md diff --git a/other/server-sent-events/benchmark.js b/server-sent-events/benchmark.js similarity index 100% rename from other/server-sent-events/benchmark.js rename to server-sent-events/benchmark.js diff --git a/other/server-sent-events/drain.js b/server-sent-events/drain.js similarity index 100% rename from other/server-sent-events/drain.js rename to server-sent-events/drain.js diff --git a/other/server-sent-events/src/broadcast.rs b/server-sent-events/src/broadcast.rs similarity index 100% rename from other/server-sent-events/src/broadcast.rs rename to server-sent-events/src/broadcast.rs diff --git a/other/server-sent-events/src/index.html b/server-sent-events/src/index.html similarity index 100% rename from other/server-sent-events/src/index.html rename to server-sent-events/src/index.html diff --git a/other/server-sent-events/src/main.rs b/server-sent-events/src/main.rs similarity index 100% rename from other/server-sent-events/src/main.rs rename to server-sent-events/src/main.rs diff --git a/basics/shutdown-server/Cargo.toml b/shutdown-server/Cargo.toml similarity index 100% rename from basics/shutdown-server/Cargo.toml rename to shutdown-server/Cargo.toml diff --git a/basics/shutdown-server/README.md b/shutdown-server/README.md similarity index 100% rename from basics/shutdown-server/README.md rename to shutdown-server/README.md diff --git a/basics/shutdown-server/src/main.rs b/shutdown-server/src/main.rs similarity index 100% rename from basics/shutdown-server/src/main.rs rename to shutdown-server/src/main.rs diff --git a/template_engines/askama/Cargo.toml b/templating/askama/Cargo.toml similarity index 100% rename from template_engines/askama/Cargo.toml rename to templating/askama/Cargo.toml diff --git a/template_engines/askama/src/main.rs b/templating/askama/src/main.rs similarity index 100% rename from template_engines/askama/src/main.rs rename to templating/askama/src/main.rs diff --git a/template_engines/askama/templates/index.html b/templating/askama/templates/index.html similarity index 100% rename from template_engines/askama/templates/index.html rename to templating/askama/templates/index.html diff --git a/template_engines/askama/templates/user.html b/templating/askama/templates/user.html similarity index 100% rename from template_engines/askama/templates/user.html rename to templating/askama/templates/user.html diff --git a/template_engines/handlebars/Cargo.toml b/templating/handlebars/Cargo.toml similarity index 100% rename from template_engines/handlebars/Cargo.toml rename to templating/handlebars/Cargo.toml diff --git a/template_engines/handlebars/README.md b/templating/handlebars/README.md similarity index 100% rename from template_engines/handlebars/README.md rename to templating/handlebars/README.md diff --git a/template_engines/handlebars/src/main.rs b/templating/handlebars/src/main.rs similarity index 100% rename from template_engines/handlebars/src/main.rs rename to templating/handlebars/src/main.rs diff --git a/template_engines/handlebars/static/templates/error.html b/templating/handlebars/static/templates/error.html similarity index 100% rename from template_engines/handlebars/static/templates/error.html rename to templating/handlebars/static/templates/error.html diff --git a/template_engines/handlebars/static/templates/index.html b/templating/handlebars/static/templates/index.html similarity index 100% rename from template_engines/handlebars/static/templates/index.html rename to templating/handlebars/static/templates/index.html diff --git a/template_engines/handlebars/static/templates/user.html b/templating/handlebars/static/templates/user.html similarity index 100% rename from template_engines/handlebars/static/templates/user.html rename to templating/handlebars/static/templates/user.html diff --git a/template_engines/sailfish/Cargo.toml b/templating/sailfish/Cargo.toml similarity index 100% rename from template_engines/sailfish/Cargo.toml rename to templating/sailfish/Cargo.toml diff --git a/template_engines/sailfish/README.md b/templating/sailfish/README.md similarity index 100% rename from template_engines/sailfish/README.md rename to templating/sailfish/README.md diff --git a/template_engines/sailfish/src/main.rs b/templating/sailfish/src/main.rs similarity index 100% rename from template_engines/sailfish/src/main.rs rename to templating/sailfish/src/main.rs diff --git a/template_engines/sailfish/templates/actix.stpl b/templating/sailfish/templates/actix.stpl similarity index 100% rename from template_engines/sailfish/templates/actix.stpl rename to templating/sailfish/templates/actix.stpl diff --git a/template_engines/sailfish/templates/page.stpl b/templating/sailfish/templates/page.stpl similarity index 100% rename from template_engines/sailfish/templates/page.stpl rename to templating/sailfish/templates/page.stpl diff --git a/template_engines/tera/Cargo.toml b/templating/tera/Cargo.toml similarity index 100% rename from template_engines/tera/Cargo.toml rename to templating/tera/Cargo.toml diff --git a/template_engines/tera/README.md b/templating/tera/README.md similarity index 100% rename from template_engines/tera/README.md rename to templating/tera/README.md diff --git a/template_engines/tera/src/main.rs b/templating/tera/src/main.rs similarity index 100% rename from template_engines/tera/src/main.rs rename to templating/tera/src/main.rs diff --git a/template_engines/tera/templates/error.html b/templating/tera/templates/error.html similarity index 100% rename from template_engines/tera/templates/error.html rename to templating/tera/templates/error.html diff --git a/template_engines/tera/templates/index.html b/templating/tera/templates/index.html similarity index 100% rename from template_engines/tera/templates/index.html rename to templating/tera/templates/index.html diff --git a/template_engines/tera/templates/user.html b/templating/tera/templates/user.html similarity index 100% rename from template_engines/tera/templates/user.html rename to templating/tera/templates/user.html diff --git a/template_engines/tinytemplate/Cargo.toml b/templating/tinytemplate/Cargo.toml similarity index 100% rename from template_engines/tinytemplate/Cargo.toml rename to templating/tinytemplate/Cargo.toml diff --git a/template_engines/tinytemplate/README.md b/templating/tinytemplate/README.md similarity index 100% rename from template_engines/tinytemplate/README.md rename to templating/tinytemplate/README.md diff --git a/template_engines/tinytemplate/src/main.rs b/templating/tinytemplate/src/main.rs similarity index 100% rename from template_engines/tinytemplate/src/main.rs rename to templating/tinytemplate/src/main.rs diff --git a/template_engines/tinytemplate/templates/error.html b/templating/tinytemplate/templates/error.html similarity index 100% rename from template_engines/tinytemplate/templates/error.html rename to templating/tinytemplate/templates/error.html diff --git a/template_engines/tinytemplate/templates/index.html b/templating/tinytemplate/templates/index.html similarity index 100% rename from template_engines/tinytemplate/templates/index.html rename to templating/tinytemplate/templates/index.html diff --git a/template_engines/tinytemplate/templates/user.html b/templating/tinytemplate/templates/user.html similarity index 100% rename from template_engines/tinytemplate/templates/user.html rename to templating/tinytemplate/templates/user.html diff --git a/template_engines/yarte/Cargo.toml b/templating/yarte/Cargo.toml similarity index 100% rename from template_engines/yarte/Cargo.toml rename to templating/yarte/Cargo.toml diff --git a/template_engines/yarte/README.md b/templating/yarte/README.md similarity index 100% rename from template_engines/yarte/README.md rename to templating/yarte/README.md diff --git a/template_engines/yarte/build.rs b/templating/yarte/build.rs similarity index 100% rename from template_engines/yarte/build.rs rename to templating/yarte/build.rs diff --git a/template_engines/yarte/src/main.rs b/templating/yarte/src/main.rs similarity index 100% rename from template_engines/yarte/src/main.rs rename to templating/yarte/src/main.rs diff --git a/template_engines/yarte/templates/base.hbs b/templating/yarte/templates/base.hbs similarity index 100% rename from template_engines/yarte/templates/base.hbs rename to templating/yarte/templates/base.hbs diff --git a/template_engines/yarte/templates/deep/more/card/form.hbs b/templating/yarte/templates/deep/more/card/form.hbs similarity index 100% rename from template_engines/yarte/templates/deep/more/card/form.hbs rename to templating/yarte/templates/deep/more/card/form.hbs diff --git a/template_engines/yarte/templates/deep/more/card/hi.hbs b/templating/yarte/templates/deep/more/card/hi.hbs similarity index 100% rename from template_engines/yarte/templates/deep/more/card/hi.hbs rename to templating/yarte/templates/deep/more/card/hi.hbs diff --git a/template_engines/yarte/templates/deep/more/deep/welcome.hbs b/templating/yarte/templates/deep/more/deep/welcome.hbs similarity index 100% rename from template_engines/yarte/templates/deep/more/deep/welcome.hbs rename to templating/yarte/templates/deep/more/deep/welcome.hbs diff --git a/template_engines/yarte/templates/deep/more/doc/head.hbs b/templating/yarte/templates/deep/more/doc/head.hbs similarity index 100% rename from template_engines/yarte/templates/deep/more/doc/head.hbs rename to templating/yarte/templates/deep/more/doc/head.hbs diff --git a/template_engines/yarte/templates/deep/more/doc/t.hbs b/templating/yarte/templates/deep/more/doc/t.hbs similarity index 100% rename from template_engines/yarte/templates/deep/more/doc/t.hbs rename to templating/yarte/templates/deep/more/doc/t.hbs diff --git a/template_engines/yarte/templates/index.hbs b/templating/yarte/templates/index.hbs similarity index 100% rename from template_engines/yarte/templates/index.hbs rename to templating/yarte/templates/index.hbs diff --git a/template_engines/yarte/yarte.toml b/templating/yarte/yarte.toml similarity index 100% rename from template_engines/yarte/yarte.toml rename to templating/yarte/yarte.toml diff --git a/other/unix-socket/Cargo.toml b/unix-socket/Cargo.toml similarity index 100% rename from other/unix-socket/Cargo.toml rename to unix-socket/Cargo.toml diff --git a/other/unix-socket/README.md b/unix-socket/README.md similarity index 100% rename from other/unix-socket/README.md rename to unix-socket/README.md diff --git a/other/unix-socket/src/main.rs b/unix-socket/src/main.rs similarity index 100% rename from other/unix-socket/src/main.rs rename to unix-socket/src/main.rs