mirror of
https://github.com/RYGhub/royalnet.git
synced 2024-11-23 19:44:20 +00:00
15 lines
550 B
Python
15 lines
550 B
Python
|
class Config:
|
||
|
__slots__ = "master_uri", "master_secret"
|
||
|
|
||
|
def __init__(self,
|
||
|
master_uri: str,
|
||
|
master_secret: str):
|
||
|
if not (master_uri.startswith("ws://")
|
||
|
or master_uri.startswith("wss://")):
|
||
|
raise ValueError("Invalid protocol (must be ws:// or wss://)")
|
||
|
self.master_uri = master_uri
|
||
|
self.master_secret = master_secret
|
||
|
|
||
|
def __repr__(self):
|
||
|
return f"{self.__class__.__qualname__}(master_uri={self.master_uri}, master_secret={self.master_secret})"
|