The first go language gateway in China! GoKu API Gateway CE Quick Use Manual

Keywords: Attribute Go

The complete request address for gateway access is gateway IP: port number/gateway alias/policy group id/interface path
The following section describes how to use GoKu API Gateway CE quickly through configuration files.

I. Creating Gateway

  • 1. Open the global configuration file goku.conf and enter the following information:
1.host: ""
2.port: "6600"
3.gateway_conf_path: ./config/gateway
  • 2. Open gateway configuration file gateway.conf and enter the following information:
1.gateway_name: Example gateway
2.gateway_alias: asp
3.gateway_status: on
4.ip_limit_type: none
5.api_group_conf_path: ./config/gateway/asp/api_group.conf
6.api_conf_path: ./config/gateway/asp/api.conf
7.strategy_conf_path: ./config/gateway/asp/strategy.conf
8.backend_conf_path: ./config/gateway/asp/backend.conf

Adding back-end services

Open the back-end service configuration file backend.conf and enter the following information:

1.backend:
2.- backend_id: 1
3.  backend_name: apishop
4.  backend_path: https://api.apishop.net

3. New Strategic Group

Multiple policy groups can be created under each gateway. The policy group includes authentication mode, traffic control, IP black-and-white list and other modules. A policy group can specify multiple API groups. The API request address must be accompanied by the corresponding policy group id.

In this way, without authentication, no ip black-and-white list, flow control is one time per second. Open policy group configuration file strategy.conf and enter the following information:

1.strategy: 
2.- strategy_name: Sample policy
3.  strategy_id: test
4.  auth: none
5.  ip_limit_type: none
6.  rate_limit_list:
7.  - allow: true
8.    period: "sec"
9.    limit: 1
10.    priority: 999
11.    start_time: 0
12.    end_time: 24

IV. New API Grouping

Open the API grouping configuration file api_group.conf and enter the following information:

1.group:
2.- group_id: 1
 3. group_name: example grouping 1
4.- group_id: 2
 5. group_name: example grouping 2

V. New API

Use the interface store here (apishop.net) The National Oil Price Query API serves as an example interface to access through the gateway. The following tutorial shows how to configure the interface in the GoKu gateway.

The request parameters of the interface are as follows:

Parameter name type Must fill Explain
apiKey long yes The application data can be viewed in the apishop console
province text no Provincial names, such as Guangxi and Beijing

Open the API configuration file api.conf and enter the following information:

1.apis: 
2.- api_name: National oil price 
3.  group_id: 1
4.  backend_id: 1
5.  request_method: 
6.  - post
7.  - get
8.  request_url: /common/oil/getOilPriceToday
9.  proxy_method: post
10.  proxy_url: /common/oil/getOilPriceToday
11.  proxy_body_type: formdata
12.  porxy_body:  
13.  proxy_params: 
14.  - key: province
15.    key_position: body
16.    not_empty: false
17.    proxy_key: province
18.    proxy_key_position: body
19.  constant_params: 
20.  - key: apiKey 
21.    position: body 
22.    value: Uad5kkL53ced1ca67f*****************

VI. Access Gateway

The complete request address for gateway access is gateway IP: port number/gateway alias/policy group id/interface path
So the API's full request path through the gateway is
http://localhost:6600/asp/test/common/oil/getOilPriceToday

Use here eoLinker Interface Management Platform Test.

After sending the request, the correct result is obtained:

So far, you have succeeded in understanding GoKu API Gateway CE. If you still have problems in the process of using it, you are welcome to join our user discussion group. Our technical colleagues will answer for you: User communication group 1 (group number: 725853895).
For more information about the first GO language gateway in China, please note: https://agw.eolinker.com Or pay attention to this blog, which will update the latest product information of eoLinker in time.

Related articles:
The first GO language gateway in China! GoKu API Gateway Deployment Guide
GoKu API Gateway CE configuration file
Installation and Setup of GoKu API Gateway CE Goang

Posted by madsosterby on Mon, 31 Dec 2018 09:18:10 -0800