Skip to content

ltressens/resgate-sdk

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Resgate SDK

Getting Started

Installation

Nats Sdk requires PHP >= 7.1.

composer require resgate-sdk/resgate

Basic Usage

First thing to do, add message driver to config file service

...
    'message' => [
        'current' => 'resgate',
        'drivers' => [
            'resgate' => 'LU\Resgate\ResgateMessageDriver',
            'pure_nats' => 'class/message'
        ]
    ],
...

Extend all Controller in the service with AbstractNatsController

class SubscriptionsController extends AbstractNatsController
{
...

Request Object

$request->get("name"): string // get event subject by name
$request->all(): array // get all events subject

$request->getFiltersString(): string // get all query in the body ex: "filter=model&page=1
$request->getFilter("name"): string // get query in the body by name
$request->getFilters(): array // get all query in the body

Response Object

// Code error
define("RES_NOTFOUND", "system.notFound");
define("RES_INVALIDPARAMS", "system.invalidParams");
define("RES_INVALIDQUERY", "system.invalidQuery");
define("RES_INTERNALERROR", "system.internalError");
define("RES_METHODNOTFOUND", "system.methodNotFound");
define("RES_ACCESSDENIED", "system.accessDenied");
define("RES_TIMEOUT", "system.timeout");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • PHP 100.0%