custom_pattern

package
v0.1.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 28, 2020 License: BSD-3-Clause Imports: 1 Imported by: ? modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

README

Gateway using Custom-Pattern

This recipe is a gateway using the custom pattern. It uses counter activity to keep the track of number of successful and failed HTTP calls.

Example:

Counter Activity

Name Type Description
counterName string, required:true The name of the counter
op string Counter operation, 'get' is the default operation

Installation

  • Install Go

Setup

git clone https://github.com/project-flogo/microgateway
cd microgateway/examples/json/custom-pattern

Testing

Create the gateway:

flogo create -f flogo.json
cd MyProxy
flogo install github.com/project-flogo/microgateway/examples/json/custom-pattern
flogo install github.com/project-flogo/contrib/activity/counter
flogo install github.com/project-flogo/contrib/activity/rest
flogo build

Start the gateway:

bin/MyProxy

and test below scenario.

In another terminal start the server:

go run server/main.go -server
Request is successful

Run the following command:

curl --request GET http://localhost:9096/endpoint

You should see on successful call:

{"Error-Calls":0,"Success-Calls":1}

Similarly, on unsuccessful call...or in case of error: You should see on successful call:

{"Error-Calls":1,"Success-Calls":0}

Documentation

The Go Gopher

There is no documentation for this package.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL