kong

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Dec 20, 2017 License: Apache-2.0 Imports: 13 Imported by: 0

Documentation

Overview

///////////////////////////////////////////////////////////////////// Copyright (c) 2017 VMware, Inc. All Rights Reserved. SPDX-License-Identifier: Apache-2.0 /////////////////////////////////////////////////////////////////////

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {

	// id and created_at is required to update an kong API
	ID        string `json:"id,omitempty"`
	CreatedAt int    `json:"created_at,omitempty"`

	Name        string   `json:"name"`
	UpstreamURL string   `json:"upstream_url,omitempty"`
	URIs        []string `json:"uris,omitempty"`
	Hosts       []string `json:"hosts,omitempty"`
	Methods     []string `json:"methods,omitempty"`
	HTTPSOnly   bool     `json:"https_only,omitempty"`
}

API is a struct for Kong API

type Client

type Client struct {
	// contains filtered or unexported fields
}

Client is a http client connecting to a Kong server

func NewClient

func NewClient(config *Config) (*Client, error)

NewClient creates a new Kong Client

func (*Client) AddAPI

func (k *Client) AddAPI(entity *gateway.API) (*gateway.API, error)

AddAPI add an API in Kong

func (*Client) DeleteAPI

func (k *Client) DeleteAPI(api *gateway.API) error

DeleteAPI delete an API from Kong

func (*Client) GetAPI

func (k *Client) GetAPI(name string) (*gateway.API, error)

GetAPI get an API from Kong

func (*Client) Initialize

func (k *Client) Initialize() error

Initialize install neccessary plugins into kong at the begining

func (*Client) UpdateAPI

func (k *Client) UpdateAPI(name string, entity *gateway.API) (*gateway.API, error)

UpdateAPI updates an API in Kong

type Config

type Config struct {
	Host     string
	Upstream string
}

Config represents a configure for Kong Client

type Plugin

type Plugin struct {
	Name    string                 `json:"name"`
	ID      string                 `json:"id,omitempty"`
	Config  map[string]interface{} `json:"config,omitempty"`
	Enabled bool                   `json:"enabled,omitempty"`
}

Plugin is a struct for Kong Plugin

Jump to

Keyboard shortcuts

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