kong

package
v0.3.1 Latest Latest
Warning

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

Go to latest
Published: Jan 25, 2018 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type API

type API struct {
	CreatedAt        int    `json:"created_at,omitempty"`
	ID               string `json:"id,omitempty"`
	Name             string `json:"name"`
	PreserveHost     bool   `json:"preserve_host,omitempty"`
	RequestPath      string `json:"request_path,omitempty"`
	StripRequestPath bool   `json:"strip_request_path,omitempty"`
	UpstreamURL      string `json:"upstream_url,omitempty"`
	RequestHost      string `json:"request_host,omitempty"`
}

API init api struct

type APIService

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

APIService provides methods for creating and reading issues.

func NewAPIService

func NewAPIService(httpClient *http.Client, config *config.KongConfiguration) *APIService

NewAPIService returns a new APIService.

func (*APIService) Create

func (s *APIService) Create(params *API) (*API, *http.Response, error)

Create is craete api to kong

func (*APIService) Delete

func (s *APIService) Delete(apiID string) (string, *http.Response, error)

Delete api with kong

func (*APIService) Get

func (s *APIService) Get(params string) (*API, *http.Response, error)

Get api from kong

func (*APIService) List

func (s *APIService) List() (*APIs, *http.Response, error)

List api from kong

func (*APIService) Update

func (s *APIService) Update(params *API) (*API, *http.Response, error)

Update api from kon

type APIs

type APIs struct {
	API   []API `json:"data,omitempty"`
	Total int   `json:"total,omitempty"`
}

APIs init api struct

type BasicAuthCredential

type BasicAuthCredential struct {
	Password   string `json:"password,omitempty" form:"password"`
	ConsumerID string `json:"consumer_id,omitempty" form:"consumer_id"`
	ID         string `json:"id,omitempty"`
	Username   string `json:"username,omitempty" form:"username"`
	CreatedAt  int    `json:"created_at,omitempty"`
}

type BasicAuthCredentials

type BasicAuthCredentials struct {
	Data  []BasicAuthCredential `json:"data,omitempty"`
	Total int                   `json:"total,omitempty"`
}

type BasicAuthService

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

func NewBasicAuthService

func NewBasicAuthService(httpClient *http.Client, config *config.KongConfiguration) *BasicAuthService

func (*BasicAuthService) Create

func (s *BasicAuthService) Create(consumerID string, params *BasicAuthCredential) (*BasicAuthCredential, *http.Response, error)

func (*BasicAuthService) Delete

func (s *BasicAuthService) Delete(consumerID, credentialID string) (string, *http.Response, error)

func (*BasicAuthService) Get

func (s *BasicAuthService) Get(consumerID, credentialID string) (*BasicAuthCredential, *http.Response, error)

func (*BasicAuthService) List

func (s *BasicAuthService) List(consumerID string) (*BasicAuthCredentials, *http.Response, error)

func (*BasicAuthService) Update

func (s *BasicAuthService) Update(consumerID string, params *BasicAuthCredential) (*BasicAuthCredential, *http.Response, error)

type Client

type Client struct {
	APIService      *APIService
	ConsumerService *ConsumerService
	PluginService   *PluginService
	JWTService      *JWTService
}

func NewClient

func NewClient(httpClient *http.Client, config *config.KongConfiguration) *Client

NewClient returns a new Client

type Consumer

type Consumer struct {
	CreatedAt int    `json:"created_at,omitempty"`
	ID        string `json:"id,omitempty"`
	Username  string `json:"username,omitempty" form:"username"`
	CustomID  string `json:"custom_id,omitempty" form:"custom_id"`
}

type ConsumerService

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

ConsumerService provides methods for creating and reading issues.

func NewConsumerService

func NewConsumerService(httpClient *http.Client, config *config.KongConfiguration) *ConsumerService

NewConsumerService returns a new ConsumerService.

func (*ConsumerService) Create

func (s *ConsumerService) Create(params *Consumer) (*Consumer, *http.Response, error)

func (*ConsumerService) Delete

func (s *ConsumerService) Delete(consumerID string) (string, *http.Response, error)

func (*ConsumerService) Get

func (s *ConsumerService) Get(params string) (*Consumer, *http.Response, error)

func (*ConsumerService) List

func (s *ConsumerService) List() (*Consumers, *http.Response, error)

func (*ConsumerService) Update

func (s *ConsumerService) Update(params *Consumer) (*Consumer, *http.Response, error)

type Consumers

type Consumers struct {
	Consumer []Consumer `json:"data,omitempty"`
	Total    int        `json:"total,omitempty"`
}

type CorrelationIDPluginConfig

type CorrelationIDPluginConfig struct {
	HeaderName      string `form:"header_name" json:"header_name,omitempty"`
	Generator       string `form:"generator" json:"generator,omitempty"`
	EchoDownstreams bool   `form:"echo_downstream" json:"echo_downstream,omitempty"`
}

type EnabledPlugin

type EnabledPlugin struct {
	//	EnabledPlugins map[string]bool `json:"enabled_plugins"`
	EnabledPlugins []string `json:"enabled_plugins"`
}

type GeneratePluginParams

