FazBrowse GitHub Viewer
|
Trending
|
URL:
|
Home
Tools:
[Download Repo ZIP]
[View Raw Code]
[Original HTTPS Page]
python-client/ldclient/interfaces.py at master · dronedeploy/python-client · GitHub
Uh oh!
There was an error while loading.
Please reload this page
.
This repository was archived by the owner on May 5, 2022. It is now read-only.
dronedeploy
/
python-client
Public archive
forked from
launchdarkly/python-server-sdk
Notifications
You must be signed in to change notification settings
Fork
0
Star
0
Code
Pull requests
0
Actions
Wiki
Security and quality
0
Insights
Additional navigation options
Code
Pull requests
Actions
Wiki
Security and quality
Insights
Expand file tree
Breadcrumbs
python-client
/
ldclient
/
interfaces.py
Copy path
More file actions
More file actions
Latest commit
History
History
History
139 lines (110 loc) · 3.11 KB
Breadcrumbs
python-client
/
ldclient
/
interfaces.py
Copy path
File metadata and controls
139 lines (110 loc) · 3.11 KB
Raw
Copy raw file
Download raw file
Open symbols panel
Edit and raw actions
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
from
abc
import
ABCMeta
,
abstractmethod
,
abstractproperty
class
FeatureStore
(
object
):
"""
Stores and retrieves the state of feature flags
"""
__metaclass__
=
ABCMeta
@
abstractmethod
def
get
(
self
,
key
):
"""
Gets the data for a feature flag for evaluation
:param key: The feature flag key
:type key: str
:return: The feature flag data
:rtype: dict
"""
@
abstractmethod
def
all
(
self
):
"""
Returns all feature flags and their data
:rtype: dict[str, dict]
"""
@
abstractmethod
def
init
(
self
,
features
):
"""
Initializes the store with a set of feature flags. Meant to be called by the UpdateProcessor
:param features: The features and their data as provided by LD
:type features: dict[str, dict]
"""
@
abstractmethod
def
delete
(
self
,
key
,
version
):
"""
Marks a feature flag as deleted
:param key: The feature flag key
:type key: str
:param version: The version of the flag to mark as deleted
:type version: str
"""
@
abstractmethod
def
upsert
(
self
,
key
,
feature
):
"""
Inserts a feature flag if its version is newer or missing
:param key: The feature flag
:type key: str
:param feature: The feature information
:type feature: dict
"""
@
abstractproperty
def
initialized
(
self
):
"""
Returns whether the store has been initialized yet or not
:rtype: bool
"""
class
BackgroundOperation
(
object
):
"""
Performs a task in the background
"""
# noinspection PyMethodMayBeStatic
def
start
(
self
):
"""
Starts an operation in the background. Should return immediately and not block.
"""
pass
def
stop
(
self
):
"""
Stops an operation running in the background. May return before the operation is actually stopped.
"""
pass
# noinspection PyMethodMayBeStatic
def
is_alive
(
self
):
"""
Returns whether the operation is alive or not
:rtype: bool
"""
return
True
class
UpdateProcessor
(
BackgroundOperation
):
"""
Responsible for retrieving Feature Flag updates from LaunchDarkly and saving them to the feature store
"""
__metaclass__
=
ABCMeta
def
initialized
(
self
):
"""
Returns whether the update processor has received feature flags and has initialized its feature store.
:rtype: bool
"""
class
EventConsumer
(
BackgroundOperation
):
"""
Consumes events from the client and sends them to LaunchDarkly
"""
__metaclass__
=
ABCMeta
@
abstractmethod
def
flush
(
self
):
"""
Flushes any outstanding events immediately.
"""
class
FeatureRequester
(
object
):
"""
Requests features.
"""
__metaclass__
=
ABCMeta
def
get_all
(
self
):
"""
Gets all feature flags.
"""
pass
def
get_one
(
self
,
key
):
"""
Gets one Feature flag
:return:
"""
pass
Back
|
FazBrowse Home
|
New Git URL