This repository has been archived by the owner on Oct 17, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Define protobuf messages for policies and rules and add rule matching…
… logic
- Loading branch information
1 parent
ffa77a9
commit 2b9cb7b
Showing
16 changed files
with
1,580 additions
and
41 deletions.
There are no files selected for viewing
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,42 @@ | ||
#!/bin/bash | ||
. "$(dirname $0)/variables.sh" | ||
|
||
autogen_clear() { | ||
DIR="$1" | ||
|
||
rm -f ${DIR}/* | ||
} | ||
|
||
autogen_cleanup() { | ||
DIR="$1" | ||
|
||
FILES=${DIR}/*.go | ||
for FILE in $(ls $FILES); | ||
do | ||
add_license $FILE $DIR | ||
done | ||
} | ||
|
||
add_license() { | ||
FILE="$1" | ||
DIR="$2" | ||
|
||
# Add uber license | ||
PREV_PWD=$(pwd) | ||
cd $DIR | ||
$LICENSE_BIN --silent --file $(basename $FILE) | ||
cd $PREV_PWD | ||
} | ||
|
||
if [ $# -ne 2 ] || [ -z "$1" ] || [ -z "$2" ]; then | ||
echo "usage: auto-gen.sh output_directory file_generation_rules_directory" | ||
exit 1 | ||
fi | ||
|
||
set -e | ||
|
||
. "$(dirname $0)/variables.sh" | ||
|
||
autogen_clear $1 | ||
go generate $PACKAGE/$2 | ||
autogen_cleanup $1 |
Submodule uber-licence
added at
e35b7f
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
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,16 @@ | ||
syntax = "proto3"; | ||
package schema; | ||
|
||
message Resolution { | ||
int64 window_size = 1; | ||
int64 precision = 2; | ||
} | ||
|
||
message Retention { | ||
int64 period = 1; | ||
} | ||
|
||
message Policy { | ||
Resolution resolution = 1; | ||
Retention retention = 2; | ||
} |
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,30 @@ | ||
syntax = "proto3"; | ||
package schema; | ||
|
||
import "policy.proto"; | ||
|
||
message MappingRule { | ||
map<string,string> tag_filters = 1; | ||
repeated Policy policies = 2; | ||
} | ||
|
||
message RollupTarget { | ||
string name = 1; | ||
repeated string tags = 2; | ||
repeated Policy policies = 3; | ||
} | ||
|
||
message RollupRule { | ||
map<string,string> tag_filters = 1; | ||
repeated RollupTarget targets = 2; | ||
} | ||
|
||
message RuleSet { | ||
string namespace = 1; | ||
int64 created_at = 2; | ||
int64 last_updated_at = 3; | ||
int32 version = 4; | ||
int64 cutover = 5; | ||
repeated MappingRule mapping_rules = 6; | ||
repeated RollupRule rollup_rules = 7; | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.