kong

package
v0.17.0 Latest Latest
Warning

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

Go to latest
Published: Apr 5, 2021 License: Apache-2.0 Imports: 16 Imported by: 59

Documentation

Overview

Package kong provides Go bindings to Kong's RESTful Admin API.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to b.

func HTTPClientWithHeaders added in v0.13.0

func HTTPClientWithHeaders(client *http.Client,
	headers http.Header) http.Client

RoundTripperWithHTTPHeaders returns a client which injects headers before sending any request.

func Int

func Int(i int) *int

Int returns a pointer to i.

func IsNotFoundErr

func IsNotFoundErr(e error) bool

IsNotFoundErr returns true if the error or it's cause is a 404 response from Kong.

func String

func String(s string) *string

String returns pointer to s.

func StringSlice

func StringSlice(elements ...string) []*string

StringSlice converts a slice of string to a slice of *string

Types

type ACLGroup added in v0.13.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.13.0

func (in *ACLGroup) DeepCopy() *ACLGroup

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new ACLGroup.

func (*ACLGroup) DeepCopyInto added in v0.13.0

func (in *ACLGroup) DeepCopyInto(out *ACLGroup)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type ACLService added in v0.13.0

type ACLService service

ACLService handles consumer ACL groups in Kong.

func (*ACLService) Create added in v0.13.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.13.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.13.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.13.0

func (s *ACLService) List(ctx context.Context,
	opt *ListOpt) ([]*ACLGroup, *ListOpt, error)

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.13.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.13.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.

func (*ACLService) Update added in v0.13.0

func (s *ACLService) Update(ctx context.Context,
	consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)

Update updates an ACL group for a consumer in Kong

type APIError added in v0.14.0

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

APIError is used for Kong Admin API errors.

func NewAPIError added in v0.17.0

func NewAPIError(code int, msg string) *APIError

func (*APIError) Code added in v0.14.0

func (e *APIError) Code() int

Code returns the HTTP status code for the error.

func (*APIError) Error added in v0.14.0

func (e *APIError) Error() string

type AbstractACLService added in v0.17.0

type AbstractACLService interface {
	// Create adds a consumer to an ACL group in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)
	// Get fetches an ACL group for a consumer in Kong.
	Get(ctx context.Context, consumerUsernameOrID, groupOrID *string) (*ACLGroup, error)
	// Update updates an ACL group for a consumer in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, aclGroup *ACLGroup) (*ACLGroup, error)
	// Delete deletes an ACL group association for a consumer in Kong
	Delete(ctx context.Context, consumerUsernameOrID, groupOrID *string) error
	// List fetches a list of all ACL group and consumer associations in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*ACLGroup, *ListOpt, error)
	// ListAll fetches all all ACL group associations in Kong.
	ListAll(ctx context.Context) ([]*ACLGroup, error)
	// ListForConsumer fetches a list of ACL groups
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*ACLGroup, *ListOpt, error)
}

AbstractACLService handles consumer ACL groups in Kong.

type AbstractAdminService added in v0.17.0

type AbstractAdminService interface {
	// Invite creates an Admin in Kong.
	Invite(ctx context.Context, admin *Admin) (*Admin, error)
	// Create aliases the Invite function as it performs
	// essentially the same operation.
	Create(ctx context.Context, admin *Admin) (*Admin, error)
	// Get fetches a Admin in Kong.
	Get(ctx context.Context, nameOrID *string) (*Admin, error)
	// GenerateRegisterURL fetches an Admin in Kong
	// and returns a unique registration URL for the Admin
	GenerateRegisterURL(ctx context.Context, nameOrID *string) (*Admin, error)
	// Update updates an Admin in Kong.
	Update(ctx context.Context, admin *Admin) (*Admin, error)
	// Delete deletes an Admin in Kong
	Delete(ctx context.Context, AdminOrID *string) error
	// List fetches a list of all Admins in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Admin, *ListOpt, error)
	// RegisterCredentials registers credentials for existing Kong Admins
	RegisterCredentials(ctx context.Context, admin *Admin) error
	// ListWorkspaces lists the workspaces associated with an admin
	ListWorkspaces(ctx context.Context, emailOrID *string) ([]*Workspace, error)
	// ListRoles returns a slice of Kong RBAC roles associated with an Admin.
	ListRoles(ctx context.Context, emailOrID *string, opt *ListOpt) ([]*RBACRole, error)
	// UpdateRoles creates or updates roles associated with an Admin
	UpdateRoles(ctx context.Context, emailOrID *string, roles []*RBACRole) ([]*RBACRole, error)
	// DeleteRoles deletes roles associated with an Admin
	DeleteRoles(ctx context.Context, emailOrID *string, roles []*RBACRole) error
	// GetConsumer fetches the Consumer that gets generated for an Admin when
	// the Admin is created.
	GetConsumer(ctx context.Context, emailOrID *string) (*Consumer, error)
}

AbstractAdminService handles Admins in Kong.

type AbstractBasicAuthService added in v0.17.0

type AbstractBasicAuthService interface {
	// Create creates a basic-auth credential in Kong
	// is auto-generated.
	Create(ctx context.Context, consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)
	// Get fetches a basic-auth credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*BasicAuth, error)
	// Update updates a basic-auth credential in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)
	// Delete deletes a basic-auth credential in Kong
	Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
	// List fetches a list of basic-auth credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*BasicAuth, *ListOpt, error)
	// ListAll fetches all basic-auth credentials in Kong.
	ListAll(ctx context.Context) ([]*BasicAuth, error)
	// ListForConsumer fetches a list of basic-auth credentials
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*BasicAuth, *ListOpt, error)
}

AbstractBasicAuthService handles basic-auth credentials in Kong.

type AbstractCACertificateService added in v0.17.0

