Rapidly create services.
Branch: master
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
Failed to load latest commit information.
docs
oriole_service
test
.coveragerc
.editorconfig
.gitignore
.isort.cfg
.travis.yml
CHANGES
CODE_OF_CONDUCT.md
CONTRIBUTORS.txt
LICENSE
MANIFEST.in
Makefile
README.md
README.rst
_config.yml
services.cfg
setup.cfg
setup.py

README.md

Oriole-Service

【Chinese readme】

【English readme】

【Code】

The Zen of oriole: speed defines the winner.

Prerequisites

  1. Install following packages
  • python >= 3.6
  • mongodb
  • mysql
  • rabbitmq
  • redis
  1. Install oriole-service
  pip install oriole-service

Add services.cfg

services.cfg

AMQP_URI:      ${RABBIT:pyamqp://test:test@127.0.0.1}                    
database:      ${MYSQL:mysql://test:test@127.0.0.1/test?charset=utf8}
test_database: ${TEST_MYSQL:mysql://test:test@127.0.0.1/test?charset=utf8}
datasets:      ${REDIS:redis://127.0.0.1/0}

Add orm

dao/__init__.py

from oriole_service.db import *

class Eric(Base):
    __tablename__ = 'eric_table'
    uid = Column(types.Integer(), primary_key=True, autoincrement=True)
    param = Column(types.Unicode(255), unique=None, default='')

Add services/log.py

services/log.py

from oriole_service.app import *

class LogService(App):
    name = service_name(__file__)
    ver = "1.0.0"

    @rpc
    def add(self, params={"param": "eric"}):
        self.log.debug("# %s(%s)" % ("add", params))
        return self._o(params)

Run log service

  o r log

Run console

  o s

Halt log service

  o h log

Create documents.

  o d

Check online services

 You can run o s to do the same thing.

Create docker image.

Don't use it if you don't know docker at all before.

Create log_service image.

  o b log

OK, now you can deploy it into kubernetes.