kong

package
v0.1.23 Latest Latest
Warning

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

Go to latest
Published: Aug 22, 2018 License: Apache-2.0 Imports: 15 Imported by: 4

Documentation

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(ctx context.Context, entity *gateway.API) (*gateway.API, error)

AddAPI add an API in Kong

func (*Client) DeleteAPI

func (k *Client) DeleteAPI(ctx context.Context, api *gateway.API) error

DeleteAPI delete an API from Kong

func (*Client) GetAPI

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

GetAPI get an API from Kong

func (*Client) UpdateAPI

func (k *Client) UpdateAPI(ctx context.Context, 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