type AbstractCACertificateService interface {
	// Create creates a CACertificate in Kong.
	Create(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
	// Get fetches a CACertificate in Kong.
	Get(ctx context.Context, ID *string) (*CACertificate, error)
	// Update updates a CACertificate in Kong
	Update(ctx context.Context, certificate *CACertificate) (*CACertificate, error)
	// Delete deletes a CACertificate in Kong
	Delete(ctx context.Context, ID *string) error
	// List fetches a list of certificate in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*CACertificate, *ListOpt, error)
	// ListAll fetches all Certificates in Kong.
	ListAll(ctx context.Context) ([]*CACertificate, error)
}

AbstractCACertificateService handles Certificates in Kong.

type AbstractCertificateService added in v0.17.0

type AbstractCertificateService interface {
	// Create creates a Certificate in Kong.
	Create(ctx context.Context, certificate *Certificate) (*Certificate, error)
	// Get fetches a Certificate in Kong.
	Get(ctx context.Context, usernameOrID *string) (*Certificate, error)
	// Update updates a Certificate in Kong
	Update(ctx context.Context, certificate *Certificate) (*Certificate, error)
	// Delete deletes a Certificate in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// List fetches a list of certificate in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Certificate, *ListOpt, error)
	// ListAll fetches all Certificates in Kong.
	ListAll(ctx context.Context) ([]*Certificate, error)
}

AbstractCertificateService handles Certificates in Kong.

type AbstractConsumerService added in v0.17.0

type AbstractConsumerService interface {
	// Create creates a Consumer in Kong.
	Create(ctx context.Context, consumer *Consumer) (*Consumer, error)
	// Get fetches a Consumer in Kong.
	Get(ctx context.Context, usernameOrID *string) (*Consumer, error)
	// GetByCustomID fetches a Consumer in Kong.
	GetByCustomID(ctx context.Context, customID *string) (*Consumer, error)
	// Update updates a Consumer in Kong
	Update(ctx context.Context, consumer *Consumer) (*Consumer, error)
	// Delete deletes a Consumer in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// List fetches a list of Consumers in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Consumer, *ListOpt, error)
	// ListAll fetches all Consumers in Kong.
	ListAll(ctx context.Context) ([]*Consumer, error)
}

AbstractConsumerService handles Consumers in Kong.

type AbstractCustomEntityService added in v0.17.0

type AbstractCustomEntityService interface {
	// Get fetches a custom entity. The primary key and all relations of the
	// entity must be populated in entity.
	Get(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.
	Create(ctx context.Context, entity custom.Entity) (custom.Entity, error)
	// Update updates a custom entity in Kong.
	Update(ctx context.Context, entity custom.Entity) (custom.Entity, error)
	// Delete deletes a custom entity in Kong.
	Delete(ctx context.Context, entity custom.Entity) error
	// List fetches all custom entities based on relations
	List(ctx context.Context, opt *ListOpt, entity custom.Entity) ([]custom.Entity, *ListOpt, error)
	// ListAll fetches all custom entities based on relations
	ListAll(ctx context.Context, entity custom.Entity) ([]custom.Entity, error)
}

AbstractCustomEntityService handles custom entities in Kong.

type AbstractDeveloperRoleService added in v0.17.0

type AbstractDeveloperRoleService interface {
	// Create creates a Developer Role in Kong.
	Create(ctx context.Context, role *DeveloperRole) (*DeveloperRole, error)
	// Get fetches a Developer Role in Kong.
	Get(ctx context.Context, nameOrID *string) (*DeveloperRole, error)
	// Update updates a Developer Role in Kong.
	Update(ctx context.Context, role *DeveloperRole) (*DeveloperRole, error)
	// Delete deletes a Developer Role in Kong
	Delete(ctx context.Context, RoleOrID *string) error
	// List fetches a list of Developer Roles in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*DeveloperRole, *ListOpt, error)
	// List fetches a list of all Developer Roles in Kong.
	ListAll(ctx context.Context) ([]*DeveloperRole, error)
}

AbstractDeveloperRoleService handles Developer Roles in Kong.

type AbstractDeveloperService added in v0.17.0

type AbstractDeveloperService interface {
	// Create creates a Developer in Kong.
	Create(ctx context.Context, developer *Developer) (*Developer, error)
	// Get fetches a Developer in Kong.
	Get(ctx context.Context, emailOrID *string) (*Developer, error)
	// GetByCustomID fetches a Developer in Kong.
	GetByCustomID(ctx context.Context, customID *string) (*Developer, error)
	// Update updates a Developer in Kong
	Update(ctx context.Context, developer *Developer) (*Developer, error)
	// Delete deletes a Developer in Kong
	Delete(ctx context.Context, emailOrID *string) error
	// List fetches a list of Developers in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Developer, *ListOpt, error)
	// ListAll fetches all Developers in Kong.
	ListAll(ctx context.Context) ([]*Developer, error)
}

AbstractDeveloperService handles Developers in Kong.

type AbstractHMACAuthService added in v0.17.0

type AbstractHMACAuthService interface {
	// Create creates a hmac-auth credential in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)
	// Get fetches a hmac-auth credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, usernameOrID *string) (*HMACAuth, error)
	// Update updates a hmac-auth credential in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)
	// Delete deletes a hmac-auth credential in Kong
	Delete(ctx context.Context, consumerUsernameOrID, usernameOrID *string) error
	// List fetches a list of hmac-auth credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*HMACAuth, *ListOpt, error)
	// ListAll fetches all hmac-auth credentials in Kong.
	ListAll(ctx context.Context) ([]*HMACAuth, error)
	// ListForConsumer fetches a list of hmac-auth credentials
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*HMACAuth, *ListOpt, error)
}

AbstractHMACAuthService handles hmac-auth credentials in Kong.

type AbstractJWTAuthService added in v0.17.0

type AbstractJWTAuthService interface {
	// Create creates a JWT credential in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)
	// Get fetches a JWT credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*JWTAuth, error)
	// Update updates a JWT credential in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)
	// Delete deletes a JWT credential in Kong
	Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
	// List fetches a list of JWT credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*JWTAuth, *ListOpt, error)
	// ListAll fetches all JWT credentials in Kong.
	ListAll(ctx context.Context) ([]*JWTAuth, error)
	// ListForConsumer fetches a list of jwt credentials
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*JWTAuth, *ListOpt, error)
}

AbstractJWTAuthService handles JWT credentials in Kong.

type AbstractKeyAuthService added in v0.17.0

type AbstractKeyAuthService interface {
	// Create creates a key-auth credential in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)
	// Get fetches a key-auth credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*KeyAuth, error)
	// Update updates a key-auth credential in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)
	// Delete deletes a key-auth credential in Kong
	Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
	// List fetches a list of key-auth credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*KeyAuth, *ListOpt, error)
	// ListAll fetches all key-auth credentials in Kong.
	ListAll(ctx context.Context) ([]*KeyAuth, error)
	// ListForConsumer fetches a list of key-auth credentials
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*KeyAuth, *ListOpt, error)
}

AbstractKeyAuthService handles key-auth credentials in Kong.

type AbstractMTLSAuthService added in v0.17.0

type AbstractMTLSAuthService interface {
	// Create creates an MTLS credential in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)
	// Get fetches an MTLS credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, keyOrID *string) (*MTLSAuth, error)
	// Update updates an MTLS credential in Kong
	Update(ctx context.Context, consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)
	// Delete deletes an MTLS credential in Kong
	Delete(ctx context.Context, consumerUsernameOrID, keyOrID *string) error
	// List fetches a list of MTLS credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)
	// ListAll fetches all MTLS credentials in Kong.
	ListAll(ctx context.Context) ([]*MTLSAuth, error)
	// ListForConsumer fetches a list of mtls credentials
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)
}

AbstractMTLSAuthService handles MTLS credentials in Kong.

type AbstractOauth2Service added in v0.17.0

type AbstractOauth2Service interface {
	// Create creates an oauth2 credential in Kong
	Create(ctx context.Context, consumerUsernameOrID *string, oauth2Cred *Oauth2Credential) (*Oauth2Credential, error)
	// Get fetches an oauth2 credential from Kong.
	Get(ctx context.Context, consumerUsernameOrID, clientIDorID *string) (*Oauth2Credential, error)
	// Update updates an oauth2 credential in Kong.
	Update(ctx context.Context, consumerUsernameOrID *string, oauth2Cred *Oauth2Credential) (*Oauth2Credential, error)
	// Delete deletes an oauth2 credential in Kong.
	Delete(ctx context.Context, consumerUsernameOrID, clientIDorID *string) error
	// List fetches a list of oauth2 credentials in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
	// ListAll fetches all oauth2 credentials in Kong.
	ListAll(ctx context.Context) ([]*Oauth2Credential, error)
	// ListForConsumer fetches a list of oauth2 credentials
	// in Kong associated with a specific consumer.
	ListForConsumer(ctx context.Context, consumerUsernameOrID *string, opt *ListOpt) ([]*Oauth2Credential, *ListOpt, error)
}

AbstractOauth2Service handles oauth2 credentials in Kong.

type AbstractPluginService added in v0.17.0

type AbstractPluginService interface {
	// Create creates a Plugin in Kong.
	Create(ctx context.Context, plugin *Plugin) (*Plugin, error)
	// Get fetches a Plugin in Kong.
	Get(ctx context.Context, usernameOrID *string) (*Plugin, error)
	// Update updates a Plugin in Kong
	Update(ctx context.Context, plugin *Plugin) (*Plugin, error)
	// Delete deletes a Plugin in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// List fetches a list of Plugins in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Plugin, *ListOpt, error)
	// ListAll fetches all Plugins in Kong.
	ListAll(ctx context.Context) ([]*Plugin, error)
	// ListAllForConsumer fetches all Plugins in Kong enabled for a consumer.
	ListAllForConsumer(ctx context.Context, consumerIDorName *string) ([]*Plugin, error)
	// ListAllForService fetches all Plugins in Kong enabled for a service.
	ListAllForService(ctx context.Context, serviceIDorName *string) ([]*Plugin, error)
	// ListAllForRoute fetches all Plugins in Kong enabled for a service.
	ListAllForRoute(ctx context.Context, routeID *string) ([]*Plugin, error)
	// Validate validates a Plugin against its schema
	Validate(ctx context.Context, plugin *Plugin) (bool, error)
}

AbstractPluginService handles Plugins in Kong.

type AbstractRBACEndpointPermissionService added in v0.17.0

type AbstractRBACEndpointPermissionService interface {
	// Create creates a RBACEndpointPermission in Kong.
	Create(ctx context.Context, ep *RBACEndpointPermission) (*RBACEndpointPermission, error)
	// Get fetches a RBACEndpointPermission in Kong.
	Get(ctx context.Context, roleNameOrID *string, workspaceNameOrID *string,
		endpointName *string) (*RBACEndpointPermission, error)
	// Update updates a RBACEndpointPermission in Kong.
	Update(ctx context.Context, ep *RBACEndpointPermission) (*RBACEndpointPermission, error)
	// Delete deletes a EndpointPermission in Kong
	Delete(ctx context.Context, roleNameOrID *string, workspaceNameOrID *string, endpoint *string) error
	// ListAllForRole fetches a list of all RBACEndpointPermissions in Kong for a given role.
	ListAllForRole(ctx context.Context, roleNameOrID *string) ([]*RBACEndpointPermission, error)
}

AbstractRBACEndpointPermissionService handles RBACEndpointPermissions in Kong.

type AbstractRBACEntityPermissionService added in v0.17.0

