Documentation ¶
Overview ¶
Package kong provides Go bindings to Kong's RESTful Admin API.
Index ¶
- func Bool(b bool) *bool
- func Int(i int) *int
- func IsNotFoundErr(e error) bool
- func String(s string) *string
- func StringSlice(elements ...string) []*string
- type ActiveHealthcheck
- type CIDRPort
- type Certificate
- type CertificateService
- func (s *CertificateService) Create(ctx context.Context, certificate *Certificate) (*Certificate, error)
- func (s *CertificateService) Delete(ctx context.Context, usernameOrID *string) error
- func (s *CertificateService) Get(ctx context.Context, usernameOrID *string) (*Certificate, error)
- func (s *CertificateService) List(ctx context.Context, opt *ListOpt) ([]*Certificate, *ListOpt, error)
- func (s *CertificateService) ListAll(ctx context.Context) ([]*Certificate, error)
- func (s *CertificateService) Update(ctx context.Context, certificate *Certificate) (*Certificate, error)
- type Client
- func (c *Client) Do(ctx context.Context, req *http.Request, v interface{}) (*Response, error)
- func (c *Client) Root(ctx context.Context) (map[string]interface{}, error)
- func (c *Client) SetDebugMode(enableDebug bool)
- func (c *Client) SetLogger(w io.Writer)
- func (c *Client) Status(ctx context.Context) (*Status, error)
- type Configuration
- type Consumer
- type ConsumerService
- func (s *ConsumerService) Create(ctx context.Context, consumer *Consumer) (*Consumer, error)
- func (s *ConsumerService) Delete(ctx context.Context, usernameOrID *string) error
- func (s *ConsumerService) Get(ctx context.Context, usernameOrID *string) (*Consumer, error)
- func (s *ConsumerService) List(ctx context.Context, opt *ListOpt) ([]*Consumer, *ListOpt, error)
- func (s *ConsumerService) ListAll(ctx context.Context) ([]*Consumer, error)
- func (s *ConsumerService) Update(ctx context.Context, consumer *Consumer) (*Consumer, error)
- type CustomEntityService
- func (s *CustomEntityService) Create(ctx context.Context, entity custom.Entity) (custom.Entity, error)
- func (s *CustomEntityService) Delete(ctx context.Context, entity custom.Entity) error
- func (s *CustomEntityService) Get(ctx context.Context, entity custom.Entity) (custom.Entity, error)
- func (s *CustomEntityService) List(ctx context.Context, opt *ListOpt, entity custom.Entity) ([]custom.Entity, *ListOpt, error)
- func (s *CustomEntityService) ListAll(ctx context.Context, entity custom.Entity) ([]custom.Entity, error)
- func (s *CustomEntityService) Update(ctx context.Context, entity custom.Entity) (custom.Entity, error)
- type Healthcheck
- type Healthy
- type ListOpt
- type PassiveHealthcheck
- type Plugin
- type PluginService
- func (s *PluginService) Create(ctx context.Context, plugin *Plugin) (*Plugin, error)
- func (s *PluginService) Delete(ctx context.Context, usernameOrID *string) error
- func (s *PluginService) Get(ctx context.Context, usernameOrID *string) (*Plugin, error)
- func (s *PluginService) List(ctx context.Context, opt *ListOpt) ([]*Plugin, *ListOpt, error)
- func (s *PluginService) ListAll(ctx context.Context) ([]*Plugin, error)
- func (s *PluginService) ListAllForConsumer(ctx context.Context, consumerIDorName *string) ([]*Plugin, error)
- func (s *PluginService) ListAllForRoute(ctx context.Context, routeID *string) ([]*Plugin, error)
- func (s *PluginService) ListAllForService(ctx context.Context, serviceIDorName *string) ([]*Plugin, error)
- func (s *PluginService) Update(ctx context.Context, plugin *Plugin) (*Plugin, error)
- type Response
- type Route
- type RouteService
- func (s *RouteService) Create(ctx context.Context, route *Route) (*Route, error)
- func (s *RouteService) CreateInService(ctx context.Context, serviceID *string, route *Route) (*Route, error)
- func (s *RouteService) Delete(ctx context.Context, nameOrID *string) error
- func (s *RouteService) Get(ctx context.Context, nameOrID *string) (*Route, error)
- func (s *RouteService) List(ctx context.Context, opt *ListOpt) ([]*Route, *ListOpt, error)
- func (s *RouteService) ListAll(ctx context.Context) ([]*Route, error)
- func (s *RouteService) ListForService(ctx context.Context, serviceNameOrID *string, opt *ListOpt) ([]*Route, *ListOpt, error)
- func (s *RouteService) Update(ctx context.Context, route *Route) (*Route, error)
- type SNI
- type SNIService
- func (s *SNIService) Create(ctx context.Context, sni *SNI) (*SNI, error)
- func (s *SNIService) Delete(ctx context.Context, usernameOrID *string) error
- func (s *SNIService) Get(ctx context.Context, usernameOrID *string) (*SNI, error)
- func (s *SNIService) List(ctx context.Context, opt *ListOpt) ([]*SNI, *ListOpt, error)
- func (s *SNIService) ListAll(ctx context.Context) ([]*SNI, error)
- func (s *SNIService) ListForCertificate(ctx context.Context, certificateID *string, opt *ListOpt) ([]*SNI, *ListOpt, error)
- func (s *SNIService) Update(ctx context.Context, sni *SNI) (*SNI, error)
- type Service
- type Status
- type Svcservice
- func (s *Svcservice) Create(ctx context.Context, service *Service) (*Service, error)
- func (s *Svcservice) Delete(ctx context.Context, nameOrID *string) error
- func (s *Svcservice) Get(ctx context.Context, nameOrID *string) (*Service, error)
- func (s *Svcservice) GetForRoute(ctx context.Context, routeID *string) (*Service, error)
- func (s *Svcservice) List(ctx context.Context, opt *ListOpt) ([]*Service, *ListOpt, error)
- func (s *Svcservice) ListAll(ctx context.Context) ([]*Service, error)
- func (s *Svcservice) Update(ctx context.Context, service *Service) (*Service, error)
- type Target
- type TargetService
- func (s *TargetService) Create(ctx context.Context, upstreamNameOrID *string, target *Target) (*Target, error)
- func (s *TargetService) Delete(ctx context.Context, upstreamNameOrID *string, targetOrID *string) error
- func (s *TargetService) List(ctx context.Context, upstreamNameOrID *string, opt *ListOpt) ([]*Target, *ListOpt, error)
- func (s *TargetService) ListAll(ctx context.Context, upstreamNameOrID *string) ([]*Target, error)
- func (s *TargetService) MarkHealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
- func (s *TargetService) MarkUnhealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
- type Unhealthy
- type Upstream
- type UpstreamService
- func (s *UpstreamService) Create(ctx context.Context, upstream *Upstream) (*Upstream, error)
- func (s *UpstreamService) Delete(ctx context.Context, upstreamNameOrID *string) error
- func (s *UpstreamService) Get(ctx context.Context, upstreamNameOrID *string) (*Upstream, error)
- func (s *UpstreamService) List(ctx context.Context, opt *ListOpt) ([]*Upstream, *ListOpt, error)
- func (s *UpstreamService) ListAll(ctx context.Context) ([]*Upstream, error)
- func (s *UpstreamService) Update(ctx context.Context, upstream *Upstream) (*Upstream, error)
- type Validator
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func IsNotFoundErr ¶
IsNotFoundErr returns true if the error or it's cause is a 404 response from Kong.
func StringSlice ¶
StringSlice converts a slice of string to a slice of *string
Types ¶
type ActiveHealthcheck ¶
type ActiveHealthcheck struct { Concurrency *int `json:"concurrency,omitempty" yaml:"concurrency,omitempty"` Healthy *Healthy `json:"healthy,omitempty" yaml:"healthy,omitempty"` HTTPPath *string `json:"http_path,omitempty" yaml:"http_path,omitempty"` HTTPSSni *string `json:"https_sni,omitempty" yaml:"https_sni,omitempty"` HTTPSVerifyCertificate *bool `json:"https_verify_certificate,omitempty" yaml:"https_verify_certificate,omitempty"` Type *string `json:"type,omitempty" yaml:"type,omitempty"` Timeout *int `json:"timeout,omitempty" yaml:"timeout,omitempty"` Unhealthy *Unhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"` }
ActiveHealthcheck configures active health check probing. +k8s:deepcopy-gen=true
func (*ActiveHealthcheck) DeepCopy ¶
func (in *ActiveHealthcheck) DeepCopy() *ActiveHealthcheck
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ActiveHealthcheck.
func (*ActiveHealthcheck) DeepCopyInto ¶
func (in *ActiveHealthcheck) DeepCopyInto(out *ActiveHealthcheck)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CIDRPort ¶
type CIDRPort struct { IP *string `json:"ip,omitempty" yaml:"ip,omitempty"` Port *int `json:"port,omitempty" yaml:"port,omitempty"` }
CIDRPort represents a set of CIDR and a port. +k8s:deepcopy-gen=true
func (*CIDRPort) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPort.
func (*CIDRPort) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Certificate ¶
type Certificate struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` Cert *string `json:"cert,omitempty" yaml:"cert,omitempty"` Key *string `json:"key,omitempty" yaml:"key,omitempty"` CreatedAt *int64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` SNIs []*string `json:"snis,omitempty" yaml:"snis,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Certificate represents a Certificate in Kong. Read https://getkong.org/docs/0.14.x/admin-api/#certificate-object +k8s:deepcopy-gen=true
func (*Certificate) DeepCopy ¶
func (in *Certificate) DeepCopy() *Certificate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Certificate.
func (*Certificate) DeepCopyInto ¶
func (in *Certificate) DeepCopyInto(out *Certificate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
func (*Certificate) String ¶
func (c *Certificate) String() string
func (*Certificate) Valid ¶
func (c *Certificate) Valid() bool
Valid checks if all the fields in Consumer are valid.
type CertificateService ¶
type CertificateService service
CertificateService handles Certificates in Kong.
func (*CertificateService) Create ¶
func (s *CertificateService) Create(ctx context.Context, certificate *Certificate) (*Certificate, error)
Create creates a Certificate in Kong. If an ID is specified, it will be used to create a certificate in Kong, otherwise an ID is auto-generated.
func (*CertificateService) Delete ¶
func (s *CertificateService) Delete(ctx context.Context, usernameOrID *string) error
Delete deletes a Certificate in Kong
func (*CertificateService) Get ¶
func (s *CertificateService) Get(ctx context.Context, usernameOrID *string) (*Certificate, error)
Get fetches a Certificate in Kong.
func (*CertificateService) List ¶
func (s *CertificateService) List(ctx context.Context, opt *ListOpt) ([]*Certificate, *ListOpt, error)
List fetches a list of certificate in Kong. opt can be used to control pagination.
func (*CertificateService) ListAll ¶
func (s *CertificateService) ListAll(ctx context.Context) ([]*Certificate, error)
ListAll fetches all Certificates in Kong. This method can take a while if there a lot of Certificates present.
func (*CertificateService) Update ¶
func (s *CertificateService) Update(ctx context.Context, certificate *Certificate) (*Certificate, error)
Update updates a Certificate in Kong
type Client ¶
type Client struct { Consumers *ConsumerService Services *Svcservice Routes *RouteService Certificates *CertificateService Plugins *PluginService SNIs *SNIService Upstreams *UpstreamService Targets *TargetService CustomEntities *CustomEntityService custom.Registry // contains filtered or unexported fields }
Client talks to the Admin API or control plane of a Kong cluster
func (*Client) SetDebugMode ¶
SetDebugMode enables or disables logging of the request to the logger set by SetLogger(). By default, debug logging is disabled.
type Configuration ¶
type Configuration map[string]interface{}
Configuration represents a config of a plugin in Kong.
func (Configuration) DeepCopy ¶
func (in Configuration) DeepCopy() Configuration
DeepCopy copies the receiver, creating a new Configuration.
func (Configuration) DeepCopyInto ¶
func (in Configuration) DeepCopyInto(out *Configuration)
DeepCopyInto copies the receiver, writing into out. in must be non-nil.
type Consumer ¶
type Consumer struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` CustomID *string `json:"custom_id,omitempty" yaml:"custom_id,omitempty"` Username *string `json:"username,omitempty" yaml:"username,omitempty"` CreatedAt *int64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Consumer represents a Consumer in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#consumer-object +k8s:deepcopy-gen=true
func (*Consumer) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Consumer.
func (*Consumer) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ConsumerService ¶
type ConsumerService service
ConsumerService handles Consumers in Kong.
func (*ConsumerService) Create ¶
Create creates a Consumer in Kong. If an ID is specified, it will be used to create a consumer in Kong, otherwise an ID is auto-generated.
func (*ConsumerService) Delete ¶
func (s *ConsumerService) Delete(ctx context.Context, usernameOrID *string) error
Delete deletes a Consumer in Kong
func (*ConsumerService) List ¶
List fetches a list of Consumers in Kong. opt can be used to control pagination.
type CustomEntityService ¶
type CustomEntityService service
CustomEntityService handles custom entities in Kong.
func (*CustomEntityService) Create ¶
func (s *CustomEntityService) Create(ctx context.Context, entity custom.Entity) (custom.Entity, error)
Create creates a custom entity based on entity. All required fields must be present in entity.
func (*CustomEntityService) Get ¶
Get fetches a custom entity. The primary key and all relations of the entity must be populated in entity.
func (*CustomEntityService) List ¶
func (s *CustomEntityService) List(ctx context.Context, opt *ListOpt, entity custom.Entity) ([]custom.Entity, *ListOpt, error)
List fetches all custom entities based on relations
type Healthcheck ¶
type Healthcheck struct { Active *ActiveHealthcheck `json:"active,omitempty" yaml:"active,omitempty"` Passive *PassiveHealthcheck `json:"passive,omitempty" yaml:"passive,omitempty"` }
Healthcheck represents a health-check config of an upstream in Kong. +k8s:deepcopy-gen=true
func (*Healthcheck) DeepCopy ¶
func (in *Healthcheck) DeepCopy() *Healthcheck
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Healthcheck.
func (*Healthcheck) DeepCopyInto ¶
func (in *Healthcheck) DeepCopyInto(out *Healthcheck)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Healthy ¶
type Healthy struct { HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"` Interval *int `json:"interval,omitempty" yaml:"interval,omitempty"` Successes *int `json:"successes,omitempty" yaml:"successes,omitempty"` }
Healthy configures thresholds and HTTP status codes to mark targets healthy for an upstream. +k8s:deepcopy-gen=true
func (*Healthy) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Healthy.
func (*Healthy) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ListOpt ¶
type ListOpt struct { // Size of the page Size int `url:"size,omitempty"` // Offset for the current page Offset string `url:"offset,omitempty"` // Tags to use for filtering the list. Tags []*string `url:"tags,omitempty"` // Tags are ORed by default, meaning entities // containing even a single tag in the list are listed. // If true, tags are ANDed, meaning only entities // matching each tag in the Tags array are listed. MatchAllTags bool }
ListOpt aids in paginating through list endpoints
type PassiveHealthcheck ¶
type PassiveHealthcheck struct { Healthy *Healthy `json:"healthy,omitempty" yaml:"healthy,omitempty"` Unhealthy *Unhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"` }
PassiveHealthcheck configures passive checks around passive health checks. +k8s:deepcopy-gen=true
func (*PassiveHealthcheck) DeepCopy ¶
func (in *PassiveHealthcheck) DeepCopy() *PassiveHealthcheck
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new PassiveHealthcheck.
func (*PassiveHealthcheck) DeepCopyInto ¶
func (in *PassiveHealthcheck) DeepCopyInto(out *PassiveHealthcheck)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Plugin ¶
type Plugin struct { CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Name *string `json:"name,omitempty" yaml:"name,omitempty"` Route *Route `json:"route,omitempty" yaml:"route,omitempty"` Service *Service `json:"service,omitempty" yaml:"service,omitempty"` Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` Config Configuration `json:"config,omitempty" yaml:"config,omitempty"` Enabled *bool `json:"enabled,omitempty" yaml:"enabled,omitempty"` RunOn *string `json:"run_on,omitempty" yaml:"run_on,omitempty"` Protocols []*string `json:"protocols,omitempty" yaml:"protocols,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Plugin represents a Plugin in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Plugin-object +k8s:deepcopy-gen=true
func (*Plugin) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin.
func (*Plugin) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type PluginService ¶
type PluginService service
PluginService handles Plugins in Kong.
func (*PluginService) Create ¶
Create creates a Plugin in Kong. If an ID is specified, it will be used to create a plugin in Kong, otherwise an ID is auto-generated.
func (*PluginService) Delete ¶
func (s *PluginService) Delete(ctx context.Context, usernameOrID *string) error
Delete deletes a Plugin in Kong
func (*PluginService) List ¶
List fetches a list of Plugins in Kong. opt can be used to control pagination.
func (*PluginService) ListAll ¶
func (s *PluginService) ListAll(ctx context.Context) ([]*Plugin, error)
ListAll fetches all Plugins in Kong. This method can take a while if there a lot of Plugins present.
func (*PluginService) ListAllForConsumer ¶
func (s *PluginService) ListAllForConsumer(ctx context.Context, consumerIDorName *string) ([]*Plugin, error)
ListAllForConsumer fetches all Plugins in Kong enabled for a consumer.
func (*PluginService) ListAllForRoute ¶
ListAllForRoute fetches all Plugins in Kong enabled for a service.
func (*PluginService) ListAllForService ¶
func (s *PluginService) ListAllForService(ctx context.Context, serviceIDorName *string) ([]*Plugin, error)
ListAllForService fetches all Plugins in Kong enabled for a service.
type Route ¶
type Route struct { CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` Hosts []*string `json:"hosts,omitempty" yaml:"hosts,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Name *string `json:"name,omitempty" yaml:"name,omitempty"` Methods []*string `json:"methods,omitempty" yaml:"methods,omitempty"` Paths []*string `json:"paths,omitempty" yaml:"paths,omitempty"` PreserveHost *bool `json:"preserve_host,omitempty" yaml:"preserve_host,omitempty"` Protocols []*string `json:"protocols,omitempty" yaml:"protocols,omitempty"` RegexPriority *int `json:"regex_priority,omitempty" yaml:"regex_priority,omitempty"` Service *Service `json:"service,omitempty" yaml:"service,omitempty"` StripPath *bool `json:"strip_path,omitempty" yaml:"strip_path,omitempty"` UpdatedAt *int `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` SNIs []*string `json:"snis,omitempty" yaml:"snis,omitempty"` Sources []*CIDRPort `json:"sources,omitempty" yaml:"sources,omitempty"` Destinations []*CIDRPort `json:"destinations,omitempty" yaml:"destinations,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Route represents a Route in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Route-object +k8s:deepcopy-gen=true
func (*Route) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.
func (*Route) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type RouteService ¶
type RouteService service
RouteService handles routes in Kong.
func (*RouteService) Create ¶
Create creates a Route in Kong If an ID is specified, it will be used to create a route in Kong, otherwise an ID is auto-generated.
func (*RouteService) CreateInService ¶
func (s *RouteService) CreateInService(ctx context.Context, serviceID *string, route *Route) (*Route, error)
CreateInService creates a route associated with serviceID
func (*RouteService) Delete ¶
func (s *RouteService) Delete(ctx context.Context, nameOrID *string) error
Delete deletes a Route in Kong
func (*RouteService) List ¶
List fetches a list of Routes in Kong. opt can be used to control pagination.
func (*RouteService) ListAll ¶
func (s *RouteService) ListAll(ctx context.Context) ([]*Route, error)
ListAll fetches all Routes in Kong. This method can take a while if there a lot of Routes present.
func (*RouteService) ListForService ¶
func (s *RouteService) ListForService(ctx context.Context, serviceNameOrID *string, opt *ListOpt) ([]*Route, *ListOpt, error)
ListForService fetches a list of Routes in Kong associated with a service. opt can be used to control pagination.
type SNI ¶
type SNI struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` Name *string `json:"name,omitempty" yaml:"name,omitempty"` CreatedAt *int64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` Certificate *Certificate `json:"certificate,omitempty" yaml:"certificate,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
SNI represents a SNI in Kong. Read https://getkong.org/docs/0.14.x/admin-api/#sni-object +k8s:deepcopy-gen=true
func (*SNI) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNI.
func (*SNI) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type SNIService ¶
type SNIService service
SNIService handles SNIs in Kong.
func (*SNIService) Create ¶
Create creates a SNI in Kong. If an ID is specified, it will be used to create a sni in Kong, otherwise an ID is auto-generated.
func (*SNIService) Delete ¶
func (s *SNIService) Delete(ctx context.Context, usernameOrID *string) error
Delete deletes a SNI in Kong
func (*SNIService) List ¶
List fetches a list of SNIs in Kong. opt can be used to control pagination.
func (*SNIService) ListAll ¶
func (s *SNIService) ListAll(ctx context.Context) ([]*SNI, error)
ListAll fetches all SNIs in Kong. This method can take a while if there a lot of SNIs present.
func (*SNIService) ListForCertificate ¶
func (s *SNIService) ListForCertificate(ctx context.Context, certificateID *string, opt *ListOpt) ([]*SNI, *ListOpt, error)
ListForCertificate fetches a list of SNIs in Kong associated with certificateID. opt can be used to control pagination.
type Service ¶
type Service struct { ConnectTimeout *int `json:"connect_timeout,omitempty" yaml:"connect_timeout,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` Host *string `json:"host,omitempty" yaml:"host,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Name *string `json:"name,omitempty" yaml:"name,omitempty"` Path *string `json:"path,omitempty" yaml:"path,omitempty"` Port *int `json:"port,omitempty" yaml:"port,omitempty"` Protocol *string `json:"protocol,omitempty" yaml:"protocol,omitempty"` ReadTimeout *int `json:"read_timeout,omitempty" yaml:"read_timeout,omitempty"` Retries *int `json:"retries,omitempty" yaml:"retries,omitempty"` UpdatedAt *int `json:"updated_at,omitempty" yaml:"updated_at,omitempty"` WriteTimeout *int `json:"write_timeout,omitempty" yaml:"write_timeout,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Service represents a Service in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Service-object +k8s:deepcopy-gen=true
func (*Service) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.
func (*Service) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Status ¶
type Status struct { Database struct { Reachable bool `json:"reachable"` } `json:"database"` Server struct { ConnectionsAccepted int `json:"connections_accepted"` ConnectionsActive int `json:"connections_active"` ConnectionsHandled int `json:"connections_handled"` ConnectionsReading int `json:"connections_reading"` ConnectionsWaiting int `json:"connections_waiting"` ConnectionsWriting int `json:"connections_writing"` TotalRequests int `json:"total_requests"` } `json:"server"` }
Status respresents current status of a Kong node.
type Svcservice ¶
type Svcservice service
Svcservice handles services in Kong.
func (*Svcservice) Create ¶
Create creates an Service in Kong If an ID is specified, it will be used to create a service in Kong, otherwise an ID is auto-generated.
func (*Svcservice) Delete ¶
func (s *Svcservice) Delete(ctx context.Context, nameOrID *string) error
Delete deletes an Service in Kong
func (*Svcservice) GetForRoute ¶
GetForRoute fetches a Service associated with routeID in Kong.
func (*Svcservice) List ¶
List fetches a list of Services in Kong. opt can be used to control pagination.
type Target ¶
type Target struct { CreatedAt *float64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Target *string `json:"target,omitempty" yaml:"target,omitempty"` Upstream *Upstream `json:"upstream,omitempty" yaml:"upstream,omitempty"` Weight *int `json:"weight,omitempty" yaml:"weight,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Target represents a Target in Kong. +k8s:deepcopy-gen=true
func (*Target) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target.
func (*Target) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type TargetService ¶
type TargetService service
TargetService handles Targets in Kong.
func (*TargetService) Create ¶
func (s *TargetService) Create(ctx context.Context, upstreamNameOrID *string, target *Target) (*Target, error)
Create creates a Target in Kong under upstreamID. If an ID is specified, it will be used to create a target in Kong, otherwise an ID is auto-generated.
func (*TargetService) Delete ¶
func (s *TargetService) Delete(ctx context.Context, upstreamNameOrID *string, targetOrID *string) error
Delete deletes a Target in Kong
func (*TargetService) List ¶
func (s *TargetService) List(ctx context.Context, upstreamNameOrID *string, opt *ListOpt) ([]*Target, *ListOpt, error)
List fetches a list of Targets in Kong. opt can be used to control pagination.
func (*TargetService) MarkHealthy ¶
func (s *TargetService) MarkHealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
MarkHealthy marks target belonging to upstreamNameOrID as healthy in Kong's load balancer.
func (*TargetService) MarkUnhealthy ¶
func (s *TargetService) MarkUnhealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
MarkUnhealthy marks target belonging to upstreamNameOrID as unhealthy in Kong's load balancer.
type Unhealthy ¶
type Unhealthy struct { HTTPFailures *int `json:"http_failures,omitempty" yaml:"http_failures,omitempty"` HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"` TCPFailures *int `json:"tcp_failures,omitempty" yaml:"tcp_failures,omitempty"` Timeouts *int `json:"timeouts,omitempty" yaml:"timeouts,omitempty"` }
Unhealthy configures thresholds and HTTP status codes to mark targets unhealthy. +k8s:deepcopy-gen=true
func (*Unhealthy) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Unhealthy.
func (*Unhealthy) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Upstream ¶
type Upstream struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` Name *string `json:"name,omitempty" yaml:"name,omitempty"` Slots *int `json:"slots,omitempty" yaml:"slots,omitempty"` Healthchecks *Healthcheck `json:"healthchecks,omitempty" yaml:"healthchecks,omitempty"` CreatedAt *int64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` HashOn *string `json:"hash_on,omitempty" yaml:"hash_on,omitempty"` HashFallback *string `json:"hash_fallback,omitempty" yaml:"hash_fallback,omitempty"` HashOnHeader *string `json:"hash_on_header,omitempty" yaml:"hash_on_header,omitempty"` HashFallbackHeader *string `json:"hash_fallback_header,omitempty" yaml:"hash_fallback_header,omitempty"` HashOnCookie *string `json:"hash_on_cookie,omitempty" yaml:"hash_on_cookie,omitempty"` HashOnCookiePath *string `json:"hash_on_cookie_path,omitempty" yaml:"hash_on_cookie_path,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Upstream represents a Consumer in Kong. +k8s:deepcopy-gen=true
func (*Upstream) DeepCopy ¶
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Upstream.
func (*Upstream) DeepCopyInto ¶
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type UpstreamService ¶
type UpstreamService service
UpstreamService handles Upstreams in Kong.
func (*UpstreamService) Create ¶
Create creates a Upstream in Kong. If an ID is specified, it will be used to create a upstream in Kong, otherwise an ID is auto-generated.
func (*UpstreamService) Delete ¶
func (s *UpstreamService) Delete(ctx context.Context, upstreamNameOrID *string) error
Delete deletes a Upstream in Kong
func (*UpstreamService) List ¶
List fetches a list of Upstreams in Kong. opt can be used to control pagination.
Source Files ¶
- bundled_custom_entities.go
- certificate.go
- certificate_service.go
- consumer.go
- consumer_service.go
- custom_entity_service.go
- doc.go
- error.go
- kong.go
- list.go
- plugin.go
- plugin_service.go
- request.go
- response.go
- route.go
- route_service.go
- service.go
- service_service.go
- sni.go
- sni_service.go
- target.go
- target_service.go
- types.go
- upstream.go
- upstream_service.go
- utils.go
- validator.go
- zz_generated.deepcopy.go