-
Notifications
You must be signed in to change notification settings - Fork 12
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Pratik Mishra
authored and
Pratik Mishra
committed
May 17, 2024
1 parent
0c9d070
commit 3ae53b5
Showing
25 changed files
with
457 additions
and
187 deletions.
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
crates/context_aware_config/migrations/2024-04-22-122806_config_verions/down.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
-- This file should undo anything in `up.sql` |
11 changes: 11 additions & 0 deletions
11
crates/context_aware_config/migrations/2024-04-22-122806_config_verions/up.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
-- Your SQL goes here | ||
-- Name: functions; Type: TABLE; Schema: public; Owner: - | ||
-- | ||
CREATE TABLE public.config_versions ( | ||
id bigint PRIMARY KEY, | ||
config json NOT NULL, | ||
config_hash TEXT NOT NULL, | ||
tags varchar(100)[] check (array_position(tags, null) is null), | ||
created_at timestamp without time zone DEFAULT CURRENT_TIMESTAMP NOT NULL | ||
); | ||
-- |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
mod handlers; | ||
pub mod handlers; | ||
mod types; | ||
pub use handlers::endpoints; | ||
mod helpers; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,17 @@ | ||
use serde::Serialize; | ||
use serde::{Deserialize, Serialize}; | ||
use serde_json::{Map, Value}; | ||
|
||
#[derive(Serialize)] | ||
#[derive(Serialize, Deserialize)] | ||
pub struct Config { | ||
pub contexts: Vec<Context>, | ||
pub overrides: Map<String, Value>, | ||
pub default_configs: Map<String, Value>, | ||
} | ||
|
||
#[derive(Serialize, Clone)] | ||
#[derive(Serialize, Clone, Deserialize)] | ||
pub struct Context { | ||
pub id: String, | ||
pub condition: Value, | ||
pub priority: i32, | ||
pub override_with_keys: [String; 1], | ||
} |
Oops, something went wrong.