type AbstractRBACEntityPermissionService interface {
	// Create creates an RBACEntityPermission in Kong.
	Create(ctx context.Context, ep *RBACEntityPermission) (*RBACEntityPermission, error)
	// Get fetches an EntityPermission in Kong.
	Get(ctx context.Context, roleNameOrID *string, entityName *string) (*RBACEntityPermission, error)
	// Update updates an EntityPermission in Kong.
	Update(ctx context.Context, ep *RBACEntityPermission) (*RBACEntityPermission, error)
	// Delete deletes an EntityPermission in Kong
	Delete(ctx context.Context, roleNameOrID *string, entityID *string) error
	// ListAllForRole fetches a list of all RBACEntityPermissions in Kong for a given role.
	ListAllForRole(ctx context.Context, roleNameOrID *string) ([]*RBACEntityPermission, error)
}

AbstractRBACEntityPermissionService handles RBACEntityPermissions in Kong.

type AbstractRBACRoleService added in v0.17.0

type AbstractRBACRoleService interface {
	// Create creates a Role in Kong.
	Create(ctx context.Context, role *RBACRole) (*RBACRole, error)
	// Get fetches a Role in Kong.
	Get(ctx context.Context, nameOrID *string) (*RBACRole, error)
	// Update updates a Role in Kong.
	Update(ctx context.Context, role *RBACRole) (*RBACRole, error)
	// Delete deletes a Role in Kong
	Delete(ctx context.Context, RoleOrID *string) error
	// List fetches a list of Roles in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*RBACRole, *ListOpt, error)
	// List fetches a list of all Roles in Kong.
	ListAll(ctx context.Context) ([]*RBACRole, error)
}

AbstractRBACRoleService handles Roles in Kong.

type AbstractRBACUserService added in v0.17.0

type AbstractRBACUserService interface {
	// Create creates an RBAC User in Kong.
	Create(ctx context.Context, user *RBACUser) (*RBACUser, error)
	// Get fetches a User in Kong.
	Get(ctx context.Context, nameOrID *string) (*RBACUser, error)
	// Update updates a User in Kong.
	Update(ctx context.Context, user *RBACUser) (*RBACUser, error)
	// Delete deletes a User in Kong
	Delete(ctx context.Context, userOrID *string) error
	// List fetches a list of Users in Kong.
	// opt can be used to control pagination.
	List(ctx context.Context, opt *ListOpt) ([]*RBACUser, *ListOpt, error)
	// ListAll fetches all users in Kong.
	ListAll(ctx context.Context) ([]*RBACUser, error)
	// AddRoles adds a comma separated list of roles to a User.
	AddRoles(ctx context.Context, nameOrID *string, roles []*RBACRole) ([]*RBACRole, error)
	// DeleteRoles deletes roles associated with a User
	DeleteRoles(ctx context.Context, nameOrID *string, roles []*RBACRole) error
	// ListRoles returns a slice of Kong RBAC roles associated with a User.
	ListRoles(ctx context.Context, nameOrID *string) ([]*RBACRole, error)
	// ListPermissions returns the entity and endpoint permissions associated with a user.
	ListPermissions(ctx context.Context, nameOrID *string) (*RBACPermissionsList, error)
}

AbstractRBACUserService handles Users in Kong.

type AbstractRouteService added in v0.17.0

type AbstractRouteService interface {
	// Create creates a Route in Kong
	Create(ctx context.Context, route *Route) (*Route, error)
	// CreateInService creates a route associated with serviceID
	CreateInService(ctx context.Context, serviceID *string, route *Route) (*Route, error)
	// Get fetches a Route in Kong.
	Get(ctx context.Context, nameOrID *string) (*Route, error)
	// Update updates a Route in Kong
	Update(ctx context.Context, route *Route) (*Route, error)
	// Delete deletes a Route in Kong
	Delete(ctx context.Context, nameOrID *string) error
	// List fetches a list of Routes in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Route, *ListOpt, error)
	// ListAll fetches all Routes in Kong.
	ListAll(ctx context.Context) ([]*Route, error)
	// ListForService fetches a list of Routes in Kong associated with a service.
	ListForService(ctx context.Context, serviceNameOrID *string, opt *ListOpt) ([]*Route, *ListOpt, error)
}

AbstractRouteService handles routes in Kong.

type AbstractSNIService added in v0.17.0

type AbstractSNIService interface {
	// Create creates a SNI in Kong.
	Create(ctx context.Context, sni *SNI) (*SNI, error)
	// Get fetches a SNI in Kong.
	Get(ctx context.Context, usernameOrID *string) (*SNI, error)
	// Update updates a SNI in Kong
	Update(ctx context.Context, sni *SNI) (*SNI, error)
	// Delete deletes a SNI in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// List fetches a list of SNIs in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*SNI, *ListOpt, error)
	// ListForCertificate fetches a list of SNIs
	ListForCertificate(ctx context.Context, certificateID *string, opt *ListOpt) ([]*SNI, *ListOpt, error)
	// ListAll fetches all SNIs in Kong.
	ListAll(ctx context.Context) ([]*SNI, error)
}

AbstractSNIService handles SNIs in Kong.

type AbstractSvcService added in v0.17.0

type AbstractSvcService interface {
	// Create creates an Service in Kong
	Create(ctx context.Context, service *Service) (*Service, error)
	// Get fetches an Service in Kong.
	Get(ctx context.Context, nameOrID *string) (*Service, error)
	// GetForRoute fetches a Service associated with routeID in Kong.
	GetForRoute(ctx context.Context, routeID *string) (*Service, error)
	// Update updates an Service in Kong
	Update(ctx context.Context, service *Service) (*Service, error)
	// Delete deletes an Service in Kong
	Delete(ctx context.Context, nameOrID *string) error
	// List fetches a list of Services in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Service, *ListOpt, error)
	// ListAll fetches all Services in Kong.
	ListAll(ctx context.Context) ([]*Service, error)
}

AbstractSvcService handles services in Kong.

type AbstractTargetService added in v0.17.0

type AbstractTargetService interface {
	// Create creates a Target in Kong under upstreamID.
	Create(ctx context.Context, upstreamNameOrID *string, target *Target) (*Target, error)
	// Delete deletes a Target in Kong
	Delete(ctx context.Context, upstreamNameOrID *string, targetOrID *string) error
	// List fetches a list of Targets in Kong.
	List(ctx context.Context, upstreamNameOrID *string, opt *ListOpt) ([]*Target, *ListOpt, error)
	// ListAll fetches all Targets in Kong for an upstream.
	ListAll(ctx context.Context, upstreamNameOrID *string) ([]*Target, error)
	// MarkHealthy marks target belonging to upstreamNameOrID as healthy in
	// Kong's load balancer.
	MarkHealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
	// MarkUnhealthy marks target belonging to upstreamNameOrID as unhealthy in
	// Kong's load balancer.
	MarkUnhealthy(ctx context.Context, upstreamNameOrID *string, target *Target) error
}

AbstractTargetService handles Targets in Kong.

type AbstractUpstreamNodeHealthService added in v0.17.0

type AbstractUpstreamNodeHealthService interface {
	// List fetches a list of Upstream Node Healths in Kong.
	List(ctx context.Context, upstreamNameOrID *string, opt *ListOpt) ([]*UpstreamNodeHealth, *ListOpt, error)
	// ListAll fetches all Upstream Node Healths in Kong.
	ListAll(ctx context.Context, upstreamNameOrID *string) ([]*UpstreamNodeHealth, error)
}

AbstractUpstreamNodeHealthService handles Upstream Node Healths in Kong.

type AbstractUpstreamService added in v0.17.0

type AbstractUpstreamService interface {
	// Create creates a Upstream in Kong.
	Create(ctx context.Context, upstream *Upstream) (*Upstream, error)
	// Get fetches a Upstream in Kong.
	Get(ctx context.Context, upstreamNameOrID *string) (*Upstream, error)
	// Update updates a Upstream in Kong
	Update(ctx context.Context, upstream *Upstream) (*Upstream, error)
	// Delete deletes a Upstream in Kong
	Delete(ctx context.Context, upstreamNameOrID *string) error
	// List fetches a list of Upstreams in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Upstream, *ListOpt, error)
	// ListAll fetches all Upstreams in Kong.
	ListAll(ctx context.Context) ([]*Upstream, error)
}

AbstractUpstreamService handles Upstreams in Kong.

type AbstractWorkspaceService added in v0.17.0

