2017 © Pedro Peláez
 

library tao

The Tao of Microservices

image

lighthorse-consulting/tao

The Tao of Microservices

  • Wednesday, November 29, 2017
  • by lighthorse-consulting
  • Repository
  • 4 Watchers
  • 2 Stars
  • 555 Installations
  • PHP
  • 0 Dependents
  • 0 Suggesters
  • 1 Forks
  • 0 Open issues
  • 8 Versions
  • 3 % Grown

The README.md

Tao

The Tao of Microservices is an application layer for rapid data access., (*1)

Install

To install the library simply include it in your composer.json file., (*2)

Settings

The data access payer expects a settings.ini file at the base of the your service directory. This file should organize it's data into sections, with the specific settings for each., (*3)

To connect to a database, just add a [database] section to your INI file, with the following properties:, (*4)

[database]

dsn = ...
username = ...
password = ...

Usage

To register a service simply call the static Tao\Service::init() method, and pass it a key => value array of action names and their corresponding callbacks., (*5)

Then, simply call the run() method to register the actions and run the service, for example:, (*6)

Tao\Service::init([
    'example' => function ($action) {
        // action logic here
        return $action;
    }
])->run();

To use the data access layer call the static Tao\Action::init() from within your logic, and pass it the $action instance. This will provide the database connection and helper methods to easily populate your transport. Then, just call the run() method to execute and return the $action instance, for example:, (*7)

return Tao\Action::init($action)->entity(['text' => 'Hello World'])->run();

Both the entity() and collection() methods can receive raw data, or they can take a string, which they assume to be an SQL function, for example:, (*8)

return Tao\Action::init($action)->entity('do_something')->run();

A set of arguments to pass to that function may be provided as the second argument. If none is provided it assumed that all parameters passed to the actions are also for the SQL function. Note that the argument are prepended with "p_" by default., (*9)

Copyright (c) 2016-2017 LightHorse Consulting, LLC. All rights reserved., (*10)

The Versions

29/11 2017

dev-master

9999999-dev https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

29/11 2017

1.0.6

1.0.6.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

16/06 2017

1.0.5

1.0.5.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

22/05 2017

1.0.4

1.0.4.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

17/04 2017

1.0.3

1.0.3.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

06/04 2017

1.0.2

1.0.2.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

04/04 2017

1.0.1

1.0.1.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse

25/03 2017

1.0.0

1.0.0.0 https://github.com/lighthorse-consulting/tao

The Tao of Microservices

  Sources   Download

MIT

The Requires

 

tao lighthorse