openfeature-provider-flagd 0.1.2__tar.gz → 0.1.4__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/.gitignore +0 -4
- openfeature_provider_flagd-0.1.4/CHANGELOG.md +53 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/PKG-INFO +2 -2
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/pyproject.toml +7 -1
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/config.py +35 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2.py +62 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/evaluation/v1/evaluation_pb2_grpc.py +267 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2.py +40 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/flagd/sync/v1/sync_pb2_grpc.py +135 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2.py +62 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/schema/v1/schema_pb2_grpc.py +267 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2.py +37 -0
- openfeature_provider_flagd-0.1.4/src/openfeature/contrib/provider/flagd/proto/sync/v1/sync_service_pb2_grpc.py +102 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/src/openfeature/contrib/provider/flagd/provider.py +52 -60
- openfeature_provider_flagd-0.1.4/tests/test_config.py +29 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/tests/test_flagd.py +8 -0
- openfeature_provider_flagd-0.1.2/CHANGELOG.md +0 -21
- openfeature_provider_flagd-0.1.2/src/openfeature/contrib/provider/flagd/defaults.py +0 -5
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/LICENSE +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/README.md +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/scripts/gen_protos.sh +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/src/openfeature/contrib/provider/flagd/__init__.py +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/src/openfeature/contrib/provider/flagd/flag_type.py +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/tests/__init__.py +0 -0
- {openfeature_provider_flagd-0.1.2 → openfeature_provider_flagd-0.1.4}/tests/conftest.py +0 -0
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
## [0.1.4](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.3...openfeature-provider-flagd/v0.1.4) (2024-03-26)
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
### 🐛 Bug Fixes
|
|
7
|
+
|
|
8
|
+
* include targetingKey in flagd serialized evaluation context ([#58](https://github.com/open-feature/python-sdk-contrib/issues/58)) ([ddd79a4](https://github.com/open-feature/python-sdk-contrib/commit/ddd79a49b765aa0679a2c1938447c61b37b6d0fe))
|
|
9
|
+
* respect timeout setting in grpc method calls ([#60](https://github.com/open-feature/python-sdk-contrib/issues/60)) ([0149cf7](https://github.com/open-feature/python-sdk-contrib/commit/0149cf7ced8116f54a9b220549834a1970460bd9))
|
|
10
|
+
* return proper metadata object in FlagdProvider ([#59](https://github.com/open-feature/python-sdk-contrib/issues/59)) ([6508234](https://github.com/open-feature/python-sdk-contrib/commit/6508234486ba0b650e849cbee22505988233131a))
|
|
11
|
+
|
|
12
|
+
|
|
13
|
+
### ✨ New Features
|
|
14
|
+
|
|
15
|
+
* implement environment-variable based config ([#62](https://github.com/open-feature/python-sdk-contrib/issues/62)) ([a8b78b2](https://github.com/open-feature/python-sdk-contrib/commit/a8b78b28fe44ca712b00db04ac1a23a9c9bc6d9b))
|
|
16
|
+
* replace schema with tls argument in FlagdProvider constructor ([#61](https://github.com/open-feature/python-sdk-contrib/issues/61)) ([7a7210f](https://github.com/open-feature/python-sdk-contrib/commit/7a7210f6f63a9cba886f4d512c01ebac39d910a9))
|
|
17
|
+
|
|
18
|
+
|
|
19
|
+
### 🧹 Chore
|
|
20
|
+
|
|
21
|
+
* exclude generated protobuf files from coverage report ([#51](https://github.com/open-feature/python-sdk-contrib/issues/51)) ([660a0cb](https://github.com/open-feature/python-sdk-contrib/commit/660a0cbc9bb932ac0dd9cb09f1d75177b161601b))
|
|
22
|
+
|
|
23
|
+
|
|
24
|
+
### 🔄 Refactoring
|
|
25
|
+
|
|
26
|
+
* add mypy and fix typing issues ([#72](https://github.com/open-feature/python-sdk-contrib/issues/72)) ([b405925](https://github.com/open-feature/python-sdk-contrib/commit/b4059255045cdb7054a35bc338207e23c42ce068))
|
|
27
|
+
|
|
28
|
+
## [0.1.3](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd/v0.1.2...openfeature-provider-flagd/v0.1.3) (2024-02-23)
|
|
29
|
+
|
|
30
|
+
|
|
31
|
+
### 🐛 Bug Fixes
|
|
32
|
+
|
|
33
|
+
* include proto file in build for openfeature-provider-flagd ([#45](https://github.com/open-feature/python-sdk-contrib/issues/45)) ([7783cc8](https://github.com/open-feature/python-sdk-contrib/commit/7783cc8e7fb8fe0f9b812938efcd1f4c07e3ff68))
|
|
34
|
+
|
|
35
|
+
## [0.1.2](https://github.com/open-feature/python-sdk-contrib/compare/openfeature-provider-flagd-v0.1.1...openfeature-provider-flagd/v0.1.2) (2024-02-22)
|
|
36
|
+
|
|
37
|
+
|
|
38
|
+
### 🐛 Bug Fixes
|
|
39
|
+
|
|
40
|
+
* remove mention of local eval in readme ([41df80e](https://github.com/open-feature/python-sdk-contrib/commit/41df80e1b3044356e3b228a484f3a13c92068d91))
|
|
41
|
+
* remove setup from flagd tests ([#39](https://github.com/open-feature/python-sdk-contrib/issues/39)) ([85661ff](https://github.com/open-feature/python-sdk-contrib/commit/85661ff170b378d37b0a3d5d0a955dad3417f538))
|
|
42
|
+
|
|
43
|
+
|
|
44
|
+
### 🧹 Chore
|
|
45
|
+
|
|
46
|
+
* **main:** release providers/flagd 0.1.1 ([#40](https://github.com/open-feature/python-sdk-contrib/issues/40)) ([d42ee1e](https://github.com/open-feature/python-sdk-contrib/commit/d42ee1e531249e0023456dbe46db2f4f0c52a5c5))
|
|
47
|
+
|
|
48
|
+
## [0.1.1](https://github.com/open-feature/python-sdk-contrib/compare/providers/flagd-v0.1.0...providers/flagd/v0.1.1) (2024-02-22)
|
|
49
|
+
|
|
50
|
+
|
|
51
|
+
### 🐛 Bug Fixes
|
|
52
|
+
|
|
53
|
+
* remove setup from flagd tests ([#39](https://github.com/open-feature/python-sdk-contrib/issues/39)) ([85661ff](https://github.com/open-feature/python-sdk-contrib/commit/85661ff170b378d37b0a3d5d0a955dad3417f538))
|
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
Metadata-Version: 2.
|
|
1
|
+
Metadata-Version: 2.3
|
|
2
2
|
Name: openfeature-provider-flagd
|
|
3
|
-
Version: 0.1.
|
|
3
|
+
Version: 0.1.4
|
|
4
4
|
Summary: OpenFeature provider for the flagd flag evaluation engine
|
|
5
5
|
Project-URL: Homepage, https://github.com/open-feature/python-sdk-contrib
|
|
6
6
|
Author-email: OpenFeature <openfeature-core@groups.io>
|
|
@@ -5,7 +5,7 @@ build-backend = "hatchling.build"
|
|
|
5
5
|
|
|
6
6
|
[project]
|
|
7
7
|
name = "openfeature-provider-flagd"
|
|
8
|
-
version = "0.1.
|
|
8
|
+
version = "0.1.4"
|
|
9
9
|
description = "OpenFeature provider for the flagd flag evaluation engine"
|
|
10
10
|
readme = "README.md"
|
|
11
11
|
authors = [{ name = "OpenFeature", email = "openfeature-core@groups.io" }]
|
|
@@ -56,3 +56,9 @@ exclude = [
|
|
|
56
56
|
|
|
57
57
|
[tool.hatch.build.targets.wheel]
|
|
58
58
|
packages = ["src/openfeature"]
|
|
59
|
+
|
|
60
|
+
[tool.coverage.run]
|
|
61
|
+
omit = [
|
|
62
|
+
# exclude generated files
|
|
63
|
+
"src/openfeature/contrib/provider/flagd/proto/*",
|
|
64
|
+
]
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
import os
|
|
2
|
+
import typing
|
|
3
|
+
|
|
4
|
+
T = typing.TypeVar("T")
|
|
5
|
+
|
|
6
|
+
|
|
7
|
+
def str_to_bool(val: str) -> bool:
|
|
8
|
+
return val.lower() == "true"
|
|
9
|
+
|
|
10
|
+
|
|
11
|
+
def env_or_default(
|
|
12
|
+
env_var: str, default: T, cast: typing.Optional[typing.Callable[[str], T]] = None
|
|
13
|
+
) -> typing.Union[str, T]:
|
|
14
|
+
val = os.environ.get(env_var)
|
|
15
|
+
if val is None:
|
|
16
|
+
return default
|
|
17
|
+
return val if cast is None else cast(val)
|
|
18
|
+
|
|
19
|
+
|
|
20
|
+
class Config:
|
|
21
|
+
def __init__(
|
|
22
|
+
self,
|
|
23
|
+
host: typing.Optional[str] = None,
|
|
24
|
+
port: typing.Optional[int] = None,
|
|
25
|
+
tls: typing.Optional[bool] = None,
|
|
26
|
+
timeout: typing.Optional[int] = None,
|
|
27
|
+
):
|
|
28
|
+
self.host = env_or_default("FLAGD_HOST", "localhost") if host is None else host
|
|
29
|
+
self.port = (
|
|
30
|
+
env_or_default("FLAGD_PORT", 8013, cast=int) if port is None else port
|
|
31
|
+
)
|
|
32
|
+
self.tls = (
|
|
33
|
+
env_or_default("FLAGD_TLS", False, cast=str_to_bool) if tls is None else tls
|
|
34
|
+
)
|
|
35
|
+
self.timeout = 5 if timeout is None else timeout
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: flagd/evaluation/v1/evaluation.proto
|
|
4
|
+
"""Generated protocol buffer code."""
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
7
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
8
|
+
from google.protobuf.internal import builder as _builder
|
|
9
|
+
# @@protoc_insertion_point(imports)
|
|
10
|
+
|
|
11
|
+
_sym_db = _symbol_database.Default()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n$flagd/evaluation/v1/evaluation.proto\x12\x13\x66lagd.evaluation.v1\x1a\x1cgoogle/protobuf/struct.proto\"F\n\x11ResolveAllRequest\x12\x31\n\x07\x63ontext\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xb6\x01\n\x12ResolveAllResponse\x12H\n\x05\x66lags\x18\x01 \x03(\x0b\x32\x32.flagd.evaluation.v1.ResolveAllResponse.FlagsEntryR\x05\x66lags\x1aV\n\nFlagsEntry\x12\x10\n\x03key\x18\x01 \x01(\tR\x03key\x12\x32\n\x05value\x18\x02 \x01(\x0b\x32\x1c.flagd.evaluation.v1.AnyFlagR\x05value:\x02\x38\x01\"\xed\x01\n\x07\x41nyFlag\x12\x16\n\x06reason\x18\x01 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x02 \x01(\tR\x07variant\x12\x1f\n\nbool_value\x18\x03 \x01(\x08H\x00R\tboolValue\x12#\n\x0cstring_value\x18\x04 \x01(\tH\x00R\x0bstringValue\x12#\n\x0c\x64ouble_value\x18\x05 \x01(\x01H\x00R\x0b\x64oubleValue\x12<\n\x0cobject_value\x18\x06 \x01(\x0b\x32\x17.google.protobuf.StructH\x00R\x0bobjectValueB\x07\n\x05value\"e\n\x15ResolveBooleanRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x95\x01\n\x16ResolveBooleanResponse\x12\x14\n\x05value\x18\x01 \x01(\x08R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveStringRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x94\x01\n\x15ResolveStringResponse\x12\x14\n\x05value\x18\x01 \x01(\tR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"c\n\x13ResolveFloatRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x93\x01\n\x14ResolveFloatResponse\x12\x14\n\x05value\x18\x01 \x01(\x01R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"a\n\x11ResolveIntRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\x91\x01\n\x12ResolveIntResponse\x12\x14\n\x05value\x18\x01 \x01(\x03R\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"d\n\x14ResolveObjectRequest\x12\x19\n\x08\x66lag_key\x18\x01 \x01(\tR\x07\x66lagKey\x12\x31\n\x07\x63ontext\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x07\x63ontext\"\xad\x01\n\x15ResolveObjectResponse\x12-\n\x05value\x18\x01 \x01(\x0b\x32\x17.google.protobuf.StructR\x05value\x12\x16\n\x06reason\x18\x02 \x01(\tR\x06reason\x12\x18\n\x07variant\x18\x03 \x01(\tR\x07variant\x12\x33\n\x08metadata\x18\x04 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadata\"V\n\x13\x45ventStreamResponse\x12\x12\n\x04type\x18\x01 \x01(\tR\x04type\x12+\n\x04\x64\x61ta\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x04\x64\x61ta\"\x14\n\x12\x45ventStreamRequest2\xd9\x05\n\x07Service\x12_\n\nResolveAll\x12&.flagd.evaluation.v1.ResolveAllRequest\x1a\'.flagd.evaluation.v1.ResolveAllResponse\"\x00\x12k\n\x0eResolveBoolean\x12*.flagd.evaluation.v1.ResolveBooleanRequest\x1a+.flagd.evaluation.v1.ResolveBooleanResponse\"\x00\x12h\n\rResolveString\x12).flagd.evaluation.v1.ResolveStringRequest\x1a*.flagd.evaluation.v1.ResolveStringResponse\"\x00\x12\x65\n\x0cResolveFloat\x12(.flagd.evaluation.v1.ResolveFloatRequest\x1a).flagd.evaluation.v1.ResolveFloatResponse\"\x00\x12_\n\nResolveInt\x12&.flagd.evaluation.v1.ResolveIntRequest\x1a\'.flagd.evaluation.v1.ResolveIntResponse\"\x00\x12h\n\rResolveObject\x12).flagd.evaluation.v1.ResolveObjectRequest\x1a*.flagd.evaluation.v1.ResolveObjectResponse\"\x00\x12\x64\n\x0b\x45ventStream\x12\'.flagd.evaluation.v1.EventStreamRequest\x1a(.flagd.evaluation.v1.EventStreamResponse\"\x00\x30\x01\x42\xad\x01\n\x17\x63om.flagd.evaluation.v1B\x0f\x45valuationProtoP\x01Z\x13\x66lagd/evaluation/v1\xa2\x02\x03\x46\x45X\xaa\x02\x13\x46lagd.Evaluation.V1\xca\x02\x13\x46lagd\\Evaluation\\V1\xe2\x02\x1f\x46lagd\\Evaluation\\V1\\GPBMetadata\xea\x02\x15\x46lagd::Evaluation::V1b\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flagd.evaluation.v1.evaluation_pb2', _globals)
|
|
22
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
+
|
|
24
|
+
DESCRIPTOR._options = None
|
|
25
|
+
DESCRIPTOR._serialized_options = b'\n\027com.flagd.evaluation.v1B\017EvaluationProtoP\001Z\023flagd/evaluation/v1\242\002\003FEX\252\002\023Flagd.Evaluation.V1\312\002\023Flagd\\Evaluation\\V1\342\002\037Flagd\\Evaluation\\V1\\GPBMetadata\352\002\025Flagd::Evaluation::V1'
|
|
26
|
+
_RESOLVEALLRESPONSE_FLAGSENTRY._options = None
|
|
27
|
+
_RESOLVEALLRESPONSE_FLAGSENTRY._serialized_options = b'8\001'
|
|
28
|
+
_globals['_RESOLVEALLREQUEST']._serialized_start=91
|
|
29
|
+
_globals['_RESOLVEALLREQUEST']._serialized_end=161
|
|
30
|
+
_globals['_RESOLVEALLRESPONSE']._serialized_start=164
|
|
31
|
+
_globals['_RESOLVEALLRESPONSE']._serialized_end=346
|
|
32
|
+
_globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_start=260
|
|
33
|
+
_globals['_RESOLVEALLRESPONSE_FLAGSENTRY']._serialized_end=346
|
|
34
|
+
_globals['_ANYFLAG']._serialized_start=349
|
|
35
|
+
_globals['_ANYFLAG']._serialized_end=586
|
|
36
|
+
_globals['_RESOLVEBOOLEANREQUEST']._serialized_start=588
|
|
37
|
+
_globals['_RESOLVEBOOLEANREQUEST']._serialized_end=689
|
|
38
|
+
_globals['_RESOLVEBOOLEANRESPONSE']._serialized_start=692
|
|
39
|
+
_globals['_RESOLVEBOOLEANRESPONSE']._serialized_end=841
|
|
40
|
+
_globals['_RESOLVESTRINGREQUEST']._serialized_start=843
|
|
41
|
+
_globals['_RESOLVESTRINGREQUEST']._serialized_end=943
|
|
42
|
+
_globals['_RESOLVESTRINGRESPONSE']._serialized_start=946
|
|
43
|
+
_globals['_RESOLVESTRINGRESPONSE']._serialized_end=1094
|
|
44
|
+
_globals['_RESOLVEFLOATREQUEST']._serialized_start=1096
|
|
45
|
+
_globals['_RESOLVEFLOATREQUEST']._serialized_end=1195
|
|
46
|
+
_globals['_RESOLVEFLOATRESPONSE']._serialized_start=1198
|
|
47
|
+
_globals['_RESOLVEFLOATRESPONSE']._serialized_end=1345
|
|
48
|
+
_globals['_RESOLVEINTREQUEST']._serialized_start=1347
|
|
49
|
+
_globals['_RESOLVEINTREQUEST']._serialized_end=1444
|
|
50
|
+
_globals['_RESOLVEINTRESPONSE']._serialized_start=1447
|
|
51
|
+
_globals['_RESOLVEINTRESPONSE']._serialized_end=1592
|
|
52
|
+
_globals['_RESOLVEOBJECTREQUEST']._serialized_start=1594
|
|
53
|
+
_globals['_RESOLVEOBJECTREQUEST']._serialized_end=1694
|
|
54
|
+
_globals['_RESOLVEOBJECTRESPONSE']._serialized_start=1697
|
|
55
|
+
_globals['_RESOLVEOBJECTRESPONSE']._serialized_end=1870
|
|
56
|
+
_globals['_EVENTSTREAMRESPONSE']._serialized_start=1872
|
|
57
|
+
_globals['_EVENTSTREAMRESPONSE']._serialized_end=1958
|
|
58
|
+
_globals['_EVENTSTREAMREQUEST']._serialized_start=1960
|
|
59
|
+
_globals['_EVENTSTREAMREQUEST']._serialized_end=1980
|
|
60
|
+
_globals['_SERVICE']._serialized_start=1983
|
|
61
|
+
_globals['_SERVICE']._serialized_end=2712
|
|
62
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,267 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from flagd.evaluation.v1 import evaluation_pb2 as flagd_dot_evaluation_dot_v1_dot_evaluation__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class ServiceStub(object):
|
|
9
|
+
"""Service defines the exposed rpcs of flagd
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.ResolveAll = channel.unary_unary(
|
|
19
|
+
'/flagd.evaluation.v1.Service/ResolveAll',
|
|
20
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString,
|
|
21
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString,
|
|
22
|
+
)
|
|
23
|
+
self.ResolveBoolean = channel.unary_unary(
|
|
24
|
+
'/flagd.evaluation.v1.Service/ResolveBoolean',
|
|
25
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString,
|
|
26
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString,
|
|
27
|
+
)
|
|
28
|
+
self.ResolveString = channel.unary_unary(
|
|
29
|
+
'/flagd.evaluation.v1.Service/ResolveString',
|
|
30
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString,
|
|
31
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString,
|
|
32
|
+
)
|
|
33
|
+
self.ResolveFloat = channel.unary_unary(
|
|
34
|
+
'/flagd.evaluation.v1.Service/ResolveFloat',
|
|
35
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString,
|
|
36
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString,
|
|
37
|
+
)
|
|
38
|
+
self.ResolveInt = channel.unary_unary(
|
|
39
|
+
'/flagd.evaluation.v1.Service/ResolveInt',
|
|
40
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString,
|
|
41
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString,
|
|
42
|
+
)
|
|
43
|
+
self.ResolveObject = channel.unary_unary(
|
|
44
|
+
'/flagd.evaluation.v1.Service/ResolveObject',
|
|
45
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString,
|
|
46
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString,
|
|
47
|
+
)
|
|
48
|
+
self.EventStream = channel.unary_stream(
|
|
49
|
+
'/flagd.evaluation.v1.Service/EventStream',
|
|
50
|
+
request_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString,
|
|
51
|
+
response_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString,
|
|
52
|
+
)
|
|
53
|
+
|
|
54
|
+
|
|
55
|
+
class ServiceServicer(object):
|
|
56
|
+
"""Service defines the exposed rpcs of flagd
|
|
57
|
+
"""
|
|
58
|
+
|
|
59
|
+
def ResolveAll(self, request, context):
|
|
60
|
+
"""Missing associated documentation comment in .proto file."""
|
|
61
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
62
|
+
context.set_details('Method not implemented!')
|
|
63
|
+
raise NotImplementedError('Method not implemented!')
|
|
64
|
+
|
|
65
|
+
def ResolveBoolean(self, request, context):
|
|
66
|
+
"""Missing associated documentation comment in .proto file."""
|
|
67
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
68
|
+
context.set_details('Method not implemented!')
|
|
69
|
+
raise NotImplementedError('Method not implemented!')
|
|
70
|
+
|
|
71
|
+
def ResolveString(self, request, context):
|
|
72
|
+
"""Missing associated documentation comment in .proto file."""
|
|
73
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
74
|
+
context.set_details('Method not implemented!')
|
|
75
|
+
raise NotImplementedError('Method not implemented!')
|
|
76
|
+
|
|
77
|
+
def ResolveFloat(self, request, context):
|
|
78
|
+
"""Missing associated documentation comment in .proto file."""
|
|
79
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
80
|
+
context.set_details('Method not implemented!')
|
|
81
|
+
raise NotImplementedError('Method not implemented!')
|
|
82
|
+
|
|
83
|
+
def ResolveInt(self, request, context):
|
|
84
|
+
"""Missing associated documentation comment in .proto file."""
|
|
85
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
86
|
+
context.set_details('Method not implemented!')
|
|
87
|
+
raise NotImplementedError('Method not implemented!')
|
|
88
|
+
|
|
89
|
+
def ResolveObject(self, request, context):
|
|
90
|
+
"""Missing associated documentation comment in .proto file."""
|
|
91
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
92
|
+
context.set_details('Method not implemented!')
|
|
93
|
+
raise NotImplementedError('Method not implemented!')
|
|
94
|
+
|
|
95
|
+
def EventStream(self, request, context):
|
|
96
|
+
"""Missing associated documentation comment in .proto file."""
|
|
97
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
98
|
+
context.set_details('Method not implemented!')
|
|
99
|
+
raise NotImplementedError('Method not implemented!')
|
|
100
|
+
|
|
101
|
+
|
|
102
|
+
def add_ServiceServicer_to_server(servicer, server):
|
|
103
|
+
rpc_method_handlers = {
|
|
104
|
+
'ResolveAll': grpc.unary_unary_rpc_method_handler(
|
|
105
|
+
servicer.ResolveAll,
|
|
106
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.FromString,
|
|
107
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.SerializeToString,
|
|
108
|
+
),
|
|
109
|
+
'ResolveBoolean': grpc.unary_unary_rpc_method_handler(
|
|
110
|
+
servicer.ResolveBoolean,
|
|
111
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.FromString,
|
|
112
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.SerializeToString,
|
|
113
|
+
),
|
|
114
|
+
'ResolveString': grpc.unary_unary_rpc_method_handler(
|
|
115
|
+
servicer.ResolveString,
|
|
116
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.FromString,
|
|
117
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.SerializeToString,
|
|
118
|
+
),
|
|
119
|
+
'ResolveFloat': grpc.unary_unary_rpc_method_handler(
|
|
120
|
+
servicer.ResolveFloat,
|
|
121
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.FromString,
|
|
122
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.SerializeToString,
|
|
123
|
+
),
|
|
124
|
+
'ResolveInt': grpc.unary_unary_rpc_method_handler(
|
|
125
|
+
servicer.ResolveInt,
|
|
126
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.FromString,
|
|
127
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.SerializeToString,
|
|
128
|
+
),
|
|
129
|
+
'ResolveObject': grpc.unary_unary_rpc_method_handler(
|
|
130
|
+
servicer.ResolveObject,
|
|
131
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.FromString,
|
|
132
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.SerializeToString,
|
|
133
|
+
),
|
|
134
|
+
'EventStream': grpc.unary_stream_rpc_method_handler(
|
|
135
|
+
servicer.EventStream,
|
|
136
|
+
request_deserializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.FromString,
|
|
137
|
+
response_serializer=flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.SerializeToString,
|
|
138
|
+
),
|
|
139
|
+
}
|
|
140
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
141
|
+
'flagd.evaluation.v1.Service', rpc_method_handlers)
|
|
142
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
143
|
+
|
|
144
|
+
|
|
145
|
+
# This class is part of an EXPERIMENTAL API.
|
|
146
|
+
class Service(object):
|
|
147
|
+
"""Service defines the exposed rpcs of flagd
|
|
148
|
+
"""
|
|
149
|
+
|
|
150
|
+
@staticmethod
|
|
151
|
+
def ResolveAll(request,
|
|
152
|
+
target,
|
|
153
|
+
options=(),
|
|
154
|
+
channel_credentials=None,
|
|
155
|
+
call_credentials=None,
|
|
156
|
+
insecure=False,
|
|
157
|
+
compression=None,
|
|
158
|
+
wait_for_ready=None,
|
|
159
|
+
timeout=None,
|
|
160
|
+
metadata=None):
|
|
161
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveAll',
|
|
162
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllRequest.SerializeToString,
|
|
163
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveAllResponse.FromString,
|
|
164
|
+
options, channel_credentials,
|
|
165
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
166
|
+
|
|
167
|
+
@staticmethod
|
|
168
|
+
def ResolveBoolean(request,
|
|
169
|
+
target,
|
|
170
|
+
options=(),
|
|
171
|
+
channel_credentials=None,
|
|
172
|
+
call_credentials=None,
|
|
173
|
+
insecure=False,
|
|
174
|
+
compression=None,
|
|
175
|
+
wait_for_ready=None,
|
|
176
|
+
timeout=None,
|
|
177
|
+
metadata=None):
|
|
178
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveBoolean',
|
|
179
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanRequest.SerializeToString,
|
|
180
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveBooleanResponse.FromString,
|
|
181
|
+
options, channel_credentials,
|
|
182
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
183
|
+
|
|
184
|
+
@staticmethod
|
|
185
|
+
def ResolveString(request,
|
|
186
|
+
target,
|
|
187
|
+
options=(),
|
|
188
|
+
channel_credentials=None,
|
|
189
|
+
call_credentials=None,
|
|
190
|
+
insecure=False,
|
|
191
|
+
compression=None,
|
|
192
|
+
wait_for_ready=None,
|
|
193
|
+
timeout=None,
|
|
194
|
+
metadata=None):
|
|
195
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveString',
|
|
196
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringRequest.SerializeToString,
|
|
197
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveStringResponse.FromString,
|
|
198
|
+
options, channel_credentials,
|
|
199
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
200
|
+
|
|
201
|
+
@staticmethod
|
|
202
|
+
def ResolveFloat(request,
|
|
203
|
+
target,
|
|
204
|
+
options=(),
|
|
205
|
+
channel_credentials=None,
|
|
206
|
+
call_credentials=None,
|
|
207
|
+
insecure=False,
|
|
208
|
+
compression=None,
|
|
209
|
+
wait_for_ready=None,
|
|
210
|
+
timeout=None,
|
|
211
|
+
metadata=None):
|
|
212
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveFloat',
|
|
213
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatRequest.SerializeToString,
|
|
214
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveFloatResponse.FromString,
|
|
215
|
+
options, channel_credentials,
|
|
216
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
217
|
+
|
|
218
|
+
@staticmethod
|
|
219
|
+
def ResolveInt(request,
|
|
220
|
+
target,
|
|
221
|
+
options=(),
|
|
222
|
+
channel_credentials=None,
|
|
223
|
+
call_credentials=None,
|
|
224
|
+
insecure=False,
|
|
225
|
+
compression=None,
|
|
226
|
+
wait_for_ready=None,
|
|
227
|
+
timeout=None,
|
|
228
|
+
metadata=None):
|
|
229
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveInt',
|
|
230
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntRequest.SerializeToString,
|
|
231
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveIntResponse.FromString,
|
|
232
|
+
options, channel_credentials,
|
|
233
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
234
|
+
|
|
235
|
+
@staticmethod
|
|
236
|
+
def ResolveObject(request,
|
|
237
|
+
target,
|
|
238
|
+
options=(),
|
|
239
|
+
channel_credentials=None,
|
|
240
|
+
call_credentials=None,
|
|
241
|
+
insecure=False,
|
|
242
|
+
compression=None,
|
|
243
|
+
wait_for_ready=None,
|
|
244
|
+
timeout=None,
|
|
245
|
+
metadata=None):
|
|
246
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.evaluation.v1.Service/ResolveObject',
|
|
247
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectRequest.SerializeToString,
|
|
248
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.ResolveObjectResponse.FromString,
|
|
249
|
+
options, channel_credentials,
|
|
250
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
251
|
+
|
|
252
|
+
@staticmethod
|
|
253
|
+
def EventStream(request,
|
|
254
|
+
target,
|
|
255
|
+
options=(),
|
|
256
|
+
channel_credentials=None,
|
|
257
|
+
call_credentials=None,
|
|
258
|
+
insecure=False,
|
|
259
|
+
compression=None,
|
|
260
|
+
wait_for_ready=None,
|
|
261
|
+
timeout=None,
|
|
262
|
+
metadata=None):
|
|
263
|
+
return grpc.experimental.unary_stream(request, target, '/flagd.evaluation.v1.Service/EventStream',
|
|
264
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamRequest.SerializeToString,
|
|
265
|
+
flagd_dot_evaluation_dot_v1_dot_evaluation__pb2.EventStreamResponse.FromString,
|
|
266
|
+
options, channel_credentials,
|
|
267
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# -*- coding: utf-8 -*-
|
|
2
|
+
# Generated by the protocol buffer compiler. DO NOT EDIT!
|
|
3
|
+
# source: flagd/sync/v1/sync.proto
|
|
4
|
+
"""Generated protocol buffer code."""
|
|
5
|
+
from google.protobuf import descriptor as _descriptor
|
|
6
|
+
from google.protobuf import descriptor_pool as _descriptor_pool
|
|
7
|
+
from google.protobuf import symbol_database as _symbol_database
|
|
8
|
+
from google.protobuf.internal import builder as _builder
|
|
9
|
+
# @@protoc_insertion_point(imports)
|
|
10
|
+
|
|
11
|
+
_sym_db = _symbol_database.Default()
|
|
12
|
+
|
|
13
|
+
|
|
14
|
+
from google.protobuf import struct_pb2 as google_dot_protobuf_dot_struct__pb2
|
|
15
|
+
|
|
16
|
+
|
|
17
|
+
DESCRIPTOR = _descriptor_pool.Default().AddSerializedFile(b'\n\x18\x66lagd/sync/v1/sync.proto\x12\rflagd.sync.v1\x1a\x1cgoogle/protobuf/struct.proto\"O\n\x10SyncFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"B\n\x11SyncFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration\"S\n\x14\x46\x65tchAllFlagsRequest\x12\x1f\n\x0bprovider_id\x18\x01 \x01(\tR\nproviderId\x12\x1a\n\x08selector\x18\x02 \x01(\tR\x08selector\"F\n\x15\x46\x65tchAllFlagsResponse\x12-\n\x12\x66lag_configuration\x18\x01 \x01(\tR\x11\x66lagConfiguration\"\x14\n\x12GetMetadataRequest\"P\n\x13GetMetadataResponse\x12\x33\n\x08metadata\x18\x02 \x01(\x0b\x32\x17.google.protobuf.StructR\x08metadataJ\x04\x08\x01\x10\x02\x32\x9b\x02\n\x0f\x46lagSyncService\x12R\n\tSyncFlags\x12\x1f.flagd.sync.v1.SyncFlagsRequest\x1a .flagd.sync.v1.SyncFlagsResponse\"\x00\x30\x01\x12\\\n\rFetchAllFlags\x12#.flagd.sync.v1.FetchAllFlagsRequest\x1a$.flagd.sync.v1.FetchAllFlagsResponse\"\x00\x12V\n\x0bGetMetadata\x12!.flagd.sync.v1.GetMetadataRequest\x1a\".flagd.sync.v1.GetMetadataResponse\"\x00\x42\x83\x01\n\x11\x63om.flagd.sync.v1B\tSyncProtoP\x01Z\rflagd/sync/v1\xa2\x02\x03\x46SX\xaa\x02\rFlagd.Sync.V1\xca\x02\rFlagd\\Sync\\V1\xe2\x02\x19\x46lagd\\Sync\\V1\\GPBMetadata\xea\x02\x0f\x46lagd::Sync::V1b\x06proto3')
|
|
18
|
+
|
|
19
|
+
_globals = globals()
|
|
20
|
+
_builder.BuildMessageAndEnumDescriptors(DESCRIPTOR, _globals)
|
|
21
|
+
_builder.BuildTopDescriptorsAndMessages(DESCRIPTOR, 'flagd.sync.v1.sync_pb2', _globals)
|
|
22
|
+
if _descriptor._USE_C_DESCRIPTORS == False:
|
|
23
|
+
|
|
24
|
+
DESCRIPTOR._options = None
|
|
25
|
+
DESCRIPTOR._serialized_options = b'\n\021com.flagd.sync.v1B\tSyncProtoP\001Z\rflagd/sync/v1\242\002\003FSX\252\002\rFlagd.Sync.V1\312\002\rFlagd\\Sync\\V1\342\002\031Flagd\\Sync\\V1\\GPBMetadata\352\002\017Flagd::Sync::V1'
|
|
26
|
+
_globals['_SYNCFLAGSREQUEST']._serialized_start=73
|
|
27
|
+
_globals['_SYNCFLAGSREQUEST']._serialized_end=152
|
|
28
|
+
_globals['_SYNCFLAGSRESPONSE']._serialized_start=154
|
|
29
|
+
_globals['_SYNCFLAGSRESPONSE']._serialized_end=220
|
|
30
|
+
_globals['_FETCHALLFLAGSREQUEST']._serialized_start=222
|
|
31
|
+
_globals['_FETCHALLFLAGSREQUEST']._serialized_end=305
|
|
32
|
+
_globals['_FETCHALLFLAGSRESPONSE']._serialized_start=307
|
|
33
|
+
_globals['_FETCHALLFLAGSRESPONSE']._serialized_end=377
|
|
34
|
+
_globals['_GETMETADATAREQUEST']._serialized_start=379
|
|
35
|
+
_globals['_GETMETADATAREQUEST']._serialized_end=399
|
|
36
|
+
_globals['_GETMETADATARESPONSE']._serialized_start=401
|
|
37
|
+
_globals['_GETMETADATARESPONSE']._serialized_end=481
|
|
38
|
+
_globals['_FLAGSYNCSERVICE']._serialized_start=484
|
|
39
|
+
_globals['_FLAGSYNCSERVICE']._serialized_end=767
|
|
40
|
+
# @@protoc_insertion_point(module_scope)
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# Generated by the gRPC Python protocol compiler plugin. DO NOT EDIT!
|
|
2
|
+
"""Client and server classes corresponding to protobuf-defined services."""
|
|
3
|
+
import grpc
|
|
4
|
+
|
|
5
|
+
from flagd.sync.v1 import sync_pb2 as flagd_dot_sync_dot_v1_dot_sync__pb2
|
|
6
|
+
|
|
7
|
+
|
|
8
|
+
class FlagSyncServiceStub(object):
|
|
9
|
+
"""FlagService implements a server streaming to provide realtime flag configurations
|
|
10
|
+
"""
|
|
11
|
+
|
|
12
|
+
def __init__(self, channel):
|
|
13
|
+
"""Constructor.
|
|
14
|
+
|
|
15
|
+
Args:
|
|
16
|
+
channel: A grpc.Channel.
|
|
17
|
+
"""
|
|
18
|
+
self.SyncFlags = channel.unary_stream(
|
|
19
|
+
'/flagd.sync.v1.FlagSyncService/SyncFlags',
|
|
20
|
+
request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString,
|
|
21
|
+
response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString,
|
|
22
|
+
)
|
|
23
|
+
self.FetchAllFlags = channel.unary_unary(
|
|
24
|
+
'/flagd.sync.v1.FlagSyncService/FetchAllFlags',
|
|
25
|
+
request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString,
|
|
26
|
+
response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString,
|
|
27
|
+
)
|
|
28
|
+
self.GetMetadata = channel.unary_unary(
|
|
29
|
+
'/flagd.sync.v1.FlagSyncService/GetMetadata',
|
|
30
|
+
request_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString,
|
|
31
|
+
response_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString,
|
|
32
|
+
)
|
|
33
|
+
|
|
34
|
+
|
|
35
|
+
class FlagSyncServiceServicer(object):
|
|
36
|
+
"""FlagService implements a server streaming to provide realtime flag configurations
|
|
37
|
+
"""
|
|
38
|
+
|
|
39
|
+
def SyncFlags(self, request, context):
|
|
40
|
+
"""Missing associated documentation comment in .proto file."""
|
|
41
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
42
|
+
context.set_details('Method not implemented!')
|
|
43
|
+
raise NotImplementedError('Method not implemented!')
|
|
44
|
+
|
|
45
|
+
def FetchAllFlags(self, request, context):
|
|
46
|
+
"""Missing associated documentation comment in .proto file."""
|
|
47
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
48
|
+
context.set_details('Method not implemented!')
|
|
49
|
+
raise NotImplementedError('Method not implemented!')
|
|
50
|
+
|
|
51
|
+
def GetMetadata(self, request, context):
|
|
52
|
+
"""Missing associated documentation comment in .proto file."""
|
|
53
|
+
context.set_code(grpc.StatusCode.UNIMPLEMENTED)
|
|
54
|
+
context.set_details('Method not implemented!')
|
|
55
|
+
raise NotImplementedError('Method not implemented!')
|
|
56
|
+
|
|
57
|
+
|
|
58
|
+
def add_FlagSyncServiceServicer_to_server(servicer, server):
|
|
59
|
+
rpc_method_handlers = {
|
|
60
|
+
'SyncFlags': grpc.unary_stream_rpc_method_handler(
|
|
61
|
+
servicer.SyncFlags,
|
|
62
|
+
request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.FromString,
|
|
63
|
+
response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.SerializeToString,
|
|
64
|
+
),
|
|
65
|
+
'FetchAllFlags': grpc.unary_unary_rpc_method_handler(
|
|
66
|
+
servicer.FetchAllFlags,
|
|
67
|
+
request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.FromString,
|
|
68
|
+
response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.SerializeToString,
|
|
69
|
+
),
|
|
70
|
+
'GetMetadata': grpc.unary_unary_rpc_method_handler(
|
|
71
|
+
servicer.GetMetadata,
|
|
72
|
+
request_deserializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.FromString,
|
|
73
|
+
response_serializer=flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.SerializeToString,
|
|
74
|
+
),
|
|
75
|
+
}
|
|
76
|
+
generic_handler = grpc.method_handlers_generic_handler(
|
|
77
|
+
'flagd.sync.v1.FlagSyncService', rpc_method_handlers)
|
|
78
|
+
server.add_generic_rpc_handlers((generic_handler,))
|
|
79
|
+
|
|
80
|
+
|
|
81
|
+
# This class is part of an EXPERIMENTAL API.
|
|
82
|
+
class FlagSyncService(object):
|
|
83
|
+
"""FlagService implements a server streaming to provide realtime flag configurations
|
|
84
|
+
"""
|
|
85
|
+
|
|
86
|
+
@staticmethod
|
|
87
|
+
def SyncFlags(request,
|
|
88
|
+
target,
|
|
89
|
+
options=(),
|
|
90
|
+
channel_credentials=None,
|
|
91
|
+
call_credentials=None,
|
|
92
|
+
insecure=False,
|
|
93
|
+
compression=None,
|
|
94
|
+
wait_for_ready=None,
|
|
95
|
+
timeout=None,
|
|
96
|
+
metadata=None):
|
|
97
|
+
return grpc.experimental.unary_stream(request, target, '/flagd.sync.v1.FlagSyncService/SyncFlags',
|
|
98
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsRequest.SerializeToString,
|
|
99
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.SyncFlagsResponse.FromString,
|
|
100
|
+
options, channel_credentials,
|
|
101
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
102
|
+
|
|
103
|
+
@staticmethod
|
|
104
|
+
def FetchAllFlags(request,
|
|
105
|
+
target,
|
|
106
|
+
options=(),
|
|
107
|
+
channel_credentials=None,
|
|
108
|
+
call_credentials=None,
|
|
109
|
+
insecure=False,
|
|
110
|
+
compression=None,
|
|
111
|
+
wait_for_ready=None,
|
|
112
|
+
timeout=None,
|
|
113
|
+
metadata=None):
|
|
114
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.sync.v1.FlagSyncService/FetchAllFlags',
|
|
115
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsRequest.SerializeToString,
|
|
116
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.FetchAllFlagsResponse.FromString,
|
|
117
|
+
options, channel_credentials,
|
|
118
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|
|
119
|
+
|
|
120
|
+
@staticmethod
|
|
121
|
+
def GetMetadata(request,
|
|
122
|
+
target,
|
|
123
|
+
options=(),
|
|
124
|
+
channel_credentials=None,
|
|
125
|
+
call_credentials=None,
|
|
126
|
+
insecure=False,
|
|
127
|
+
compression=None,
|
|
128
|
+
wait_for_ready=None,
|
|
129
|
+
timeout=None,
|
|
130
|
+
metadata=None):
|
|
131
|
+
return grpc.experimental.unary_unary(request, target, '/flagd.sync.v1.FlagSyncService/GetMetadata',
|
|
132
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataRequest.SerializeToString,
|
|
133
|
+
flagd_dot_sync_dot_v1_dot_sync__pb2.GetMetadataResponse.FromString,
|
|
134
|
+
options, channel_credentials,
|
|
135
|
+
insecure, call_credentials, compression, wait_for_ready, timeout, metadata)
|