type AbstractWorkspaceService interface {
	// Create creates a Workspace in Kong.
	Create(ctx context.Context, workspace *Workspace) (*Workspace, error)
	// Get fetches a Workspace in Kong.
	Get(ctx context.Context, nameOrID *string) (*Workspace, error)
	// Update updates a Workspace in Kong.
	Update(ctx context.Context, workspace *Workspace) (*Workspace, error)
	// Delete deletes a Workspace in Kong
	Delete(ctx context.Context, WorkspaceOrID *string) error
	// List fetches a list of all Workspaces in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Workspace, *ListOpt, error)
	// ListAll fetches all workspaces in Kong.
	ListAll(ctx context.Context) ([]*Workspace, error)
	// AddEntities adds entity ids given as a a comma delimited string
	// to a given workspace in Kong. The response is a representation
	// of the entity that was added to the workspace.
	//
	// Deprecated: Kong 2.x removed this endpoint.
	AddEntities(ctx context.Context, workspaceNameOrID *string, entityIds *string) (*[]map[string]interface{}, error)
	// DeleteEntities deletes entity ids given as a a comma delimited string
	// to a given workspace in Kong.
	//
	// Deprecated: Kong 2.x removed this endpoint.
	DeleteEntities(ctx context.Context, workspaceNameOrID *string, entityIds *string) error
	// ListEntities fetches a list of all workspace entities in Kong.
	//
	// Deprecated: Kong 2.x removed this endpoint.
	ListEntities(ctx context.Context, workspaceNameOrID *string) ([]*WorkspaceEntity, error)
}

AbstractWorkspaceService handles Workspaces in Kong.

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.13.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. +k8s:deepcopy-gen=true

func (*Admin) DeepCopy added in v0.14.0

func (in *Admin) DeepCopy() *Admin

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Admin.

func (*Admin) DeepCopyInto added in v0.14.0

func (in *Admin) DeepCopyInto(out *Admin)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type AdminService added in v0.13.0

type AdminService service

AdminService handles Admins in Kong.

func (*AdminService) Create added in v0.13.0

func (s *AdminService) Create(ctx context.Context,
	admin *Admin) (*Admin, error)

Create aliases the Invite function as it performs essentially the same operation.

func (*AdminService) Delete added in v0.13.0

func (s *AdminService) Delete(ctx context.Context,
	AdminOrID *string) error

Delete deletes an Admin in Kong

func (*AdminService) DeleteRoles added in v0.14.0

func (s *AdminService) DeleteRoles(ctx context.Context,
	emailOrID *string, roles []*RBACRole) error

DeleteRoles deletes roles associated with an Admin

func (*AdminService) GenerateRegisterURL added in v0.13.0

func (s *AdminService) GenerateRegisterURL(ctx context.Context,
	nameOrID *string) (*Admin, error)

GenerateRegisterURL fetches an Admin in Kong and returns a unique registration URL for the Admin

func (*AdminService) Get added in v0.13.0

func (s *AdminService) Get(ctx context.Context,
	nameOrID *string) (*Admin, error)

Get fetches a Admin in Kong.

func (*AdminService) GetConsumer added in v0.14.0

func (s *AdminService) GetConsumer(ctx context.Context,
	emailOrID *string) (*Consumer, error)

GetConsumer fetches the Consumer that gets generated for an Admin when the Admin is created.

func (*AdminService) Invite added in v0.13.0

func (s *AdminService) Invite(ctx context.Context,
	admin *Admin) (*Admin, error)

Invite creates an Admin in Kong.

func (*AdminService) List added in v0.13.0

func (s *AdminService) List(ctx context.Context,
	opt *ListOpt) ([]*Admin, *ListOpt, error)

List fetches a list of all Admins in Kong.

func (*AdminService) ListRoles added in v0.14.0

func (s *AdminService) ListRoles(ctx context.Context,
	emailOrID *string, opt *ListOpt) ([]*RBACRole, error)

ListRoles returns a slice of Kong RBAC roles associated with an Admin.

func (*AdminService) ListWorkspaces added in v0.14.0

func (s *AdminService) ListWorkspaces(ctx context.Context,
	emailOrID *string) ([]*Workspace, error)

ListWorkspaces lists the workspaces associated with an admin

func (*AdminService) RegisterCredentials added in v0.13.0

func (s *AdminService) RegisterCredentials(ctx context.Context,
	admin *Admin) error

RegisterCredentials registers credentials for existing Kong Admins

func (*AdminService) Update added in v0.13.0

func (s *AdminService) Update(ctx context.Context,
	admin *Admin) (*Admin, error)

Update updates an Admin in Kong.

func (*AdminService) UpdateRoles added in v0.14.0

func (s *AdminService) UpdateRoles(ctx context.Context,
	emailOrID *string, roles []*RBACRole) ([]*RBACRole, error)

UpdateRoles creates or updates roles associated with an Admin

type BasicAuth added in v0.13.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.13.0

func (in *BasicAuth) DeepCopy() *BasicAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new BasicAuth.

func (*BasicAuth) DeepCopyInto added in v0.13.0

func (in *BasicAuth) DeepCopyInto(out *BasicAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type BasicAuthService added in v0.13.0

type BasicAuthService service

BasicAuthService handles basic-auth credentials in Kong.

func (*BasicAuthService) Create added in v0.13.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.13.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.13.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.13.0

func (s *BasicAuthService) List(ctx context.Context,
	opt *ListOpt) ([]*BasicAuth, *ListOpt, error)

List fetches a list of basic-auth credentials in Kong. opt can be used to control pagination.

func (*BasicAuthService) ListAll added in v0.13.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.13.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.

func (*BasicAuthService) Update added in v0.13.0

func (s *BasicAuthService) Update(ctx context.Context,
	consumerUsernameOrID *string, basicAuth *BasicAuth) (*BasicAuth, error)

Update updates a basic-auth credential in Kong

type CACertificate added in v0.13.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.13.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.13.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.13.0

type CACertificateService service

CACertificateService handles Certificates in Kong.

func (*CACertificateService) Create added in v0.13.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.13.0

func (s *CACertificateService) Delete(ctx context.Context,
	ID *string) error

Delete deletes a CACertificate in Kong

func (*CACertificateService) Get added in v0.13.0

Get fetches a CACertificate in Kong.

func (*CACertificateService) List added in v0.13.0

List fetches a list of certificate in Kong. opt can be used to control pagination.

func (*CACertificateService) ListAll added in v0.13.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.13.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

func (in *CIDRPort) DeepCopy() *CIDRPort

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new CIDRPort.

func (*CIDRPort) DeepCopyInto

func (in *CIDRPort) DeepCopyInto(out *CIDRPort)

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

Client talks to the Admin API or control plane of a Kong cluster

func NewClient

func NewClient(baseURL *string, client *http.Client) (*Client, error)

NewClient returns a Client which talks to Admin API of Kong

func (*Client) Do

func (c *Client) Do(ctx context.Context, req *http.Request,
	v interface{}) (*Response, error)

Do executes a HTTP request and returns a response

func (*Client) NewRequest added in v0.13.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) Root

func (c *Client) Root(ctx context.Context) (map[string]interface{}, error)

Root returns the response of GET request on root of Admin API (GET /).

func (*Client) SetDebugMode

func (c *Client) SetDebugMode(enableDebug bool)

SetDebugMode enables or disables logging of the request to the logger set by SetLogger(). By default, debug logging is disabled.

func (*Client) SetLogger

func (c *Client) SetLogger(w io.Writer)

SetLogger sets the debug logger, defaults to os.StdErr

func (*Client) Status

func (c *Client) Status(ctx context.Context) (*Status, error)

Status returns the status of a Kong node

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

func (in *Consumer) DeepCopy() *Consumer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Consumer.

func (*Consumer) DeepCopyInto

func (in *Consumer) DeepCopyInto(out *Consumer)

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

func (s *ConsumerService) Create(ctx context.Context,
	consumer *Consumer) (*Consumer, error)

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) Get

func (s *ConsumerService) Get(ctx context.Context,
	usernameOrID *string) (*Consumer, error)

Get fetches a Consumer in Kong.

func (*ConsumerService) GetByCustomID added in v0.13.0

func (s *ConsumerService) GetByCustomID(ctx context.Context,
	customID *string) (*Consumer, error)

GetByCustomID fetches a Consumer in Kong.

func (*ConsumerService) List

func (s *ConsumerService) List(ctx context.Context,
	opt *ListOpt) ([]*Consumer, *ListOpt, error)

List fetches a list of Consumers in Kong. opt can be used to control pagination.

func (*ConsumerService) ListAll

func (s *ConsumerService) ListAll(ctx context.Context) ([]*Consumer, error)

ListAll fetches all Consumers in Kong. This method can take a while if there a lot of Consumers present.

func (*ConsumerService) Update

func (s *ConsumerService) Update(ctx context.Context,
	consumer *Consumer) (*Consumer, error)

Update updates a Consumer in Kong

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) Delete

func (s *CustomEntityService) Delete(ctx context.Context,
	entity custom.Entity) error

