Documentation ¶
Overview ¶
Package kong provides Go bindings to Kong's RESTful Admin API.
Index ¶
- func Bool(b bool) *bool
- func HTTPClientWithHeaders(client *http.Client, headers http.Header) http.Client
- func Int(i int) *int
- func IsNotFoundErr(e error) bool
- func String(s string) *string
- func StringSlice(elements ...string) []*string
- type ACLGroup
- type ACLService
- func (s *ACLService) Create(ctx context.Context, consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)
- func (s *ACLService) Delete(ctx context.Context, consumerUsernameOrID, groupOrID *string) error
- func (s *ACLService) Get(ctx context.Context, consumerUsernameOrID, groupOrID *string) (*ACLGroup, error)
- func (s *ACLService) List(ctx context.Context, opt *ListOpt) ([]*ACLGroup, *ListOpt, error)
- func (s *ACLService) ListAll(ctx context.Context) ([]*ACLGroup, error)
- func (s *ACLService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*ACLGroup, *ListOpt, error)
- func (s *ACLService) Update(ctx context.Context, consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)
- type ActiveHealthcheck
- type Admin
- type AdminService
- func (s *AdminService) Create(ctx context.Context, admin *Admin) (*Admin, error)
- func (s *AdminService) Delete(ctx context.Context, AdminOrID *string) error
- func (s *AdminService) GenerateRegisterURL(ctx context.Context, nameOrID *string) (*Admin, error)
- func (s *AdminService) Get(ctx context.Context, nameOrID *string) (*Admin, error)
- func (s *AdminService) Invite(ctx context.Context, admin *Admin) (*Admin, error)
- func (s *AdminService) List(ctx context.Context, opt *ListOpt) ([]*Admin, *ListOpt, error)
- func (s *AdminService) RegisterCredentials(ctx context.Context, admin *Admin) error
- func (s *AdminService) Update(ctx context.Context, admin *Admin) (*Admin, error)
- type BasicAuth
- type BasicAuthService
- func (s *BasicAuthService) Create(ctx context.Context, consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)
- func (s *BasicAuthService) Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
- func (s *BasicAuthService) Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*BasicAuth, error)
- func (s *BasicAuthService) List(ctx context.Context, opt *ListOpt) ([]*BasicAuth, *ListOpt, error)
- func (s *BasicAuthService) ListAll(ctx context.Context) ([]*BasicAuth, error)
- func (s *BasicAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*BasicAuth, *ListOpt, error)
- func (s *BasicAuthService) Update(ctx context.Context, consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)
- type CACertificate
- type CACertificateService
- func (s *CACertificateService) Create(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
- func (s *CACertificateService) Delete(ctx context.Context, ID *string) error
- func (s *CACertificateService) Get(ctx context.Context, ID *string) (*CACertificate, error)
- func (s *CACertificateService) List(ctx context.Context, opt *ListOpt) ([]*CACertificate, *ListOpt, error)
- func (s *CACertificateService) ListAll(ctx context.Context) ([]*CACertificate, error)
- func (s *CACertificateService) Update(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
- 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) NewRequest(method, endpoint string, qs interface{}, body interface{}) (*http.Request, 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) GetByCustomID(ctx context.Context, customID *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 HMACAuth
- type HMACAuthService
- func (s *HMACAuthService) Create(ctx context.Context, consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)
- func (s *HMACAuthService) Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
- func (s *HMACAuthService) Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*HMACAuth, error)
- func (s *HMACAuthService) List(ctx context.Context, opt *ListOpt) ([]*HMACAuth, *ListOpt, error)
- func (s *HMACAuthService) ListAll(ctx context.Context) ([]*HMACAuth, error)
- func (s *HMACAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*HMACAuth, *ListOpt, error)
- func (s *HMACAuthService) Update(ctx context.Context, consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)
- type Healthcheck
- type Healthy
- type JWTAuth
- type JWTAuthService
- func (s *JWTAuthService) Create(ctx context.Context, consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)
- func (s *JWTAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
- func (s *JWTAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*JWTAuth, error)
- func (s *JWTAuthService) List(ctx context.Context, opt *ListOpt) ([]*JWTAuth, *ListOpt, error)
- func (s *JWTAuthService) ListAll(ctx context.Context) ([]*JWTAuth, error)
- func (s *JWTAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*JWTAuth, *ListOpt, error)
- func (s *JWTAuthService) Update(ctx context.Context, consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)
- type KeyAuth
- type KeyAuthService
- func (s *KeyAuthService) Create(ctx context.Context, consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)
- func (s *KeyAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
- func (s *KeyAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*KeyAuth, error)
- func (s *KeyAuthService) List(ctx context.Context, opt *ListOpt) ([]*KeyAuth, *ListOpt, error)
- func (s *KeyAuthService) ListAll(ctx context.Context) ([]*KeyAuth, error)
- func (s *KeyAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*KeyAuth, *ListOpt, error)
- func (s *KeyAuthService) Update(ctx context.Context, consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)
- type ListOpt
- type MTLSAuth
- type MTLSAuthService
- func (s *MTLSAuthService) Create(ctx context.Context, consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)
- func (s *MTLSAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
- func (s *MTLSAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*MTLSAuth, error)
- func (s *MTLSAuthService) List(ctx context.Context, opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)
- func (s *MTLSAuthService) ListAll(ctx context.Context) ([]*MTLSAuth, error)
- func (s *MTLSAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)
- func (s *MTLSAuthService) Update(ctx context.Context, consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)
- type Oauth2Credential
- type Oauth2Service
- func (s *Oauth2Service) Create(ctx context.Context, consumerUsernameOrID *string, ...) (*Oauth2Credential, error)
- func (s *Oauth2Service) Delete(ctx context.Context, consumerUsernameOrID, clientIDorID *string) error
- func (s *Oauth2Service) Get(ctx context.Context, consumerUsernameOrID, clientIDorID *string) (*Oauth2Credential, error)
- func (s *Oauth2Service) List(ctx context.Context, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
- func (s *Oauth2Service) ListAll(ctx context.Context) ([]*Oauth2Credential, error)
- func (s *Oauth2Service) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
- func (s *Oauth2Service) Update(ctx context.Context, consumerUsernameOrID *string, ...) (*Oauth2Credential, error)
- 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 Workspace
- type WorkspaceService
- func (s *WorkspaceService) Create(ctx context.Context, workspace *Workspace) (*Workspace, error)
- func (s *WorkspaceService) Delete(ctx context.Context, WorkspaceOrID *string) error
- func (s *WorkspaceService) Get(ctx context.Context, nameOrID *string) (*Workspace, error)
- func (s *WorkspaceService) List(ctx context.Context, opt *ListOpt) ([]*Workspace, *ListOpt, error)
- func (s *WorkspaceService) ListAll(ctx context.Context) ([]*Workspace, error)
- func (s *WorkspaceService) Update(ctx context.Context, workspace *Workspace) (*Workspace, error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func HTTPClientWithHeaders ¶ added in v0.12.0
RoundTripperWithHTTPHeaders returns a client which injects headers before sending any request.
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 ACLGroup ¶ added in v0.7.0
type ACLGroup struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Group *string `json:"group,omitempty" yaml:"group,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
ACLGroup represents an ACL group for a consumer in Kong. +k8s:deepcopy-gen=true
func (*ACLGroup) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACLGroup.
func (*ACLGroup) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type ACLService ¶ added in v0.7.0
type ACLService service
ACLService handles consumer ACL groups in Kong.
func (*ACLService) Create ¶ added in v0.7.0
func (s *ACLService) Create(ctx context.Context, consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)
Create adds a consumer to an ACL group in Kong If an ID is specified, it will be used to create the group association in Kong, otherwise an ID is auto-generated.
func (*ACLService) Delete ¶ added in v0.7.0
func (s *ACLService) Delete(ctx context.Context, consumerUsernameOrID, groupOrID *string) error
Delete deletes an ACL group association for a consumer in Kong
func (*ACLService) Get ¶ added in v0.7.0
func (s *ACLService) Get(ctx context.Context, consumerUsernameOrID, groupOrID *string) (*ACLGroup, error)
Get fetches an ACL group for a consumer in Kong.
func (*ACLService) List ¶ added in v0.7.0
List fetches a list of all ACL group and consumer associations in Kong. opt can be used to control pagination.
func (*ACLService) ListAll ¶ added in v0.7.0
func (s *ACLService) ListAll(ctx context.Context) ([]*ACLGroup, error)
ListAll fetches all all ACL group associations in Kong. This method can take a while if there a lot of ACLGroup associations are present.
func (*ACLService) ListForConsumer ¶ added in v0.7.0
func (s *ACLService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*ACLGroup, *ListOpt, error)
ListForConsumer fetches a list of ACL groups in Kong associated with a specific consumer. opt can be used to control pagination.
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 Admin ¶ added in v0.12.0
type Admin struct { CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Email *string `json:"email,omitempty" yaml:"email,omitempty"` Username *string `json:"username,omitempty" yaml:"username,omitempty"` Password *string `json:"password,omitempty" yaml:"password,omitempty"` CustomID *string `json:"custom_id,omitempty" yaml:"custom_id,omitempty"` RBACTokenEnabled *bool `json:"rbac_token_enabled,omitempty" yaml:"rbac_token_enabled,omitempty"` Status *int `json:"status,omitempty" yaml:"status,omitempty"` Token *string `json:"token,omitempty" yaml:"token,omitempty"` }
Admin represents an Admin in Kong.
type AdminService ¶ added in v0.12.0
type AdminService service
AdminService handles Admins in Kong.
func (*AdminService) Create ¶ added in v0.12.0
Create aliases the Invite function as it performs essentially the same operation.
func (*AdminService) Delete ¶ added in v0.12.0
func (s *AdminService) Delete(ctx context.Context, AdminOrID *string) error
Delete deletes an Admin in Kong
func (*AdminService) GenerateRegisterURL ¶ added in v0.12.0
GenerateRegisterURL fetches an Admin in Kong and returns a unique registration URL for the Admin
func (*AdminService) RegisterCredentials ¶ added in v0.12.0
func (s *AdminService) RegisterCredentials(ctx context.Context, admin *Admin) error
RegisterCredentials registers credentials for existing Kong Admins
type BasicAuth ¶ added in v0.7.0
type BasicAuth struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Username *string `json:"username,omitempty" yaml:"username,omitempty"` Password *string `json:"password,omitempty" yaml:"password,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
BasicAuth represents a basic-auth credential in Kong. +k8s:deepcopy-gen=true
func (*BasicAuth) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.
func (*BasicAuth) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type BasicAuthService ¶ added in v0.7.0
type BasicAuthService service
BasicAuthService handles basic-auth credentials in Kong.
func (*BasicAuthService) Create ¶ added in v0.7.0
func (s *BasicAuthService) Create(ctx context.Context, consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)
Create creates a basic-auth credential in Kong If an ID is specified, it will be used to create a basic-auth in Kong, otherwise an ID is auto-generated.
func (*BasicAuthService) Delete ¶ added in v0.7.0
func (s *BasicAuthService) Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
Delete deletes a basic-auth credential in Kong
func (*BasicAuthService) Get ¶ added in v0.7.0
func (s *BasicAuthService) Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*BasicAuth, error)
Get fetches a basic-auth credential from Kong.
func (*BasicAuthService) List ¶ added in v0.7.0
List fetches a list of basic-auth credentials in Kong. opt can be used to control pagination.
func (*BasicAuthService) ListAll ¶ added in v0.7.0
func (s *BasicAuthService) ListAll(ctx context.Context) ([]*BasicAuth, error)
ListAll fetches all basic-auth credentials in Kong. This method can take a while if there a lot of basic-auth credentials present.
func (*BasicAuthService) ListForConsumer ¶ added in v0.7.0
func (s *BasicAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*BasicAuth, *ListOpt, error)
ListForConsumer fetches a list of basic-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.
type CACertificate ¶ added in v0.6.0
type CACertificate struct { ID *string `json:"id,omitempty" yaml:"id,omitempty"` Cert *string `json:"cert,omitempty" yaml:"cert,omitempty"` CreatedAt *int64 `json:"created_at,omitempty" yaml:"created_at,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
CACertificate represents a CACertificate in Kong. +k8s:deepcopy-gen=true
func (*CACertificate) DeepCopy ¶ added in v0.6.0
func (in *CACertificate) DeepCopy() *CACertificate
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CACertificate.
func (*CACertificate) DeepCopyInto ¶ added in v0.6.0
func (in *CACertificate) DeepCopyInto(out *CACertificate)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type CACertificateService ¶ added in v0.6.0
type CACertificateService service
CACertificateService handles Certificates in Kong.
func (*CACertificateService) Create ¶ added in v0.6.0
func (s *CACertificateService) Create(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
Create creates a CACertificate in Kong. If an ID is specified, it will be used to create a certificate in Kong, otherwise an ID is auto-generated.
func (*CACertificateService) Delete ¶ added in v0.6.0
func (s *CACertificateService) Delete(ctx context.Context, ID *string) error
Delete deletes a CACertificate in Kong
func (*CACertificateService) Get ¶ added in v0.6.0
func (s *CACertificateService) Get(ctx context.Context, ID *string) (*CACertificate, error)
Get fetches a CACertificate in Kong.
func (*CACertificateService) List ¶ added in v0.6.0
func (s *CACertificateService) List(ctx context.Context, opt *ListOpt) ([]*CACertificate, *ListOpt, error)
List fetches a list of certificate in Kong. opt can be used to control pagination.
func (*CACertificateService) ListAll ¶ added in v0.6.0
func (s *CACertificateService) ListAll(ctx context.Context) ([]*CACertificate, error)
ListAll fetches all Certificates in Kong. This method can take a while if there a lot of Certificates present.
func (*CACertificateService) Update ¶ added in v0.6.0
func (s *CACertificateService) Update(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
Update updates a CACertificate in Kong
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.
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 CACertificates *CACertificateService Certificates *CertificateService Plugins *PluginService SNIs *SNIService Upstreams *UpstreamService Targets *TargetService Workspaces *WorkspaceService Admins *AdminService KeyAuths *KeyAuthService BasicAuths *BasicAuthService HMACAuths *HMACAuthService JWTAuths *JWTAuthService MTLSAuths *MTLSAuthService ACLs *ACLService Oauth2Credentials *Oauth2Service CustomEntities *CustomEntityService custom.Registry // contains filtered or unexported fields }
Client talks to the Admin API or control plane of a Kong cluster
func (*Client) NewRequest ¶ added in v0.9.0
func (c *Client) NewRequest(method, endpoint string, qs interface{}, body interface{}) (*http.Request, error)
NewRequest creates a request based on the inputs. endpoint should be relative to the baseURL specified during client creation. body is always marshaled into JSON.
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) GetByCustomID ¶ added in v0.9.0
GetByCustomID fetches 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 HMACAuth ¶ added in v0.7.0
type HMACAuth struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Username *string `json:"username,omitempty" yaml:"username,omitempty"` Secret *string `json:"secret,omitempty" yaml:"secret,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
HMACAuth represents a hmac-auth credential in Kong. +k8s:deepcopy-gen=true
func (*HMACAuth) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HMACAuth.
func (*HMACAuth) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type HMACAuthService ¶ added in v0.7.0
type HMACAuthService service
HMACAuthService handles hmac-auth credentials in Kong.
func (*HMACAuthService) Create ¶ added in v0.7.0
func (s *HMACAuthService) Create(ctx context.Context, consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)
Create creates a hmac-auth credential in Kong If an ID is specified, it will be used to create a hmac-auth in Kong, otherwise an ID is auto-generated.
func (*HMACAuthService) Delete ¶ added in v0.7.0
func (s *HMACAuthService) Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
Delete deletes a hmac-auth credential in Kong
func (*HMACAuthService) Get ¶ added in v0.7.0
func (s *HMACAuthService) Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*HMACAuth, error)
Get fetches a hmac-auth credential from Kong.
func (*HMACAuthService) List ¶ added in v0.7.0
List fetches a list of hmac-auth credentials in Kong. opt can be used to control pagination.
func (*HMACAuthService) ListAll ¶ added in v0.7.0
func (s *HMACAuthService) ListAll(ctx context.Context) ([]*HMACAuth, error)
ListAll fetches all hmac-auth credentials in Kong. This method can take a while if there a lot of hmac-auth credentials present.
func (*HMACAuthService) ListForConsumer ¶ added in v0.7.0
func (s *HMACAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*HMACAuth, *ListOpt, error)
ListForConsumer fetches a list of hmac-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.
type Healthcheck ¶
type Healthcheck struct { Active *ActiveHealthcheck `json:"active,omitempty" yaml:"active,omitempty"` Passive *PassiveHealthcheck `json:"passive,omitempty" yaml:"passive,omitempty"` Threshold *float64 `json:"threshold,omitempty" yaml:"threshold,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 JWTAuth ¶ added in v0.7.0
type JWTAuth struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Algorithm *string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"` Key *string `json:"key,omitempty" yaml:"key,omitempty"` RSAPublicKey *string `json:"rsa_public_key,omitempty" yaml:"rsa_public_key,omitempty"` Secret *string `json:"secret,omitempty" yaml:"secret,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
JWTAuth represents a JWT credential in Kong. +k8s:deepcopy-gen=true
func (*JWTAuth) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTAuth.
func (*JWTAuth) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type JWTAuthService ¶ added in v0.7.0
type JWTAuthService service
JWTAuthService handles JWT credentials in Kong.
func (*JWTAuthService) Create ¶ added in v0.7.0
func (s *JWTAuthService) Create(ctx context.Context, consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)
Create creates a JWT credential in Kong If an ID is specified, it will be used to create a JWT in Kong, otherwise an ID is auto-generated.
func (*JWTAuthService) Delete ¶ added in v0.7.0
func (s *JWTAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
Delete deletes a JWT credential in Kong
func (*JWTAuthService) Get ¶ added in v0.7.0
func (s *JWTAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*JWTAuth, error)
Get fetches a JWT credential from Kong.
func (*JWTAuthService) List ¶ added in v0.7.0
List fetches a list of JWT credentials in Kong. opt can be used to control pagination.
func (*JWTAuthService) ListAll ¶ added in v0.7.0
func (s *JWTAuthService) ListAll(ctx context.Context) ([]*JWTAuth, error)
ListAll fetches all JWT credentials in Kong. This method can take a while if there a lot of JWT credentials present.
func (*JWTAuthService) ListForConsumer ¶ added in v0.7.0
func (s *JWTAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*JWTAuth, *ListOpt, error)
ListForConsumer fetches a list of jwt credentials in Kong associated with a specific consumer. opt can be used to control pagination.
type KeyAuth ¶ added in v0.7.0
type KeyAuth struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` Key *string `json:"key,omitempty" yaml:"key,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
KeyAuth represents a key-auth credential in Kong. +k8s:deepcopy-gen=true
func (*KeyAuth) DeepCopy ¶ added in v0.7.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyAuth.
func (*KeyAuth) DeepCopyInto ¶ added in v0.7.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type KeyAuthService ¶ added in v0.7.0
type KeyAuthService service
KeyAuthService handles key-auth credentials in Kong.
func (*KeyAuthService) Create ¶ added in v0.7.0
func (s *KeyAuthService) Create(ctx context.Context, consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)
Create creates a key-auth credential in Kong If an ID is specified, it will be used to create a key-auth in Kong, otherwise an ID is auto-generated.
func (*KeyAuthService) Delete ¶ added in v0.7.0
func (s *KeyAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
Delete deletes a key-auth credential in Kong
func (*KeyAuthService) Get ¶ added in v0.7.0
func (s *KeyAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*KeyAuth, error)
Get fetches a key-auth credential from Kong.
func (*KeyAuthService) List ¶ added in v0.7.0
List fetches a list of key-auth credentials in Kong. opt can be used to control pagination.
func (*KeyAuthService) ListAll ¶ added in v0.7.0
func (s *KeyAuthService) ListAll(ctx context.Context) ([]*KeyAuth, error)
ListAll fetches all key-auth credentials in Kong. This method can take a while if there a lot of key-auth credentials present.
func (*KeyAuthService) ListForConsumer ¶ added in v0.7.0
func (s *KeyAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*KeyAuth, *ListOpt, error)
ListForConsumer fetches a list of key-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.
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 MTLSAuth ¶ added in v0.12.0
type MTLSAuth struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` CreatedAt *int `json:"created_at,omitempty" yaml:"created_at,omitempty"` ID *string `json:"id,omitempty" yaml:"id,omitempty"` SubjectName *string `json:"subject_name,omitempty" yaml:"subject_name,omitempty"` CACertificate *CACertificate `json:"ca_certificate,omitempty" yaml:"ca_certificate,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
MTLSAuth represents a MTLS credential in Kong. +k8s:deepcopy-gen=true
func (*MTLSAuth) DeepCopy ¶ added in v0.12.0
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MTLSAuth.
func (*MTLSAuth) DeepCopyInto ¶ added in v0.12.0
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type MTLSAuthService ¶ added in v0.12.0
type MTLSAuthService service
MTLSAuthService handles MTLS credentials in Kong.
func (*MTLSAuthService) Create ¶ added in v0.12.0
func (s *MTLSAuthService) Create(ctx context.Context, consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)
Create creates an MTLS credential in Kong If an ID is specified, it will be used to create a MTLS in Kong, otherwise an ID is auto-generated.
func (*MTLSAuthService) Delete ¶ added in v0.12.0
func (s *MTLSAuthService) Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
Delete deletes an MTLS credential in Kong
func (*MTLSAuthService) Get ¶ added in v0.12.0
func (s *MTLSAuthService) Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*MTLSAuth, error)
Get fetches an MTLS credential from Kong.
func (*MTLSAuthService) List ¶ added in v0.12.0
List fetches a list of MTLS credentials in Kong. opt can be used to control pagination.
func (*MTLSAuthService) ListAll ¶ added in v0.12.0
func (s *MTLSAuthService) ListAll(ctx context.Context) ([]*MTLSAuth, error)
ListAll fetches all MTLS credentials in Kong. This method can take a while if there a lot of MTLS credentials present.
func (*MTLSAuthService) ListForConsumer ¶ added in v0.12.0
func (s *MTLSAuthService) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)
ListForConsumer fetches a list of mtls credentials in Kong associated with a specific consumer. opt can be used to control pagination.
type Oauth2Credential ¶ added in v0.8.0
type Oauth2Credential struct { Consumer *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"` 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"` ClientID *string `json:"client_id,omitempty" yaml:"client_id,omitempty"` ClientSecret *string `json:"client_secret,omitempty" yaml:"client_secret,omitempty"` RedirectURIs []*string `json:"redirect_uris,omitempty" yaml:"redirect_uris,omitempty"` Tags []*string `json:"tags,omitempty" yaml:"tags,omitempty"` }
Oauth2Credential represents a Oauth2 credential in Kong. +k8s:deepcopy-gen=true
func (*Oauth2Credential) DeepCopy ¶ added in v0.8.0
func (in *Oauth2Credential) DeepCopy() *Oauth2Credential
DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Oauth2Credential.
func (*Oauth2Credential) DeepCopyInto ¶ added in v0.8.0
func (in *Oauth2Credential) DeepCopyInto(out *Oauth2Credential)
DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.
type Oauth2Service ¶ added in v0.8.0
type Oauth2Service service
Oauth2Service handles oauth2 credentials in Kong.
func (*Oauth2Service) Create ¶ added in v0.8.0
func (s *Oauth2Service) Create(ctx context.Context, consumerUsernameOrID *string, oauth2Cred *Oauth2Credential) (*Oauth2Credential, error)
Create creates an oauth2 credential in Kong If an ID is specified, it will be used to create a oauth2 credential in Kong, otherwise an ID is auto-generated.
func (*Oauth2Service) Delete ¶ added in v0.8.0
func (s *Oauth2Service) Delete(ctx context.Context, consumerUsernameOrID, clientIDorID *string) error
Delete deletes an oauth2 credential in Kong.
func (*Oauth2Service) Get ¶ added in v0.8.0
func (s *Oauth2Service) Get(ctx context.Context, consumerUsernameOrID, clientIDorID *string) (*Oauth2Credential, error)
Get fetches an oauth2 credential from Kong.
func (*Oauth2Service) List ¶ added in v0.8.0
func (s *Oauth2Service) List(ctx context.Context, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
List fetches a list of oauth2 credentials in Kong. opt can be used to control pagination.
func (*Oauth2Service) ListAll ¶ added in v0.8.0
func (s *Oauth2Service) ListAll( ctx context.Context) ([]*Oauth2Credential, error)
ListAll fetches all oauth2 credentials in Kong. This method can take a while if there a lot of oauth2 credentials present.
func (*Oauth2Service) ListForConsumer ¶ added in v0.8.0
func (s *Oauth2Service) ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
ListForConsumer fetches a list of oauth2 credentials in Kong associated with a specific consumer. opt can be used to control pagination.
func (*Oauth2Service) Update ¶ added in v0.8.0
func (s *Oauth2Service) Update(ctx context.Context, consumerUsernameOrID *string, oauth2Cred *Oauth2Credential) (*Oauth2Credential, error)
Update updates an oauth2 credential in Kong.
type PassiveHealthcheck ¶
type PassiveHealthcheck struct { Healthy *Healthy `json:"healthy,omitempty" yaml:"healthy,omitempty"` Type *string `json:"type,omitempty" yaml:"type,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"` Headers map[string][]string `json:"headers,omitempty" yaml:"headers,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"` PathHandling *string `json:"path_handling,omitempty" yaml:"path_handling,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"` HTTPSRedirectStatusCode *int `json:"https_redirect_status_code,omitempty" yaml:"https_redirect_status_code,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 { ClientCertificate *Certificate `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty"` 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"` TLSVerify *bool `json:"tls_verify,omitempty" yaml:"tls_verify,omitempty"` TLSVerifyDepth *int `json:"tls_verify_depth,omitempty" yaml:"tls_verify_depth,omitempty"` CACertificates []*string `json:"ca_certificates,omitempty" yaml:"ca_certificates,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"` Interval *int `json:"interval,omitempty" yaml:"interval,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"` HostHeader *string `json:"host_header,omitempty" yaml:"host_header,omitempty"` ClientCertificate *Certificate `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty"` Algorithm *string `json:"algorithm,omitempty" yaml:"algorithm,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.
type Workspace ¶ added in v0.12.0
type Workspace 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"` Comment *string `json:"comment,omitempty" yaml:"comment,omitempty"` Config map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"` Meta map[string]interface{} `json:"meta,omitempty" yaml:"meta,omitempty"` }
Workspace represents a Workspace in Kong.
type WorkspaceService ¶ added in v0.12.0
type WorkspaceService service
WorkspaceService handles Workspaces in Kong.
func (*WorkspaceService) Delete ¶ added in v0.12.0
func (s *WorkspaceService) Delete(ctx context.Context, WorkspaceOrID *string) error
Delete deletes a Workspace in Kong
Source Files ¶
- acl_service.go
- admin_service.go
- basic_auth_service.go
- bundled_custom_entities.go
- ca_certificate.go
- ca_certificate_service.go
- certificate_service.go
- consumer_service.go
- credentials.go
- credentials_service.go
- custom_entity_service.go
- doc.go
- error.go
- hmac_auth_service.go
- jwt_auth_service.go
- key_auth_service.go
- kong.go
- list.go
- mtls_auth_service.go
- oauth2_auth_service.go
- plugin_service.go
- request.go
- response.go
- route_service.go
- service_service.go
- sni_service.go
- target_service.go
- types.go
- upstream_service.go
- utils.go
- workspace_service.go
- zz_generated.deepcopy.go