Documentation
¶
Index ¶
- func CheckResponse(req *http.Request, r *http.Response) error
- func FromMap(configStruct interface{}, configMap map[string]interface{}) error
- func SetJSONField(configStruct interface{}, mapKey string, mapValue interface{}) error
- func ToMap(config interface{}) map[string]interface{}
- type ACLConfig
- type Api
- type ApiRequest
- type Apis
- type ApisGetAllOptions
- type ApisPluginsService
- type ApisService
- func (s *ApisService) Delete(api string) (*http.Response, error)
- func (s *ApisService) Get(api string) (*Api, *http.Response, error)
- func (s *ApisService) GetAll(opt *ApisGetAllOptions) (*Apis, *http.Response, error)
- func (s *ApisService) Patch(api *ApiRequest) (*http.Response, error)
- func (s *ApisService) Post(api *ApiRequest) (*http.Response, error)
- type Client
- type Cluster
- type ClusterMember
- type ClusterService
- type ConflictError
- type Consumer
- type ConsumerACLConfig
- type ConsumerACLConfigs
- type ConsumerJWTConfig
- type ConsumerJWTConfigs
- type ConsumerKeyAuthConfig
- type ConsumerKeyAuthConfigs
- type Consumers
- type ConsumersACLService
- type ConsumersGetAllOptions
- type ConsumersJWTService
- func (s *ConsumersJWTService) Delete(consumer, id string) (*http.Response, error)
- func (s *ConsumersJWTService) GetAll(consumer string) (*ConsumerJWTConfigs, *http.Response, error)
- func (s *ConsumersJWTService) Post(consumer string, config *ConsumerJWTConfig) (*ConsumerJWTConfig, *http.Response, error)
- type ConsumersKeyAuthService
- func (s *ConsumersKeyAuthService) Delete(consumer, id string) (*http.Response, error)
- func (s *ConsumersKeyAuthService) GetAll(consumer string) (*ConsumerKeyAuthConfigs, *http.Response, error)
- func (s *ConsumersKeyAuthService) Post(consumer string, config *ConsumerKeyAuthConfig) (*ConsumerKeyAuthConfig, *http.Response, error)
- type ConsumersPlugins
- type ConsumersService
- func (s *ConsumersService) Delete(consumer string) (*http.Response, error)
- func (s *ConsumersService) Get(consumer string) (*Consumer, *http.Response, error)
- func (s *ConsumersService) GetAll(opt *ConsumersGetAllOptions) (*Consumers, *http.Response, error)
- func (s *ConsumersService) Patch(consumer *Consumer) (*http.Response, error)
- func (s *ConsumersService) Post(consumer *Consumer) (*http.Response, error)
- type CorrelationIDConfig
- type EnabledPlugins
- type ErrorResponse
- type FileLogConfig
- type HttpLogConfig
- type JWTConfig
- type KeyAuthenticationConfig
- type Node
- type NodeService
- type NotFoundError
- type Plugin
- type Plugins
- type PluginsGetAllOptions
- type PluginsService
- func (s *PluginsService) Delete(api string, plugin string) (*http.Response, error)
- func (s *PluginsService) Get(id string) (*Plugin, *http.Response, error)
- func (s *PluginsService) GetAll(opt *PluginsGetAllOptions) (*Plugins, *http.Response, error)
- func (s *PluginsService) GetEnabled() (*EnabledPlugins, *http.Response, error)
- func (s *PluginsService) GetSchema(name string) (map[string]interface{}, *http.Response, error)
- func (s *PluginsService) Patch(api string, plugin *Plugin) (*http.Response, error)
- func (s *PluginsService) Post(plugin *Plugin) (*http.Response, error)
- type RateLimitingConfig
- type RequestSizeLimitingConfig
- type Status
- type Target
- type TargetCount
- type Targets
- type TargetsService
- type Upstream
- type Upstreams
- type UpstreamsService
- func (s *UpstreamsService) Delete(upstream string) (*http.Response, error)
- func (s *UpstreamsService) Get(upstream string) (*Upstream, *http.Response, error)
- func (s *UpstreamsService) Patch(upstream *Upstream) (*http.Response, error)
- func (s *UpstreamsService) Post(upstream *Upstream) (*http.Response, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func CheckResponse ¶
CheckResponse looks at the response from a Kong API call and determines what type of error needs to be returned, if any.
func FromMap ¶
FromMap is used to marshal a map[string]interface{} to a more specific plugin struct definition by matching the json tags to the struct keys
Generally this is used when converting the returned plugin configuration information from map[string]interface{} to a more specific struct
i.e. map[string]interface -> ACLConfig
func SetJSONField ¶
SetField is used to convert entries in a map to struct fields It matches map keys to json tags
func ToMap ¶
func ToMap(config interface{}) map[string]interface{}
ToMap is used to marshal a specific plugin configuration to the more general map[string]interface{} expected by PluginsService.Post ToMap uses the `json:""` tags of the input struct to name the map keys.
ToMap also does not carry over empty fields from the original struct in the returned map[string]interface{}. This way the resulting map can safely be marshaled to JSON without nil fields.
Types ¶
type Api ¶
type Api struct { UpstreamURL string `json:"upstream_url,omitempty"` RequestPath string `json:"request_path,omitempty"` ID string `json:"id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` PreserveHost bool `json:"preserve_host,omitempty"` Name string `json:"name,omitempty"` Hosts []string `json:"hosts,omitempty"` Uris []string `json:"uris"` StripUri bool `json:"strip_uri"` Retries int `json:"retries"` UpstreamConnectTimeout int `json:"upstream_connect_timeout"` UpstreamSendTimeout int `json:"upstream_send_timeout"` UpstreamReadTimeout int `json:"upstream_read_timeout"` HttpsOnly bool `json:"https_only"` HttpIfTerminated bool `json:"http_if_terminated"` }
Api represents an existing Kong api object
type ApiRequest ¶
type ApiRequest struct { UpstreamURL string `json:"upstream_url,omitempty"` RequestPath string `json:"request_path,omitempty"` ID string `json:"id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` PreserveHost bool `json:"preserve_host,omitempty"` Name string `json:"name,omitempty"` Hosts []string `json:"hosts,omitempty"` Uris []string `json:"uris"` StripUri bool `json:"strip_uri"` Retries int `json:"retries"` UpstreamConnectTimeout int `json:"upstream_connect_timeout"` UpstreamSendTimeout int `json:"upstream_send_timeout"` UpstreamReadTimeout int `json:"upstream_read_timeout"` HttpsOnly bool `json:"https_only"` HttpIfTerminated bool `json:"http_if_terminated"` }
ApiRequest represents a Kong api object for api creation.
type Apis ¶
type Apis struct { Data []*Api `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` Offset string `json:"offset,omitempty"` }
Apis represents the object returned from Kong when querying for multiple api objects.
In cases where the number of objects returned exceeds the maximum, Next holds the URI for the next set of results. i.e. "http://localhost:8001/apis/?size=2&offset=4d924084-1adb-40a5-c042-63b19db421d1"
type ApisGetAllOptions ¶
type ApisGetAllOptions struct { ID string `url:"id,omitempty"` // A filter on the list based on the apis id field. Name string `url:"name,omitempty"` // A filter on the list based on the apis name field. RequestHost string `url:"request_host,omitempty"` // A filter on the list based on the apis request_host field. RequestPath string `url:"request_path,omitempty"` // A filter on the list based on the apis request_path field. UpstreamURL string `url:"upstream_url,omitempty"` // A filter on the list based on the apis upstream_url field. Size int `url:"size,omitempty"` // A limit on the number of objects to be returned. Offset string `url:"offset,omitempty"` // A cursor used for pagination. offset is an object identifier that defines a place in the list. }
ApisGetAllOptions specifies optional filter parameters to the ApisService.GetAll method.
Additional information about filtering options can be found in the Kong documentation at: https://getkong.org/docs/0.9.x/admin-api/#list-apis
type ApisPluginsService ¶
type ApisPluginsService service
ApisPluginsService handles communication with Kong's '/apis/{api id or name}/plugins' resource.
func (*ApisPluginsService) GetAll ¶
func (s *ApisPluginsService) GetAll(api string, opt *PluginsGetAllOptions) (*Plugins, *http.Response, error)
GetAll lists all plugins attached to the specifed api. This query can be filtered by supplying the PluginsGetAllOptions struct.
Equivalent to GET/apis/{api}/plugins?uri=params&from=opt
type ApisService ¶
type ApisService struct { Plugins *ApisPluginsService // contains filtered or unexported fields }
ApisService handles communication with Kong's '/apis' resource.
func (*ApisService) Delete ¶
func (s *ApisService) Delete(api string) (*http.Response, error)
Delete deletes a single Kong api object, by name or id.
Equivalent to DELETE /apis/{name or id}
func (*ApisService) Get ¶
Get queries for a single Kong api object, by name or id.
Equivalent to GET /apis/{name or id}
func (*ApisService) GetAll ¶
func (s *ApisService) GetAll(opt *ApisGetAllOptions) (*Apis, *http.Response, error)
GetAll queries for all Kong api objects. This query can be filtered by supplying the ApisGetAllOptions struct.
Equivalent to GET /apis?uri=params&from=opt
func (*ApisService) Patch ¶
func (s *ApisService) Patch(api *ApiRequest) (*http.Response, error)
Patch updates an existing Kong api object. At least one of api.Name or api.ID must be specified in the passed *Api parameter.
Equivalent to PATCH /apis/{name or id}
func (*ApisService) Post ¶
func (s *ApisService) Post(api *ApiRequest) (*http.Response, error)
Post creates a new Kong api object.
Equivalent to POST /apis
type Client ¶
type Client struct { // Base URL for API requests. // BaseURL should always be specified with a trailing slash BaseURL *url.URL // Services used for talking to different parts of the Kong API Node *NodeService Cluster *ClusterService Apis *ApisService Upstreams *UpstreamsService Targets *TargetsService Consumers *ConsumersService Plugins *PluginsService // contains filtered or unexported fields }
Client manages communication with the Kong API. New client objects should be created using the NewClient function. The BaseURL field must be defined and pointed at an instance of the Kong Admin API.
Kong resources can be access using the Service objects. client.Apis.Get("id") -> GET /apis/id client.Consumers.Patch(consumer) -> PATCH /consumers/id
func NewClient ¶
NewClient creates a new kong.Client object. This should be the primary way a kong.Client object is constructed.
If an httpClient object is specified it will be used instead of the default http.DefaultClient.
baseURLStr should point to an instance a Kong Admin API and must contain the trailing slash. i.e. http://kong:8001/
func (*Client) Do ¶
Do executes the actual REST call against Kong. The API response is JSON decoded and stored in the value pointed to by v, or returned as an error if an API error has occurred. If v implements the io.Writer interface, the raw response body will be written to v, without attempting to first decode it.
The *http.Response object returned by Do should eventually get passed back to the caller. If Kong returns a status code outside of the 200 range, the caller can inspect the *http.Response to get more information. Additionally the err returned in this case will be of type ErrorResponse.
func (*Client) NewRequest ¶
NewRequest is used to construct a new *http.Request object Generally speaking the returned *http.Request object will be used in a subsequent Client.Do to execute the actual REST call against Kong.
If body is provided, it will be JSON encoded and used as the request body.
type Cluster ¶
type Cluster struct { Total int `json:"total,omitemtpy"` Data []ClusterMember `json:"data,omitempty"` }
type ClusterMember ¶
type ClusterService ¶
type ClusterService service
func (*ClusterService) Delete ¶
func (s *ClusterService) Delete(clusterMember *ClusterMember) (*http.Response, error)
type ConflictError ¶
type ConflictError ErrorResponse
ConflictError occurs when trying to create a resource that already exists. CheckResponse will return this type of error when Kong returns a 409 status code.
func (*ConflictError) Error ¶
func (r *ConflictError) Error() string
type Consumer ¶
type Consumer struct { ID string `json:"id,omitempty"` Username string `json:"username,omitempty"` CustomID string `json:"custom_id,omitempty"` CreatedAt int `json:"created_at,omitempty"` }
Consumer represents a single Kong consumer object
type ConsumerACLConfig ¶
type ConsumerACLConfigs ¶
type ConsumerACLConfigs struct { Data []*ConsumerACLConfig `json:"data,omitempty"` Total int `json:"total,omitempty"` }
type ConsumerJWTConfig ¶
type ConsumerJWTConfigs ¶
type ConsumerJWTConfigs struct { Data []*ConsumerJWTConfig `json:"data,omitempty"` Total int `json:"total,omitemtpy"` }
type ConsumerKeyAuthConfig ¶
type ConsumerKeyAuthConfigs ¶
type ConsumerKeyAuthConfigs struct { Data []*ConsumerKeyAuthConfig `json:"data,omitempty"` Total int `json:"total,omitemtpy"` }
type Consumers ¶
type Consumers struct { Data []*Consumer `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` }
Consumers represents the object returned from Kong when querying for multiple consumer objects.
In cases where the number of objects returned exceeds the maximum, Next holds the URI for the next set of results. i.e. "http://localhost:8001/consumers/?size=2&offset=4d924084-1adb-40a5-c042-63b19db421d1"
type ConsumersACLService ¶
type ConsumersACLService service
func (*ConsumersACLService) Delete ¶
func (s *ConsumersACLService) Delete(consumer, id string) (*http.Response, error)
func (*ConsumersACLService) GetAll ¶
func (s *ConsumersACLService) GetAll(consumer string) (*ConsumerACLConfigs, *http.Response, error)
func (*ConsumersACLService) Post ¶
func (s *ConsumersACLService) Post(consumer string, config *ConsumerACLConfig) (*http.Response, error)
type ConsumersGetAllOptions ¶
type ConsumersGetAllOptions struct { ID string `url:"id,omitempty"` // A filter on the list based on the consumer id field. CustomID string `url:"custom_id,omitempty"` // A filter on the list based on the consumer custom_id field. Username string `url:"username,omitempty"` // A filter on the list based on the consumer username field. Size int `url:"size,omitempty"` // A limit on the number of objects to be returned. Offset string `url:"offset,omitempty"` // A cursor used for pagination. offset is an object identifier that defines a place in the list. }
ConsumersGetAllOptions specifies optional filter parameters to the ConsumersService.GetAll method.
Additional information about filtering options can be found in the Kong documentation at: https://getkong.org/docs/0.9.x/admin-api/#list-consumers
type ConsumersJWTService ¶
type ConsumersJWTService service
func (*ConsumersJWTService) Delete ¶
func (s *ConsumersJWTService) Delete(consumer, id string) (*http.Response, error)
func (*ConsumersJWTService) GetAll ¶
func (s *ConsumersJWTService) GetAll(consumer string) (*ConsumerJWTConfigs, *http.Response, error)
func (*ConsumersJWTService) Post ¶
func (s *ConsumersJWTService) Post(consumer string, config *ConsumerJWTConfig) (*ConsumerJWTConfig, *http.Response, error)
type ConsumersKeyAuthService ¶
type ConsumersKeyAuthService service
func (*ConsumersKeyAuthService) Delete ¶
func (s *ConsumersKeyAuthService) Delete(consumer, id string) (*http.Response, error)
func (*ConsumersKeyAuthService) GetAll ¶
func (s *ConsumersKeyAuthService) GetAll(consumer string) (*ConsumerKeyAuthConfigs, *http.Response, error)
func (*ConsumersKeyAuthService) Post ¶
func (s *ConsumersKeyAuthService) Post(consumer string, config *ConsumerKeyAuthConfig) (*ConsumerKeyAuthConfig, *http.Response, error)
type ConsumersPlugins ¶
type ConsumersPlugins struct { ACL *ConsumersACLService JWT *ConsumersJWTService KeyAuth *ConsumersKeyAuthService }
type ConsumersService ¶
type ConsumersService struct { Plugins *ConsumersPlugins // contains filtered or unexported fields }
ConsumersService handles communication with Kong's '/consumers' resource.
func (*ConsumersService) Delete ¶
func (s *ConsumersService) Delete(consumer string) (*http.Response, error)
ConsumersService.Delete deletes a single Kong consumer object, by name or id.
Equivalent to DELETE /consumers/{username or id}
func (*ConsumersService) Get ¶
ConsumersService.Get queries for a single Kong consumer object, by name or id.
Equivalent to GET /consumers/{name or id}
func (*ConsumersService) GetAll ¶
func (s *ConsumersService) GetAll(opt *ConsumersGetAllOptions) (*Consumers, *http.Response, error)
ConsumersService.GetAll queries for all Kong consumer objects. This query can be filtered by supplying the ConsumersGetAllOptions struct.
Equivalent to GET /consumers?uri=params&from=opt
func (*ConsumersService) Patch ¶
func (s *ConsumersService) Patch(consumer *Consumer) (*http.Response, error)
ConsumersService.Patch updates an existing Kong consumer object. At least one of consumer.Username or consumer.ID must be specified in the passed *Consumer parameter.
Equivalent to PATCH /consumers/{username or id}
type CorrelationIDConfig ¶
type EnabledPlugins ¶
type EnabledPlugins struct {
Plugins []string `json:"enabled_plugins,omitempty"`
}
EnabledPlugins represents the list of Plugins returned when querying /plugins/enabled
type ErrorResponse ¶
type ErrorResponse struct { Request *http.Request // HTTP request object used for the failed request Response *http.Response // HTTP response that caused this error KongMessage string `json:"message,omitempty"` KongError string `json:"error,omitempty"` }
ErrorResponse is returned from Client.Do if Kong returns a status code outside the 200 range.
func (*ErrorResponse) Error ¶
func (r *ErrorResponse) Error() string
type FileLogConfig ¶
type FileLogConfig struct {
Path string `json:"path,omitempty"`
}
type HttpLogConfig ¶
type KeyAuthenticationConfig ¶
type Node ¶
type Node struct { Configuration map[string]interface{} `json:"configuration,omitempty"` Hostname string `json:"hostname,omitempty"` LuaVersion string `json:"lua_version,omitempty"` Plugins struct { AvailableOnServer map[string]bool `json:"available_on_server,omitempty"` EnabledInCluster map[string]bool `json:"enabled_in_cluster,omitempty"` } `json:"plugins,omitempty"` PRNGSeeds map[string]int `json:"prng_seeds,omitempty"` Tagline string `json:"tagline,omitempty"` Timers map[string]int `json:"timers,omitempty"` Version string `json:"version,omitempty"` }
type NodeService ¶
type NodeService service
type NotFoundError ¶
type NotFoundError ErrorResponse
NotFoundError occurs when trying to access a resource that does not exist. CheckResponse will return this type of error when Kong returns a 404 status code.
func (*NotFoundError) Error ¶
func (r *NotFoundError) Error() string
type Plugin ¶
type Plugin struct { ID string `json:"id,omitempty"` Name string `json:"name,omitempty"` CreatedAt int `json:"created_at,omitempty"` Enabled *bool `json:"enabled,omitempty"` ApiID string `json:"api_id,omitempty"` ConsumerID string `json:"consumer_id,omitempty"` Config map[string]interface{} `json:"config,omitempty"` }
Plugin represents a single Kong plugin object.
Because there are a myriad of structures for the Kong plugin config's, Plugin.Config is the generic map[string]interface{}. Helper method's exist on the more specific Plugin definitions to convert them to/from this struct.
type Plugins ¶
type Plugins struct { Data []*Plugin `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` }
Plugins represents the object returned from Kong when querying for multiple plugin objects.
In cases where the number of objects returned exceeds the maximum, Next holds the URI for the next set of results. i.e. "http://localhost:8001/plugins?size=2&offset=4d924084-1adb-40a5-c042-63b19db421d1"
type PluginsGetAllOptions ¶
type PluginsGetAllOptions struct { ID string `url:"id,omitempty"` // A filter on the list based on the id field. Name string `url:"name,omitempty"` // A filter on the list based on the name field. ApiID string `url:"api_id,omitempty"` // A filter on the list based on the api_id field. ConsumerID string `url:"consumer_id,omitempty"` // A filter on the list based on the consumer_id field. Size int `url:"size,omitempty"` // A limit on the number of objects to be returned. Offset string `url:"offset,omitempty"` // A cursor used for pagination. offset is an object identifier that defines a place in the list. }
PluginsGetAllOptions specifies optional filter parameters to the PluginsService.GetAll method.
Additional information about filtering options can be found in the Kong documentation at: https://getkong.org/docs/0.9.x/admin-api/#list-all-plugins
type PluginsService ¶
type PluginsService service
PluginsService handles communication with Kong's '/plugins' resource
func (*PluginsService) Delete ¶
PluginsService.Delete deletes a single Kong plugin object attached to a specifc api. Accepts either api name or id. Only accepts plugin id.
Equivalent to DELETE /apis/{name or id}/plugins/{id}
func (*PluginsService) Get ¶
PluginsService.Get queries for a single Kong plugin object by id
Equivalent to GET /plugins/{id}
func (*PluginsService) GetAll ¶
func (s *PluginsService) GetAll(opt *PluginsGetAllOptions) (*Plugins, *http.Response, error)
PluginsService.GetAll queries for all Kong plugins objects. This query can be filtered by supplying the PluginsGetAllOptions struct.
Equivalent to GET /plugins?uri=params&from=opt
func (*PluginsService) GetEnabled ¶
func (s *PluginsService) GetEnabled() (*EnabledPlugins, *http.Response, error)
PluginsService.GetEnabled queries for the list of all enabled Kong plugins.
func (*PluginsService) GetSchema ¶
PluginsService.GetSchema queries for the schema of a particular Kong plugin.
Equivalent to GET /plugins/schema/{name}
func (*PluginsService) Patch ¶
PluginsService.Patch updates an existing Kong plugin object for a specific api. Accepts either api name or id.
Equivalent to PATCH /apis/{name or id}/plugins/{id}
func (*PluginsService) Post ¶
func (s *PluginsService) Post(plugin *Plugin) (*http.Response, error)
PluginsService.Post creates a new Kong plugin object. Which consumer and api objects the plugin gets applied to depend on the values of ConsumerID and ApiID on the passed plugin object.
For more info see: https://getkong.org/docs/0.9.x/admin-api/#add-plugin
type RateLimitingConfig ¶
type RateLimitingConfig struct { Second int `json:"second,omitempty"` Minute int `json:"minute,omitempty"` Hour int `json:"hour,omitempty"` Day int `json:"day, omitempty"` Month int `json:"month,omitempty"` Year int `json:"year, omitempty"` LimitBy string `json:"limit_by,omitempty"` Policy string `json:"policy,omitempty"` FaultTolerant *bool `json:"fault_tolerant,omitempty"` RedisHost string `json:"redis_host,omitempty"` RedisPort string `json:"redis_port,omitempty"` RedisPassword string `json:"redis_password,omitempty"` RedisTimeout int `json:"redis_timeout,omitempty"` }
type RequestSizeLimitingConfig ¶
type RequestSizeLimitingConfig struct {
AllowedPayloadSize int `json:"allowed_payload_size,omitempty"`
}
type Target ¶
type Target struct { Target string `json:"target"` ID string `json:"id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` Weight int `json:"weight,omitempty"` UpstreamID string `json:"upstream_id,omitempty"` }
Target represents a single Kong target object.
type TargetCount ¶
type TargetCount struct {
Total int `json:"total"`
}
TargetCount represents the number of targets on an upstream
type Targets ¶
type Targets struct { Data []*Target `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` Offset string `json:"offset,omitempty"` }
Targets represents the object returned from Kong when querying for multiple target objects.
In cases where the number of objects returned exceeds the maximum, Next holds the URI for the next set of results. i.e. "http://localhost:8001/targets/?size=2&offset=4d924084-1adb-40a5-c042-63b19db421d1"
type TargetsService ¶
type TargetsService struct {
// contains filtered or unexported fields
}
TargetsService handles communication with Kong's '/upstreams/{name or id}/targets' resource.
func (*TargetsService) Delete ¶
Delete deletes a single Kong target object, by target (host/port combination)
Equivalent to DELETE /upstreams/{name or id}/targets/{target}
func (*TargetsService) GetAllActive ¶
GetAllActive lists all the active targets attached to the specified upstream.
Equivalent to GET/upstreams/{name or id}/targets/active
type Upstream ¶
type Upstream struct { Name string `json:"name"` ID string `json:"id,omitempty"` CreatedAt int64 `json:"created_at,omitempty"` Slots int `json:"slots,omitempty"` Orderlist []int `json:"orderliste,omitempty"` }
Upstream represents a single Kong upstream object.
type Upstreams ¶
type Upstreams struct { Data []*Upstream `json:"data,omitempty"` Total int `json:"total,omitempty"` Next string `json:"next,omitempty"` Offset string `json:"offset,omitempty"` }
Upstreams represents the object returned from Kong when querying for multiple upstream objects.
In cases where the number of objects returned exceeds the maximum, Next holds the URI for the next set of results. i.e. "http://localhost:8001/upstreams/?size=2&offset=4d924084-1adb-40a5-c042-63b19db421d1"
type UpstreamsService ¶
type UpstreamsService struct {
// contains filtered or unexported fields
}
UpstreamsService handles communication with Kong's '/upstreams' resource.
func (*UpstreamsService) Delete ¶
func (s *UpstreamsService) Delete(upstream string) (*http.Response, error)
Delete deletes a single Kong upstream object, by name or id.
Equivalent to DELETE /upstreams/{name or id}
func (*UpstreamsService) Get ¶
Get queries for a single Kong upstream object, by name or id.
Equivalent to GET /upstreams/{name or id}