Delete deletes a custom entity in Kong.

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

func (*CustomEntityService) ListAll

func (s *CustomEntityService) ListAll(ctx context.Context,
	entity custom.Entity) ([]custom.Entity, error)

ListAll fetches all custom entities based on relations

func (*CustomEntityService) Update

func (s *CustomEntityService) Update(ctx context.Context,
	entity custom.Entity) (custom.Entity, error)

Update updates a custom entity in Kong.

type Developer added in v0.17.0

type Developer struct {
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Status    *int      `json:"status,omitempty" yaml:"status,omitempty"`
	Email     *string   `json:"email,omitempty" yaml:"email,omitempty"`
	CustomID  *string   `json:"custom_id,omitempty" yaml:"custom_id,omitempty"`
	UpdatedAt *int      `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	Roles     []*string `json:"roles,omitempty" yaml:"roles,omitempty"`
	RbacUser  *RBACUser `json:"rbac_user,omitempty" yaml:"rbac_user,omitempty"`
	Meta      *string   `json:"meta,omitempty" yaml:"meta,omitempty"`
	Password  *string   `json:"password,omitempty" yaml:"password,omitempty"`
}

Developer represents a Developer in Kong. +k8s:deepcopy-gen=true

func (*Developer) DeepCopy added in v0.17.0

func (in *Developer) DeepCopy() *Developer

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Developer.

func (*Developer) DeepCopyInto added in v0.17.0

func (in *Developer) DeepCopyInto(out *Developer)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeveloperRole added in v0.17.0

type DeveloperRole struct {
	Comment   *string `json:"comment,omitempty" yaml:"comment,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"`
}

DeveloperRole represents a Developer Role in Kong. +k8s:deepcopy-gen=true

func (*DeveloperRole) DeepCopy added in v0.17.0

func (in *DeveloperRole) DeepCopy() *DeveloperRole

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new DeveloperRole.

func (*DeveloperRole) DeepCopyInto added in v0.17.0

func (in *DeveloperRole) DeepCopyInto(out *DeveloperRole)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type DeveloperRoleService added in v0.17.0

type DeveloperRoleService service

DeveloperRoleService handles Developer Roles in Kong.

func (*DeveloperRoleService) Create added in v0.17.0

Create creates a Developer Role in Kong.

func (*DeveloperRoleService) Delete added in v0.17.0

func (s *DeveloperRoleService) Delete(ctx context.Context,
	RoleOrID *string) error

Delete deletes a Developer Role in Kong

func (*DeveloperRoleService) Get added in v0.17.0

func (s *DeveloperRoleService) Get(ctx context.Context,
	nameOrID *string) (*DeveloperRole, error)

Get fetches a Developer Role in Kong.

func (*DeveloperRoleService) List added in v0.17.0

List fetches a list of all Developer Roles in Kong. opt can be used to control pagination.

func (*DeveloperRoleService) ListAll added in v0.17.0

func (s *DeveloperRoleService) ListAll(ctx context.Context) ([]*DeveloperRole, error)

ListAll fetches all Developer Roles in Kong. This method can take a while if there a lot of Developer Roles present.

func (*DeveloperRoleService) Update added in v0.17.0

Update updates a Developer Role in Kong.

type DeveloperService added in v0.17.0

type DeveloperService service

DeveloperService handles Developers in Kong.

func (*DeveloperService) Create added in v0.17.0

func (s *DeveloperService) Create(ctx context.Context,
	developer *Developer) (*Developer, error)

Create creates a Developer in Kong. If an ID is specified, it will be used to create a developer in Kong, otherwise an ID is auto-generated. This call does _not_ use a PUT when provided an ID. Although /developers accepts PUTs, PUTs do not accept passwords and do not create the hidden consumer that backs the developer. Subsequent attempts to use such developers result in fatal errors.

func (*DeveloperService) Delete added in v0.17.0

func (s *DeveloperService) Delete(ctx context.Context,
	emailOrID *string) error

Delete deletes a Developer in Kong

func (*DeveloperService) Get added in v0.17.0

func (s *DeveloperService) Get(ctx context.Context,
	emailOrID *string) (*Developer, error)

Get fetches a Developer in Kong.

func (*DeveloperService) GetByCustomID added in v0.17.0

func (s *DeveloperService) GetByCustomID(ctx context.Context,
	customID *string) (*Developer, error)

GetByCustomID fetches a Developer in Kong.

func (*DeveloperService) List added in v0.17.0

func (s *DeveloperService) List(ctx context.Context,
	opt *ListOpt) ([]*Developer, *ListOpt, error)

List fetches a list of Developers in Kong. opt can be used to control pagination.

func (*DeveloperService) ListAll added in v0.17.0

func (s *DeveloperService) ListAll(ctx context.Context) ([]*Developer, error)

ListAll fetches all Developers in Kong. This method can take a while if there a lot of Developers present.

func (*DeveloperService) Update added in v0.17.0

func (s *DeveloperService) Update(ctx context.Context,
	developer *Developer) (*Developer, error)

Update updates a Developer in Kong

type HMACAuth added in v0.13.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.13.0

func (in *HMACAuth) DeepCopy() *HMACAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HMACAuth.

func (*HMACAuth) DeepCopyInto added in v0.13.0

func (in *HMACAuth) DeepCopyInto(out *HMACAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HMACAuthService added in v0.13.0

type HMACAuthService service

HMACAuthService handles hmac-auth credentials in Kong.

func (*HMACAuthService) Create added in v0.13.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.13.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.13.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.13.0

func (s *HMACAuthService) List(ctx context.Context,
	opt *ListOpt) ([]*HMACAuth, *ListOpt, error)

List fetches a list of hmac-auth credentials in Kong. opt can be used to control pagination.

func (*HMACAuthService) ListAll added in v0.13.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.13.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.

func (*HMACAuthService) Update added in v0.13.0

func (s *HMACAuthService) Update(ctx context.Context,
	consumerUsernameOrID *string, hmacAuth *HMACAuth) (*HMACAuth, error)

Update updates a hmac-auth credential in Kong

type HealthData added in v0.16.0

type HealthData struct {
	Host       *string              `json:"host,omitempty" yaml:"host,omitempty"`
	Port       *int                 `json:"port,omitempty" yaml:"port,omitempty"`
	NodeWeight *int                 `json:"nodeWeight,omitempty" yaml:"nodeWeight,omitempty"`
	Weight     *HealthDataWeight    `json:"weight,omitempty" yaml:"weight,omitempty"`
	Addresses  []*HealthDataAddress `json:"addresses,omitempty" yaml:"addresses,omitempty"`
	DNS        *string              `json:"dns,omitempty" yaml:"dns,omitempty"`
}

HealthData represents the health data of a target +k8s:deepcopy-gen=true

func (*HealthData) DeepCopy added in v0.16.0

func (in *HealthData) DeepCopy() *HealthData

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthData.

func (*HealthData) DeepCopyInto added in v0.16.0

func (in *HealthData) DeepCopyInto(out *HealthData)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HealthDataAddress added in v0.16.0

type HealthDataAddress struct {
	Port   *int    `json:"port,omitempty" yaml:"port,omitempty"`
	IP     *string `json:"ip,omitempty" yaml:"ip,omitempty"`
	Health *string `json:"health,omitempty" yaml:"data,omitempty"`
	Weight *int    `json:"weight,omitempty" yaml:"weight,omitempty"`
}

HealthDataAddress represents the health data address of a target +k8s:deepcopy-gen=true

func (*HealthDataAddress) DeepCopy added in v0.16.0

func (in *HealthDataAddress) DeepCopy() *HealthDataAddress

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthDataAddress.

func (*HealthDataAddress) DeepCopyInto added in v0.16.0

func (in *HealthDataAddress) DeepCopyInto(out *HealthDataAddress)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type HealthDataWeight added in v0.16.0

type HealthDataWeight struct {
	Total       *int `json:"total,omitempty" yaml:"total,omitempty"`
	Available   *int `json:"available,omitempty" yaml:"available,omitempty"`
	Unavailable *int `json:"unavailable,omitempty" yaml:"unavailable,omitempty"`
}

HealthDataWeight represents the health data weight of a target +k8s:deepcopy-gen=true

func (*HealthDataWeight) DeepCopy added in v0.16.0

func (in *HealthDataWeight) DeepCopy() *HealthDataWeight

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new HealthDataWeight.

func (*HealthDataWeight) DeepCopyInto added in v0.16.0

func (in *HealthDataWeight) DeepCopyInto(out *HealthDataWeight)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

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

func (in *Healthy) DeepCopy() *Healthy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Healthy.

func (*Healthy) DeepCopyInto

func (in *Healthy) DeepCopyInto(out *Healthy)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JWTAuth added in v0.13.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.13.0

func (in *JWTAuth) DeepCopy() *JWTAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new JWTAuth.

func (*JWTAuth) DeepCopyInto added in v0.13.0

func (in *JWTAuth) DeepCopyInto(out *JWTAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type JWTAuthService added in v0.13.0

type JWTAuthService service

JWTAuthService handles JWT credentials in Kong.

func (*JWTAuthService) Create added in v0.13.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.13.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.13.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.13.0

func (s *JWTAuthService) List(ctx context.Context,
	opt *ListOpt) ([]*JWTAuth, *ListOpt, error)

List fetches a list of JWT credentials in Kong. opt can be used to control pagination.

func (*JWTAuthService) ListAll added in v0.13.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.13.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.

func (*JWTAuthService) Update added in v0.13.0

func (s *JWTAuthService) Update(ctx context.Context,
	consumerUsernameOrID *string, jwtAuth *JWTAuth) (*JWTAuth, error)

Update updates a JWT credential in Kong

type KeyAuth added in v0.13.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"`
	TTL       *int      `json:"ttl,omitempty" yaml:"ttl,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.13.0

func (in *KeyAuth) DeepCopy() *KeyAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new KeyAuth.

func (*KeyAuth) DeepCopyInto added in v0.13.0

func (in *KeyAuth) DeepCopyInto(out *KeyAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type KeyAuthService added in v0.13.0

type KeyAuthService service

KeyAuthService handles key-auth credentials in Kong.

func (*KeyAuthService) Create added in v0.13.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.13.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.13.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.13.0

func (s *KeyAuthService) List(ctx context.Context,
	opt *ListOpt) ([]*KeyAuth, *ListOpt, error)

List fetches a list of key-auth credentials in Kong. opt can be used to control pagination.

func (*KeyAuthService) ListAll added in v0.13.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.13.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.

func (*KeyAuthService) Update added in v0.13.0

func (s *KeyAuthService) Update(ctx context.Context,
	consumerUsernameOrID *string, keyAuth *KeyAuth) (*KeyAuth, error)

Update updates a key-auth credential in Kong

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.13.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.13.0

func (in *MTLSAuth) DeepCopy() *MTLSAuth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new MTLSAuth.

func (*MTLSAuth) DeepCopyInto added in v0.13.0

func (in *MTLSAuth) DeepCopyInto(out *MTLSAuth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type MTLSAuthService added in v0.13.0

type MTLSAuthService service

MTLSAuthService handles MTLS credentials in Kong.

func (*MTLSAuthService) Create added in v0.13.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.13.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.13.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.13.0

func (s *MTLSAuthService) List(ctx context.Context,
	opt *ListOpt) ([]*MTLSAuth, *ListOpt, error)

List fetches a list of MTLS credentials in Kong. opt can be used to control pagination.

func (*MTLSAuthService) ListAll added in v0.13.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.13.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.

func (*MTLSAuthService) Update added in v0.13.0

func (s *MTLSAuthService) Update(ctx context.Context,
	consumerUsernameOrID *string, mtlsAuth *MTLSAuth) (*MTLSAuth, error)

Update updates an MTLS credential in Kong

type Oauth2Credential added in v0.13.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.13.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.13.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.13.0

type Oauth2Service service

Oauth2Service handles oauth2 credentials in Kong.

func (*Oauth2Service) Create added in v0.13.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.13.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.13.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.13.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.13.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.13.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.13.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

func (in *Plugin) DeepCopy() *Plugin

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Plugin.

func (*Plugin) DeepCopyInto

func (in *Plugin) DeepCopyInto(out *Plugin)

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

func (s *PluginService) Create(ctx context.Context,
	plugin *Plugin) (*Plugin, error)

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) Get

func (s *PluginService) Get(ctx context.Context,
	usernameOrID *string) (*Plugin, error)

Get fetches a Plugin in Kong.

func (*PluginService) List

func (s *PluginService) List(ctx context.Context,
	opt *ListOpt) ([]*Plugin, *ListOpt, error)

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

func (s *PluginService) ListAllForRoute(ctx context.Context,
	routeID *string) ([]*Plugin, error)

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.

func (*PluginService) Update

func (s *PluginService) Update(ctx context.Context,
	plugin *Plugin) (*Plugin, error)

Update updates a Plugin in Kong

func (*PluginService) Validate added in v0.17.0

func (s *PluginService) Validate(ctx context.Context, plugin *Plugin) (bool, error)

Validate validates a Plugin against its schema

type RBACEndpointPermission added in v0.14.0

type RBACEndpointPermission struct {
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Workspace *string   `json:"workspace,omitempty" yaml:"workspace,omitempty"`
	Endpoint  *string   `json:"endpoint,omitempty" yaml:"endpoint,omitempty"`
	Actions   []*string `json:"actions,omitempty" yaml:"actions,omitempty"`
	Negative  *bool     `json:"negative,omitempty" yaml:"negative,omitempty"`
	Role      *RBACRole `json:"role,omitempty" yaml:"role,omitempty"`
	Comment   *string   `json:"comment,omitempty" yaml:"comment,omitempty"`
}

RBACEndpointPermission represents an RBAC Endpoint Permission in Kong Enterprise +k8s:deepcopy-gen=true Note: this type implements a custom JSON marshaler. Review the associated MarshalJSON() function if it does not marshal as expected.

func (*RBACEndpointPermission) DeepCopy added in v0.14.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RBACEndpointPermission.

func (*RBACEndpointPermission) DeepCopyInto added in v0.14.0

func (in *RBACEndpointPermission) DeepCopyInto(out *RBACEndpointPermission)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RBACEndpointPermission) MarshalJSON added in v0.14.0

func (e *RBACEndpointPermission) MarshalJSON() ([]byte, error)

MarshalJSON marshals an endpoint permission into a suitable form for the Kong admin API

type RBACEndpointPermissionService added in v0.14.0

type RBACEndpointPermissionService service

RBACEndpointPermissionService handles RBACEndpointPermissions in Kong.

func (*RBACEndpointPermissionService) Create added in v0.14.0

Create creates a RBACEndpointPermission in Kong.

func (*RBACEndpointPermissionService) Delete added in v0.14.0

func (s *RBACEndpointPermissionService) Delete(ctx context.Context,
	roleNameOrID *string, workspaceNameOrID *string, endpoint *string) error

Delete deletes a EndpointPermission in Kong

func (*RBACEndpointPermissionService) Get added in v0.14.0

func (s *RBACEndpointPermissionService) Get(ctx context.Context,
	roleNameOrID *string, workspaceNameOrID *string, endpointName *string) (*RBACEndpointPermission, error)

Get fetches a RBACEndpointPermission in Kong.

func (*RBACEndpointPermissionService) ListAllForRole added in v0.14.0

func (s *RBACEndpointPermissionService) ListAllForRole(ctx context.Context,
	roleNameOrID *string) ([]*RBACEndpointPermission, error)

ListAllForRole fetches a list of all RBACEndpointPermissions in Kong for a given role.

func (*RBACEndpointPermissionService) Update added in v0.14.0

Update updates a RBACEndpointPermission in Kong.

type RBACEntityPermission added in v0.14.0

type RBACEntityPermission struct {
	CreatedAt  *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	EntityID   *string   `json:"entity_id,omitempty" yaml:"entity_id,omitempty"`
	EntityType *string   `json:"entity_type,omitempty" yaml:"entity_type,omitempty"`
	Actions    []*string `json:"actions,omitempty" yaml:"actions,omitempty"`
	Negative   *bool     `json:"negative,omitempty" yaml:"negative,omitempty"`
	Role       *RBACRole `json:"role,omitempty" yaml:"role,omitempty"`
	Comment    *string   `json:"comment,omitempty" yaml:"comment,omitempty"`
}

RBACEntityPermission represents an RBAC Entity Permission in Kong Enterprise +k8s:deepcopy-gen=true Note: this type implements a custom JSON marshaler. Review the associated MarshalJSON() function if it does not marshal as expected.

func (*RBACEntityPermission) DeepCopy added in v0.14.0

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RBACEntityPermission.

func (*RBACEntityPermission) DeepCopyInto added in v0.14.0

func (in *RBACEntityPermission) DeepCopyInto(out *RBACEntityPermission)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

func (*RBACEntityPermission) MarshalJSON added in v0.14.0

func (e *RBACEntityPermission) MarshalJSON() ([]byte, error)

MarshalJSON marshals an endpoint permission into a suitable form for the Kong admin API

type RBACEntityPermissionService added in v0.14.0

type RBACEntityPermissionService service

RBACEntityPermissionService handles RBACEntityPermissions in Kong.

func (*RBACEntityPermissionService) Create added in v0.14.0

Create creates an RBACEntityPermission in Kong.

func (*RBACEntityPermissionService) Delete added in v0.14.0

func (s *RBACEntityPermissionService) Delete(ctx context.Context,
	roleNameOrID *string, entityID *string) error

Delete deletes an EntityPermission in Kong

func (*RBACEntityPermissionService) Get added in v0.14.0

func (s *RBACEntityPermissionService) Get(ctx context.Context,
	roleNameOrID *string, entityName *string) (*RBACEntityPermission, error)

Get fetches an EntityPermission in Kong.

func (*RBACEntityPermissionService) ListAllForRole added in v0.14.0

func (s *RBACEntityPermissionService) ListAllForRole(ctx context.Context,
	roleNameOrID *string) ([]*RBACEntityPermission, error)

ListAllForRole fetches a list of all RBACEntityPermissions in Kong for a given role.

func (*RBACEntityPermissionService) Update added in v0.14.0

Update updates an EntityPermission in Kong.

type RBACPermissionsList added in v0.14.0

type RBACPermissionsList struct {
	Endpoints map[string]interface{} `json:"endpoints,omitempty" yaml:"endpoints,omitempty"`
	Entities  map[string]interface{} `json:"entities,omitempty" yaml:"entities,omitempty"`
}

PermissionsList is a list of permissions, both endpoint and entity, associated with a Role.

type RBACRole added in v0.14.0

type RBACRole 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"`
	IsDefault *bool   `json:"is_default,omitempty" yaml:"is_default,omitempty"`
}

