Expand description
A library-first, lightweight, high-performance, cloud-native supported API gateway🪐
§🚀 Installation
see installation.md
§Special instructions for configuration
§Setting HTTP Route Priority
You can specify the priority of an httproute by adding a priority field in the annotations section of the route. A higher value for the priority field indicates a higher priority. The httproute library stores the priority value using the i64 data type, so the maximum and minimum values for the priority are i64::MAX (https://doc.rust-lang.org/std/primitive.i64.html#associatedconstant.MAX) and i64::MIN respectively.
If the priority field is not present in an httproute, its priority will be default to 0, and the default priority will be determined based on the creation order (earlier routes will have higher priority).
Note: Trace-level logs will print the contents of both the request and response bodies, potentially causing significant performance overhead. It is recommended to use debug level logs at most.
§startup
§static config
see startup_static
§by config file
see startup_file
§by k8s resource
see startup_k8s
§by redis
see startup_redis
Re-exports§
pub use hyper;
pub use spacegate_kernel as kernel;
pub use spacegate_plugin as plugin;
pub use spacegate_ext_axum as ext_axum;
pub use spacegate_ext_redis as ext_redis;
Modules§
- config
- Configuration retrieval and event listener
- ext_
features - Extended features
- extension
- http extensions
- model
- re-export spacegate_model
- server
- Spacegate service creation
Structs§
Traits§
- SgRequest
Ext - Provides extension methods for
Request
. - SgResponse
Ext - Provides extension methods for
Response
.
Functions§
- ctrl_
c_ cancel_ token - startup
- Startup the gateway
- startup_
file - Startup the gateway by config file
- startup_
k8s - Startup the gateway by k8s resource
- startup_
redis - Startup the gateway by redis
- startup_
static - Startup the gateway by static config
- wait_
graceful_ shutdown
Type Aliases§
- BoxError
- BoxResult
- SgRequest
- Alias for a request with a boxed body.
- SgResponse
- Alias for a response with a boxed body.