-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3c39ee
commit 234b3f3
Showing
8 changed files
with
145 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 @@ | ||
PLUGIN_ENTRY="-m publisher" |
Empty file.
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,28 @@ | ||
import logging | ||
|
||
from brewtils import PublishClient, Plugin, command | ||
|
||
__version__ = "3.0.0.dev0" | ||
|
||
class Publisher: | ||
|
||
def __init__(self): | ||
self.publishClient = publishClient | ||
|
||
@command() | ||
def publish_topics(self, payload:dict, topic:str = "topic1") -> dict: | ||
return dict | ||
|
||
def main(): | ||
plugin = Plugin( | ||
name="publisher", | ||
version=__version__, | ||
description="A plugin that publishes to topics", | ||
max_concurrent=1, | ||
) | ||
plugin.client = Publisher() | ||
plugin.run() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |
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,41 @@ | ||
import re | ||
|
||
from setuptools import setup | ||
|
||
|
||
def find_version(version_file): | ||
version_line = open(version_file, "rt").read() | ||
match_object = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_line, re.M) | ||
|
||
if not match_object: | ||
raise RuntimeError("Unable to find version string in %s" % version_file) | ||
|
||
return match_object.group(1) | ||
|
||
|
||
setup( | ||
name="publisher", | ||
version=find_version("publisher/__main__.py"), | ||
description="A plugin that publishes to topics", | ||
url="https://beer-garden.io", | ||
author="The Beergarden Team", | ||
author_email=" ", | ||
license="MIT", | ||
packages=["publisher"], | ||
install_requires=["brewtils"], | ||
classifiers=[ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
], | ||
) |
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 @@ | ||
PLUGIN_ENTRY="-m subscribe" |
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,41 @@ | ||
import re | ||
|
||
from setuptools import setup | ||
|
||
|
||
def find_version(version_file): | ||
version_line = open(version_file, "rt").read() | ||
match_object = re.search(r"^__version__ = ['\"]([^'\"]*)['\"]", version_line, re.M) | ||
|
||
if not match_object: | ||
raise RuntimeError("Unable to find version string in %s" % version_file) | ||
|
||
return match_object.group(1) | ||
|
||
|
||
setup( | ||
name="subscribe", | ||
version=find_version("subscribe/__main__.py"), | ||
description="A plugin that subscribes to topics", | ||
url="https://beer-garden.io", | ||
author="The Beergarden Team", | ||
author_email=" ", | ||
license="MIT", | ||
packages=["subscribe"], | ||
install_requires=["brewtils"], | ||
classifiers=[ | ||
"Intended Audience :: Developers", | ||
"License :: OSI Approved :: MIT License", | ||
"Programming Language :: Python :: 2", | ||
"Programming Language :: Python :: 2.7", | ||
"Programming Language :: Python :: 3", | ||
"Programming Language :: Python :: 3.5", | ||
"Programming Language :: Python :: 3.6", | ||
"Programming Language :: Python :: 3.7", | ||
"Programming Language :: Python :: 3.8", | ||
"Programming Language :: Python :: 3.9", | ||
"Programming Language :: Python :: 3.10", | ||
"Programming Language :: Python :: 3.11", | ||
"Programming Language :: Python :: 3.12", | ||
], | ||
) |
Empty file.
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,33 @@ | ||
import logging | ||
|
||
from brewtils import subscribe, Plugin | ||
|
||
__version__ = "3.0.0.dev0" | ||
|
||
class SubscribeClient: | ||
|
||
@subscribe(topics=["topic1","topic2"]) | ||
def subscribe_multiple_topics(self, payload:dict) -> dict: | ||
return dict | ||
|
||
@subscribe(topics="topic1") | ||
def subscrib_one_topics(self, payload:dict) -> dict: | ||
return dict | ||
|
||
@subscribe(topics="topic.*") | ||
def subscribe_wildcard_topics(self, payload:dict) -> dict: | ||
return dict | ||
|
||
def main(): | ||
plugin = Plugin( | ||
name="subscribe", | ||
version=__version__, | ||
description="A plugin that subscribes to topics", | ||
max_concurrent=1, | ||
) | ||
plugin.client = SubscribeClient() | ||
plugin.run() | ||
|
||
|
||
if __name__ == "__main__": | ||
main() |