Documentation
¶
Index ¶
- type ApiError
- type ApiHandler
- func (ah *ApiHandler) Add(api *data.Api) (*data.Api, error)
- func (ah *ApiHandler) Delete(params *data.ApiRequestParams) error
- func (ah *ApiHandler) List(params *data.ApiRequestParams) (*data.ApiList, error)
- func (ah *ApiHandler) Retrieve(params *data.ApiRequestParams) (*data.Api, error)
- func (ah *ApiHandler) Update(params *data.ApiRequestParams, updatedData *data.Api) (*data.Api, error)
- type Kong
- type PluginApiError
- type PluginHandler
- func (ph *PluginHandler) Add(plugin *data.Plugin) (*data.Plugin, error)
- func (ph *PluginHandler) Delete(params *data.PluginRequestParams) error
- func (ph *PluginHandler) List(params *data.PluginRequestParams) (*data.PluginList, error)
- func (ph *PluginHandler) Retrieve(params *data.PluginRequestParams) (*data.Plugin, error)
- func (ph *PluginHandler) Update(params *data.PluginRequestParams, updatedData *data.Plugin) (*data.Plugin, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type ApiHandler ¶
ApiHandler is our object to interface with the Plugin side of the kong API.
func (*ApiHandler) Delete ¶
func (ah *ApiHandler) Delete(params *data.ApiRequestParams) error
Delete will make a DELETE request to remove an api from the Kong service
func (*ApiHandler) List ¶
func (ah *ApiHandler) List(params *data.ApiRequestParams) (*data.ApiList, error)
List will make a GET request with our request params and return a ApiList which contains the number of apis, a list of the apis fetched and a reference to the next page.
func (*ApiHandler) Retrieve ¶
func (ah *ApiHandler) Retrieve(params *data.ApiRequestParams) (*data.Api, error)
Retrieve will make a GET request to fetch a single Api by Name or ID which will be provided in the params
func (*ApiHandler) Update ¶
func (ah *ApiHandler) Update(params *data.ApiRequestParams, updatedData *data.Api) (*data.Api, error)
Update will make a PUT request to update an existing api stored in the Kong service
type Kong ¶
Kong is a type which we'll use to interact with the Kong service & store any state information about our client.
func NewKong ¶
NewKong should return a new instance of Kong which we can use to interact with the API of the service.
func (*Kong) Apis ¶
func (k *Kong) Apis() *ApiHandler
Apis returns the api handler for the Kong client. This should be a handler which can interact with a running Kong API.
func (*Kong) Ping ¶
Ping makes a single GET request to the base host of our Kong service to ensure that the host is reachable.
func (*Kong) Plugins ¶
func (k *Kong) Plugins() *PluginHandler
Plugins returns the plugin handler for the Kong client. This should be a handler which can interact with a running Kong API.
type PluginApiError ¶
type PluginApiError struct { ConfigPath string `json:"config.path,omitempty"` ConfigWhitelist string `json:"config.whitelist,omitempty"` }
PluginApiError should represent the error responses we may get back from Kong
type PluginHandler ¶
PluginHandler is our object to interface with the Plugin side of the kong API.
func (*PluginHandler) Delete ¶
func (ph *PluginHandler) Delete(params *data.PluginRequestParams) error
Delete will make a DELETE request to remove a plugin from the Kong service
func (*PluginHandler) List ¶
func (ph *PluginHandler) List(params *data.PluginRequestParams) (*data.PluginList, error)
List will make a GET request with our request params and return a PluginList which contains the number of plugins, a list of the plugins fetched and a reference to the next page.
func (*PluginHandler) Retrieve ¶
func (ph *PluginHandler) Retrieve(params *data.PluginRequestParams) (*data.Plugin, error)
Retrieve will make a GET request to fetch a single plugin by Name or ID which will be provided in the params
func (*PluginHandler) Update ¶
func (ph *PluginHandler) Update(params *data.PluginRequestParams, updatedData *data.Plugin) (*data.Plugin, error)
Update will make a PUT request to update an existing plugin stored in the Kong service