Skip to content
This repository has been archived by the owner on Oct 15, 2024. It is now read-only.

stephlow/kong

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Kong

Simple wrapper around the Kong Admin REST API.

Requirements

  • Kong (0.10.x)

Installation

Kong is available in Hex, the package can be installed by adding kong to your list of dependencies in mix.exs:

def deps do
  [{:kong, "~> 0.0.1"}]
end

Configuration

You can configure which Node the client connects with. If not set, it will default to http://localhost:8001.

config :kong, host: "http://example.com:8001"

Examples

This library mostly maps Elixir types to Kong Admin API requests and responses. You should consult the Kong documentation on how to form your requests.

List APIs:

{:ok, apis} = Kong.API.list

Passing Querystring parameters to the list call:

{:ok, page_one} = Kong.API.list size: 10
{:ok, page_two} = Kong.API.list size: 10, offset: page_one["offset"]

Creating a new API:

{:ok, api} = Kong.API.add %{name: "Testing", upstream_url: "http://localhost:4000/api", hosts: ["api.example.com"]}

Documentation

Documentation can be found at https://hexdocs.pm/kong.

ToDo

Client

  • Tests

Routes

  • Node Routes
  • Cluster Routes
  • API Routes
  • Consumer Routes
  • Plugin Routes
  • Certificate Routes
  • SNI Routes
  • Upstream Routes
  • Target Routes

About

No description or website provided.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages