Skip to content

Commit 6cff3d4

Browse files
committed
fixup: grpc -> rpc
Signed-off-by: Todd Baert <[email protected]>
1 parent 87c50a4 commit 6cff3d4

File tree

5 files changed

+29
-27
lines changed

5 files changed

+29
-27
lines changed

providers/openfeature-provider-flagd/README.md

Lines changed: 23 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -78,27 +78,29 @@ This mode is useful for local development, tests and offline applications.
7878

7979
The default options can be defined in the FlagdProvider constructor.
8080

81-
| Option name | Environment variable name | Type & Values | Default | Compatible resolver |
82-
|--------------------------|--------------------------------|---------------|-----------|---------------------|
83-
| resolver_type | FLAGD_RESOLVER | enum | grpc | |
84-
| host | FLAGD_HOST | str | localhost | rpc & in-process |
85-
| port | FLAGD_PORT | int | 8013 | rpc & in-process |
86-
| tls | FLAGD_TLS | bool | false | rpc & in-process |
87-
| deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
88-
| stream_deadline_ms | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
89-
| keep_alive_time | FLAGD_KEEP_ALIVE_TIME_MS | int | 0 | rpc & in-process |
90-
| selector | FLAGD_SOURCE_SELECTOR | str | null | in-process |
91-
| cache_type | FLAGD_CACHE | enum | lru | rpc |
92-
| max_cache_size | FLAGD_MAX_CACHE_SIZE | int | 1000 | rpc |
93-
| retry_backoff_ms | FLAGD_RETRY_BACKOFF_MS | int | 1000 | rpc |
94-
| offline_flag_source_path | FLAGD_OFFLINE_FLAG_SOURCE_PATH | str | null | in-process |
95-
96-
<!--
97-
| target_uri | FLAGD_TARGET_URI | str | null | rpc & in-process |
98-
| socket_path | FLAGD_SOCKET_PATH | str | null | rpc & in-process |
99-
| cert_path | FLAGD_SERVER_CERT_PATH | str | null | rpc & in-process |
100-
| max_event_stream_retries | FLAGD_MAX_EVENT_STREAM_RETRIES | int | 5 | rpc |
101-
-->
81+
| Option name | Environment variable name | Type & Values | Default | Compatible resolver |
82+
| ------------------------ | ------------------------------ | -------------------------- | ----------------------------- | ------------------- |
83+
| resolver_type | FLAGD_RESOLVER | enum - `rpc`, `in-process` | rpc | |
84+
| host | FLAGD_HOST | str | localhost | rpc & in-process |
85+
| port | FLAGD_PORT | int | 8013 (rpc), 8015 (in-process) | rpc & in-process |
86+
| tls | FLAGD_TLS | bool | false | rpc & in-process |
87+
| deadline | FLAGD_DEADLINE_MS | int | 500 | rpc & in-process |
88+
| stream_deadline_ms | FLAGD_STREAM_DEADLINE_MS | int | 600000 | rpc & in-process |
89+
| keep_alive_time | FLAGD_KEEP_ALIVE_TIME_MS | int | 0 | rpc & in-process |
90+
| selector | FLAGD_SOURCE_SELECTOR | str | null | in-process |
91+
| cache_type | FLAGD_CACHE | enum - `lru`, `disabled` | lru | rpc |
92+
| max_cache_size | FLAGD_MAX_CACHE_SIZE | int | 1000 | rpc |
93+
| retry_backoff_ms | FLAGD_RETRY_BACKOFF_MS | int | 1000 | rpc |
94+
| offline_flag_source_path | FLAGD_OFFLINE_FLAG_SOURCE_PATH | str | null | in-process |
95+
96+
<!-- not implemented
97+
| target_uri | FLAGD_TARGET_URI | alternative to host/port, supporting custom name resolution | string | null | rpc & in-process |
98+
| socket_path | FLAGD_SOCKET_PATH | alternative to host port, unix socket | String | null | rpc & in-process |
99+
| cert_path | FLAGD_SERVER_CERT_PATH | tls cert path | String | null | rpc & in-process |
100+
| max_event_stream_retries | FLAGD_MAX_EVENT_STREAM_RETRIES | int | 5 | rpc |
101+
| context_enricher | - | sync-metadata to evaluation context mapping function | function | identity function | in-process |
102+
| offline_pollIntervalMs | FLAGD_OFFLINE_POLL_MS | poll interval for reading offlineFlagSourcePath | int | 5000 | in-process |
103+
-->
102104

103105
> [!NOTE]
104106
> Some configurations are only applicable for RPC resolver.

providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/config.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ def env_or_default(
3737

3838

3939
class ResolverType(Enum):
40-
GRPC = "grpc"
40+
RPC = "rpc"
4141
IN_PROCESS = "in-process"
4242

4343

@@ -76,12 +76,12 @@ def __init__( # noqa: PLR0913
7676
env_or_default(ENV_VAR_SELECTOR, None) if selector is None else selector
7777
)
7878
self.resolver_type = (
79-
ResolverType(env_or_default(ENV_VAR_RESOLVER_TYPE, "grpc"))
79+
ResolverType(env_or_default(ENV_VAR_RESOLVER_TYPE, "rpc"))
8080
if resolver_type is None
8181
else resolver_type
8282
)
8383

84-
default_port = 8013 if self.resolver_type is ResolverType.GRPC else 8015
84+
default_port = 8013 if self.resolver_type is ResolverType.RPC else 8015
8585
self.port: int = (
8686
int(env_or_default(ENV_VAR_PORT, default_port, cast=int))
8787
if port is None

providers/openfeature-provider-flagd/src/openfeature/contrib/provider/flagd/provider.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ def __init__( # noqa: PLR0913
8686
self.resolver = self.setup_resolver()
8787

8888
def setup_resolver(self) -> AbstractResolver:
89-
if self.config.resolver_type == ResolverType.GRPC:
89+
if self.config.resolver_type == ResolverType.RPC:
9090
return GrpcResolver(
9191
self.config,
9292
self.emit_provider_ready,

providers/openfeature-provider-flagd/tests/e2e/test_rpc.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def client_name() -> str:
1717

1818
@pytest.fixture(autouse=True, scope="module")
1919
def resolver_type() -> ResolverType:
20-
return ResolverType.GRPC
20+
return ResolverType.RPC
2121

2222

2323
@pytest.fixture(autouse=True, scope="module")

providers/openfeature-provider-flagd/tests/e2e/test_rpc_reconnect.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def client_name() -> str:
1212

1313
@pytest.fixture(autouse=True, scope="module")
1414
def resolver_type() -> ResolverType:
15-
return ResolverType.GRPC
15+
return ResolverType.RPC
1616

1717

1818
@pytest.fixture(autouse=True, scope="module")

0 commit comments

Comments
 (0)