type GeneratePluginParams struct {
	Name       string      `form:"name" json:"name" binding:"required"`
	ConsumerID string      `form:"consumer_id" json:"consumer_id,omitempty" binding:"omitempty"`
	Config     interface{} `form:"config" json:"config" binding:"omitempty"`
}

type JWTCredential

type JWTCredential struct {
	Algorithm  string `json:"algorithm,omitempty"`
	Secret     string `json:"secret,omitempty"`
	ConsumerID string `json:"consumer_id,omitempty"`
	ID         string `json:"id,omitempty"`
	Key        string `json:"key,omitempty"`
	CreatedAt  int    `json:"created_at,omitempty"`
}

type JWTCredentials

type JWTCredentials struct {
	Data  []JWTCredential `json:"data,omitempty"`
	Total int             `json:"total,omitempty"`
}

type JWTService

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

func NewJWTService

func NewJWTService(httpClient *http.Client, config *config.KongConfiguration) *JWTService

func (*JWTService) Create

func (s *JWTService) Create(consumerID string, params *JWTCredential) (*JWTCredential, *http.Response, error)

func (*JWTService) Delete

func (s *JWTService) Delete(consumerID, credentialID string) (string, *http.Response, error)

func (*JWTService) Get

func (s *JWTService) Get(consumerID, credentialID string) (*JWTCredential, *http.Response, error)

func (*JWTService) List

func (s *JWTService) List(consumerID string) (*JWTCredentials, *http.Response, error)

func (*JWTService) Update

func (s *JWTService) Update(consumerID string, params *JWTCredential) (*JWTCredential, *http.Response, error)

type OAuth2PluginConfig

type OAuth2PluginConfig struct {
	AcceptHTTPIfAlreadyTerminated bool   `form:"accept_http_if_already_terminated" json:"accept_http_if_already_terminated,omitempty"`
	EnableAuthorizationCode       bool   `form:"enable_authorization_code" json:"enable_authorization_code,omitempty"`
	EnableClientCredentials       bool   `form:"enable_client_credentials" json:"enable_client_credentials,omitempty"`
	EnableImplicitGrant           bool   `form:"enable_implicit_grant" json:"enable_implicit_grant,omitempty"`
	EnablePasswordGrant           bool   `form:"enable_password_grant" json:"enable_password_grant,omitempty"`
	HideCredentials               bool   `form:"hide_credentials" json:"hide_credentials,omitempty"`
	MandatoryScope                bool   `form:"mandatory_scope" json:"mandatory_scope,omitempty"`
	ProvisionKey                  string `form:"provision_key" json:"provision_key,omitempty"`
	TokenExpiration               int    `form:"token_expiration" json:"token_expiration,omitempty"`
	Scopes                        string `form:"scopes" json:"scopes,omitempty"`
}

type Plugin

type Plugin struct {
	APIID     string      `json:"api_id,omitempty"`
	Config    interface{} `json:"config,omitempty"`
	CreatedAt int         `json:"created_at,omitempty"`
	Enabled   bool        `json:"enabled,omitempty"`
	ID        string      `json:"id,omitempty"`
	Name      string      `json:"name,omitempty"`
}

type PluginSchema

type PluginSchema struct {
	Fields     map[string]*PluginSchemaField `json:"fields"`
	NoConsumer bool                          `json:"no_consumer,omitempty"`
}

type PluginSchemaField

type PluginSchemaField struct {
	Type     string       `json:"type"`
	Required bool         `json:"required,omitempty"`
	Func     string       `json:"func,omitempty"`
	Default  interface{}  `json:"default,omitempty"`
	Schema   PluginSchema `json:"schema,omitempty"`
	Name     string       `json:"name"`
}

type PluginService

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

PluginService provides methods for creating and reading issues.

func NewPluginService

func NewPluginService(httpClient *http.Client, config *config.KongConfiguration) *PluginService

NewPluginService returns a new PluginService.

func (*PluginService) Create

func (s *PluginService) Create(params *Plugin, apiName string) (*Plugin, *http.Response, error)

func (*PluginService) Delete

func (s *PluginService) Delete(pluginID string, apiName string) (string, *http.Response, error)

func (*PluginService) Get

func (s *PluginService) Get(pluginID string, apiName string) (*Plugin, *http.Response, error)

func (*PluginService) GetEnabledPlugins

func (s *PluginService) GetEnabledPlugins() (*EnabledPlugin, *http.Response, error)

func (*PluginService) GetPluginSchema

func (s *PluginService) GetPluginSchema(name string) (*PluginSchema, *http.Response, error)

func (*PluginService) List

func (s *PluginService) List(apiName string) (*Plugins, *http.Response, error)

func (*PluginService) Update

func (s *PluginService) Update(params *Plugin, apiName string) (*Plugin, *http.Response, error)

type Plugins

type Plugins struct {
	Plugin []Plugin `json:"data,omitempty"`
	Total  int      `json:"total,omitempty"`
}

type RequestTransformerPluginConfig

type RequestTransformerPluginConfig struct {
	RemoveQueryString string `json:"remove.querystring,omitempty"`
	AddQueryString    string `json:"add.querystring,omitempty"`
}

Jump to

Keyboard shortcuts

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