RBACRole represents an RBAC Role in Kong. +k8s:deepcopy-gen=true

func (*RBACRole) DeepCopy added in v0.14.0

func (in *RBACRole) DeepCopy() *RBACRole

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RBACRole.

func (*RBACRole) DeepCopyInto added in v0.14.0

func (in *RBACRole) DeepCopyInto(out *RBACRole)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RBACRoleService added in v0.14.0

type RBACRoleService service

RBACRoleService handles Roles in Kong.

func (*RBACRoleService) Create added in v0.14.0

func (s *RBACRoleService) Create(ctx context.Context,
	role *RBACRole) (*RBACRole, error)

Create creates a Role in Kong.

func (*RBACRoleService) Delete added in v0.14.0

func (s *RBACRoleService) Delete(ctx context.Context,
	RoleOrID *string) error

Delete deletes a Role in Kong

func (*RBACRoleService) Get added in v0.14.0

func (s *RBACRoleService) Get(ctx context.Context,
	nameOrID *string) (*RBACRole, error)

Get fetches a Role in Kong.

func (*RBACRoleService) List added in v0.14.0

func (s *RBACRoleService) List(ctx context.Context,
	opt *ListOpt) ([]*RBACRole, *ListOpt, error)

List fetches a list of all Roles in Kong.

