8 breaking releases
0.10.0 | Jul 27, 2021 |
---|---|
0.7.0 | Jun 5, 2021 |
#26 in #redis-cluster
175KB
4.5K
SLoC
salak_factory
A resource initialization factory using salak.
Please refer to salak factory doc.
Provide Resources
- redis_default
- redis_cluster
- postgres
lib.rs
:
A resource initialization factory using salak
.
salak
is a zero-boilerplate configuration parser, it can
parsing struct from a unified Environment
. After
we got the config struct, we can continue to initialize
resource from it. That means we have a unified way to
package the initialization process of resources, by specifying
configuration properties, and provide a customizer to customize
resource by coding.
Provide Resources
- redis
use salak::*;
use salak_factory::*;
use salak_factory::redis_default::*;
let env = Salak::new().unwrap();
let redis_pool = env.init_resource::<RedisPool>().unwrap();
- redis_cluster
use salak::*;
use salak_factory::*;
use salak_factory::redis_cluster::*;
let env = Salak::new().unwrap();
let redis_cluster_pool = env.init_resource::<RedisClusterPool>().unwrap();
- postgres
use salak::*;
use salak_factory::*;
use salak_factory::postgresql::*;
let env = Salak::new().unwrap();
let pg_pool = env.init_resource::<PostgresPool>().unwrap();
Dependencies
~1–15MB
~208K SLoC