-
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.
Merge pull request #9 from protoconf/avivl/demoapp
configs and proto for demoapp
- Loading branch information
Showing
6 changed files
with
380 additions
and
0 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,5 @@ | ||
version: v1 | ||
plugins: | ||
- name: go | ||
out: src | ||
opt: paths=source_relative |
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,15 @@ | ||
version: v1beta1 | ||
breaking: | ||
ignore_unstable_packages: true | ||
use: | ||
- FIELD_SAME_ONEOF | ||
- FIELD_SAME_JSON_NAME | ||
- FIELD_SAME_NAME | ||
- FIELD_SAME_TYPE | ||
- FIELD_SAME_LABEL | ||
- FILE_SAME_PACKAGE | ||
- FIELD_NO_DELETE_UNLESS_NUMBER_RESERVED | ||
- FIELD_NO_DELETE_UNLESS_NAME_RESERVED | ||
build: | ||
roots: | ||
- src |
24 changes: 24 additions & 0 deletions
24
demoapp/config/materialized_config/demo/v1/demoapp.materialized_JSON
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,24 @@ | ||
{ | ||
"value": { | ||
"@type": "type.googleapis.com/demoapp.v1.DemoConfig", | ||
"title": "hello protoconf go-client!", | ||
"version": "1.0.1", | ||
"logLevel": "LOG_LEVEL_INFO" | ||
}, | ||
"rolloutConfig": { | ||
"stages": [ | ||
{ | ||
"channel": "p1", | ||
"percentile": 20 | ||
}, | ||
{ | ||
"channel": "p2", | ||
"percentile": 50 | ||
}, | ||
{ | ||
"channel": "p3", | ||
"percentile": 90 | ||
} | ||
] | ||
} | ||
} |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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,27 @@ | ||
syntax = "proto3"; | ||
|
||
package demoapp.v1; | ||
|
||
import "google/protobuf/duration.proto"; | ||
import "google/protobuf/timestamp.proto"; | ||
|
||
|
||
option go_package = "github.com/protoconf/client-go/demoapp/config/src/demo/v1;democonfig"; | ||
|
||
message DemoConfig { | ||
string pod_name = 1; | ||
string title = 2; | ||
string version = 3; | ||
LogLevel log_level = 4; | ||
google.protobuf.Duration timeout = 5; | ||
google.protobuf.Timestamp last_update = 6; | ||
uint64 total_requests = 7; | ||
|
||
enum LogLevel { | ||
LOG_LEVEL_UNSPECIFIED = 0; | ||
LOG_LEVEL_DEBUG = 1; | ||
LOG_LEVEL_INFO = 2; | ||
LOG_LEVEL_WARN = 3; | ||
LOG_LEVEL_ERROR = 4; | ||
} | ||
} |
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,22 @@ | ||
# vim: syntax=python | ||
load("//demo/v1/config.proto", "DemoConfig") | ||
load("//google/protobuf/duration.proto", "Duration") | ||
|
||
|
||
|
||
def main(): | ||
config = DemoConfig( | ||
title="hello protoconf go-client!", | ||
version="1.0.1", | ||
log_level=DemoConfig.LogLevel.LOG_LEVEL_INFO, | ||
) | ||
|
||
return ConfigRollout( | ||
config, | ||
# default_cooldown_time=Duration(seconds=20), | ||
stages=[ | ||
RolloutStage(channel="p1", percentile=20), | ||
RolloutStage(channel="p2", percentile=50), | ||
RolloutStage(channel="p3", percentile=90), | ||
], | ||
) |