func (*RBACRoleService) ListAll added in v0.17.0

func (s *RBACRoleService) ListAll(ctx context.Context) ([]*RBACRole, error)

ListAll fetches all Roles in Kong. This method can take a while if there a lot of Roles present.

func (*RBACRoleService) Update added in v0.14.0

func (s *RBACRoleService) Update(ctx context.Context,
	role *RBACRole) (*RBACRole, error)

Update updates a Role in Kong.

type RBACUser added in v0.14.0

type RBACUser struct {
	CreatedAt      *int    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Comment        *string `json:"comment,omitempty" yaml:"comment,omitempty"`
	ID             *string `json:"id,omitempty" yaml:"id,omitempty"`
	Name           *string `json:"name,omitempty" yaml:"name,omitempty"`
	Enabled        *bool   `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	UserToken      *string `json:"user_token,omitempty" yaml:"user_token,omitempty"`
	UserTokenIdent *string `json:"user_token_ident,omitempty" yaml:"user_token_ident,omitempty"`
}

RBACUser represents an RBAC user in Kong Enterprise +k8s:deepcopy-gen=true

func (*RBACUser) DeepCopy added in v0.14.0

func (in *RBACUser) DeepCopy() *RBACUser

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new RBACUser.

func (*RBACUser) DeepCopyInto added in v0.14.0

func (in *RBACUser) DeepCopyInto(out *RBACUser)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type RBACUserService added in v0.14.0

type RBACUserService service

RBACUserService handles Users in Kong.

func (*RBACUserService) AddRoles added in v0.14.0

func (s *RBACUserService) AddRoles(ctx context.Context,
	nameOrID *string, roles []*RBACRole) ([]*RBACRole, error)

AddRoles adds a comma separated list of roles to a User.

func (*RBACUserService) Create added in v0.14.0

func (s *RBACUserService) Create(ctx context.Context,
	user *RBACUser) (*RBACUser, error)

Create creates an RBAC User in Kong.

func (*RBACUserService) Delete added in v0.14.0

func (s *RBACUserService) Delete(ctx context.Context,
	userOrID *string) error

Delete deletes a User in Kong

func (*RBACUserService) DeleteRoles added in v0.14.0

func (s *RBACUserService) DeleteRoles(ctx context.Context,
	nameOrID *string, roles []*RBACRole) error

DeleteRoles deletes roles associated with a User

func (*RBACUserService) Get added in v0.14.0

func (s *RBACUserService) Get(ctx context.Context,
	nameOrID *string) (*RBACUser, error)

Get fetches a User in Kong.

func (*RBACUserService) List added in v0.14.0

func (s *RBACUserService) List(ctx context.Context,
	opt *ListOpt) ([]*RBACUser, *ListOpt, error)

List fetches a list of Users in Kong. opt can be used to control pagination.

func (*RBACUserService) ListAll added in v0.14.0

func (s *RBACUserService) ListAll(ctx context.Context) ([]*RBACUser, error)

ListAll fetches all users in Kong.

func (*RBACUserService) ListPermissions added in v0.14.0

func (s *RBACUserService) ListPermissions(ctx context.Context,
	nameOrID *string) (*RBACPermissionsList, error)

ListPermissions returns the entity and endpoint permissions associated with a user.

func (*RBACUserService) ListRoles added in v0.14.0

func (s *RBACUserService) ListRoles(ctx context.Context,
	nameOrID *string) ([]*RBACRole, error)

ListRoles returns a slice of Kong RBAC roles associated with a User.

func (*RBACUserService) Update added in v0.14.0

func (s *RBACUserService) Update(ctx context.Context,
	user *RBACUser) (*RBACUser, error)

Update updates a User in Kong.

type Response

type Response struct {
	*http.Response
}

Response is a Kong Admin API response. It wraps http.Response.

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"`

	// Kong buffers requests and responses by default. Buffering is not always
	// desired, for instance if large payloads are being proxied using HTTP 1.1
	// chunked encoding.
	//
	// The request and response route buffering options are enabled by default
	// and allow the user to disable buffering if desired for their use case.
	//
	// SEE ALSO:
	// - https://github.com/Kong/kong/pull/6057
	// - https://docs.konghq.com/2.2.x/admin-api/#route-object
	//
	RequestBuffering  *bool `json:"request_buffering,omitempty" yaml:"request_buffering,omitempty"`
	ResponseBuffering *bool `json:"response_buffering,omitempty" yaml:"response_buffering,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

func (in *Route) DeepCopy() *Route

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Route.

func (*Route) DeepCopyInto

func (in *Route) DeepCopyInto(out *Route)

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

func (s *RouteService) Create(ctx context.Context,
	route *Route) (*Route, error)

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) Get

func (s *RouteService) Get(ctx context.Context,
	nameOrID *string) (*Route, error)

Get fetches a Route in Kong.

func (*RouteService) List

func (s *RouteService) List(ctx context.Context,
	opt *ListOpt) ([]*Route, *ListOpt, error)

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.

func (*RouteService) Update

func (s *RouteService) Update(ctx context.Context,
	route *Route) (*Route, error)

Update updates a Route in Kong

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

func (in *SNI) DeepCopy() *SNI

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new SNI.

func (*SNI) DeepCopyInto

func (in *SNI) DeepCopyInto(out *SNI)

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

func (s *SNIService) Create(ctx context.Context, sni *SNI) (*SNI, error)

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) Get

func (s *SNIService) Get(ctx context.Context,
	usernameOrID *string) (*SNI, error)

Get fetches a SNI in Kong.

func (*SNIService) List

func (s *SNIService) List(ctx context.Context,
	opt *ListOpt) ([]*SNI, *ListOpt, error)

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.

func (*SNIService) Update

func (s *SNIService) Update(ctx context.Context, sni *SNI) (*SNI, error)

Update updates a SNI in Kong

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"`
	URL               *string      `json:"url,omitempty" yaml:"url,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

func (in *Service) DeepCopy() *Service

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Service.

func (*Service) DeepCopyInto

func (in *Service) DeepCopyInto(out *Service)

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

func (s *Svcservice) Create(ctx context.Context,
	service *Service) (*Service, error)

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) Get

func (s *Svcservice) Get(ctx context.Context,
	nameOrID *string) (*Service, error)

Get fetches an Service in Kong.

func (*Svcservice) GetForRoute

func (s *Svcservice) GetForRoute(ctx context.Context,
	routeID *string) (*Service, error)

GetForRoute fetches a Service associated with routeID in Kong.

func (*Svcservice) List

func (s *Svcservice) List(ctx context.Context,
	opt *ListOpt) ([]*Service, *ListOpt, error)

List fetches a list of Services in Kong. opt can be used to control pagination.

func (*Svcservice) ListAll

func (s *Svcservice) ListAll(ctx context.Context) ([]*Service, error)

ListAll fetches all Services in Kong. This method can take a while if there a lot of Services present.

func (*Svcservice) Update

func (s *Svcservice) Update(ctx context.Context,
	service *Service) (*Service, error)

Update updates an Service in Kong

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

func (in *Target) DeepCopy() *Target

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Target.

func (*Target) DeepCopyInto

func (in *Target) DeepCopyInto(out *Target)

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) ListAll

func (s *TargetService) ListAll(ctx context.Context,
	upstreamNameOrID *string) ([]*Target, error)

ListAll fetches all Targets in Kong for an upstream.

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

func (in *Unhealthy) DeepCopy() *Unhealthy

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Unhealthy.

func (*Unhealthy) DeepCopyInto

func (in *Unhealthy) DeepCopyInto(out *Unhealthy)

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 an Upstream in Kong. +k8s:deepcopy-gen=true

func (*Upstream) DeepCopy

func (in *Upstream) DeepCopy() *Upstream

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new Upstream.

func (*Upstream) DeepCopyInto

func (in *Upstream) DeepCopyInto(out *Upstream)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpstreamNodeHealth added in v0.16.0

type UpstreamNodeHealth struct {
	ID        *string     `json:"id,omitempty" yaml:"id,omitempty"`
	CreatedAt *float64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Data      *HealthData `json:"data,omitempty" yaml:"data,omitempty"`
	Health    *string     `json:"health,omitempty" yaml:"data,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"`
}

UpstreamNodeHealth represents the node health of a upstream +k8s:deepcopy-gen=true

func (*UpstreamNodeHealth) DeepCopy added in v0.16.0

func (in *UpstreamNodeHealth) DeepCopy() *UpstreamNodeHealth

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new UpstreamNodeHealth.

func (*UpstreamNodeHealth) DeepCopyInto added in v0.16.0

func (in *UpstreamNodeHealth) DeepCopyInto(out *UpstreamNodeHealth)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type UpstreamNodeHealthService added in v0.16.0

type UpstreamNodeHealthService service

UpstreamNodeHealthService handles Upstream Node Healths in Kong.

func (*UpstreamNodeHealthService) List added in v0.16.0

func (s *UpstreamNodeHealthService) List(
	ctx context.Context,
	upstreamNameOrID *string,
	opt *ListOpt,
) ([]*UpstreamNodeHealth, *ListOpt, error)

List fetches a list of Upstream Node Healths in Kong. opt can be used to control pagination.

func (*UpstreamNodeHealthService) ListAll added in v0.16.0

func (s *UpstreamNodeHealthService) ListAll(
	ctx context.Context,
	upstreamNameOrID *string,
) ([]*UpstreamNodeHealth, error)

ListAll fetches all Upstream Node Healths in Kong. This method can take a while if there are a lot of Upstream Node Healths present.

type UpstreamService

type UpstreamService service

UpstreamService handles Upstreams in Kong.

func (*UpstreamService) Create

func (s *UpstreamService) Create(ctx context.Context,
	upstream *Upstream) (*Upstream, error)

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) Get

func (s *UpstreamService) Get(ctx context.Context,
	upstreamNameOrID *string) (*Upstream, error)

Get fetches a Upstream in Kong.

func (*UpstreamService) List

func (s *UpstreamService) List(ctx context.Context,
	opt *ListOpt) ([]*Upstream, *ListOpt, error)

List fetches a list of Upstreams in Kong. opt can be used to control pagination.

func (*UpstreamService) ListAll

func (s *UpstreamService) ListAll(ctx context.Context) ([]*Upstream, error)

ListAll fetches all Upstreams in Kong. This method can take a while if there a lot of Upstreams present.

func (*UpstreamService) Update

func (s *UpstreamService) Update(ctx context.Context,
	upstream *Upstream) (*Upstream, error)

Update updates a Upstream in Kong

type Workspace added in v0.13.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 WorkspaceEntity added in v0.14.0

type WorkspaceEntity struct {
	EntityID         *string `json:"entity_id,omitempty" yaml:"entity_id,omitempty"`
	EntityType       *string `json:"entity_type,omitempty" yaml:"entity_type,omitempty"`
	UniqueFieldName  *string `json:"unique_field_name,omitempty" yaml:"unique_field_name,omitempty"`
	UniqueFieldValue *string `json:"unique_field_value,omitempty" yaml:"unique_field_value,omitempty"`
	WorkspaceID      *string `json:"workspace_id,omitempty" yaml:"workspace_id,omitempty"`
	WorkspaceName    *string `json:"workspace_name,omitempty" yaml:"workspace_name,omitempty"`
}

Workspace Entity represents a WorkspaceEntity in Kong +k8s:deepcopy-gen=true

func (*WorkspaceEntity) DeepCopy added in v0.14.0

func (in *WorkspaceEntity) DeepCopy() *WorkspaceEntity

DeepCopy is an autogenerated deepcopy function, copying the receiver, creating a new WorkspaceEntity.

func (*WorkspaceEntity) DeepCopyInto added in v0.14.0

func (in *WorkspaceEntity) DeepCopyInto(out *WorkspaceEntity)

DeepCopyInto is an autogenerated deepcopy function, copying the receiver, writing into out. in must be non-nil.

type WorkspaceService added in v0.13.0

type WorkspaceService service

WorkspaceService handles Workspaces in Kong.

func (*WorkspaceService) AddEntities deprecated added in v0.14.0

func (s *WorkspaceService) AddEntities(ctx context.Context,
	workspaceNameOrID *string, entityIds *string) (*[]map[string]interface{}, error)

AddEntities adds entity ids given as a a comma delimited string to a given workspace in Kong. The response is a representation of the entity that was added to the workspace.

Deprecated: Kong 2.x removed this endpoint.

func (*WorkspaceService) Create added in v0.13.0

func (s *WorkspaceService) Create(ctx context.Context,
	workspace *Workspace) (*Workspace, error)

Create creates a Workspace in Kong.

func (*WorkspaceService) Delete added in v0.13.0

func (s *WorkspaceService) Delete(ctx context.Context,
	WorkspaceOrID *string) error

Delete deletes a Workspace in Kong

func (*WorkspaceService) DeleteEntities deprecated added in v0.14.0

func (s *WorkspaceService) DeleteEntities(ctx context.Context,
	workspaceNameOrID *string, entityIds *string) error

DeleteEntities deletes entity ids given as a a comma delimited string to a given workspace in Kong.

Deprecated: Kong 2.x removed this endpoint.

func (*WorkspaceService) Get added in v0.13.0

func (s *WorkspaceService) Get(ctx context.Context,
	nameOrID *string) (*Workspace, error)

Get fetches a Workspace in Kong.

func (*WorkspaceService) List added in v0.13.0

func (s *WorkspaceService) List(ctx context.Context,
	opt *ListOpt) ([]*Workspace, *ListOpt, error)

List fetches a list of all Workspaces in Kong.

func (*WorkspaceService) ListAll added in v0.13.0

func (s *WorkspaceService) ListAll(ctx context.Context) ([]*Workspace, error)

ListAll fetches all workspaces in Kong.

func (*WorkspaceService) ListEntities deprecated added in v0.14.0

func (s *WorkspaceService) ListEntities(ctx context.Context,
	workspaceNameOrID *string) ([]*WorkspaceEntity, error)

ListEntities fetches a list of all workspace entities in Kong.

Deprecated: Kong 2.x removed this endpoint.

func (*WorkspaceService) Update added in v0.13.0

func (s *WorkspaceService) Update(ctx context.Context,
	workspace *Workspace) (*Workspace, error)

Update updates a Workspace in Kong. Only updates to the `comment` field are supported. To rename a workspace use Create.

Directories

Path Synopsis
Package custom defines interfaces to interact with custom entities in Kong.
Package custom defines interfaces to interact with custom entities in Kong.

Jump to

Keyboard shortcuts

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