kong

package
v0.0.3 Latest Latest
Warning

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

Go to latest
Published: May 26, 2023 License: Apache-2.0 Imports: 25 Imported by: 0

Documentation

Overview

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

Index

Constants

View Source
const (

	// DefaultTimeout is the timeout used for network connections and requests
	// including TCP, TLS and HTTP layers.
	DefaultTimeout = 60 * time.Second
)

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to b.

func ErrorOrResponseError

func ErrorOrResponseError(res *Response, err error) error

ErrorOrResponseError helps to handle the case where there might not be a "hard" (connection) error but the response itself represents an error.

func FillEntityDefaults

func FillEntityDefaults(entity interface{}, schema Schema) error

FillEntityDefaults ingests entities' defaults from their schema.

func FillPluginsDefaults

func FillPluginsDefaults(plugin *Plugin, schema Schema) error

FillPluginsDefaults ingests plugin's defaults from its schema. Takes in a plugin struct and mutate it in place.

func Float64

func Float64(f float64) *float64

Float64 returns a pointer to f.

func HTTPClientWithHeaders

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

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

func Int

func Int(i int) *int

Int returns a pointer to i.

func IsForbiddenErr

func IsForbiddenErr(e error) bool

IsForbiddenErr returns true if the error or its cause is a 403 response from Kong.

func IsNotFoundErr

func IsNotFoundErr(e error) bool

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

func RunWhenDBMode

func RunWhenDBMode(t *testing.T, dbmode string)

func RunWhenEnterprise

func RunWhenEnterprise(t *testing.T, versionRange string, required RequiredFeatures)

RunWhenEnterprise skips a test if the version of Kong running is not enterprise edition. Skips the current test if the version of Kong doesn't fall within the version range. If a test requires RBAC and RBAC is not enabled on Kong the test will be skipped

func RunWhenKong

func RunWhenKong(t *testing.T, versionRange string)

RunWhenKong skips the current test if the version of Kong doesn't fall in the versionRange. This helper function can be used in tests to write version specific tests for Kong.

func SkipWhenEnterprise

func SkipWhenEnterprise(t *testing.T)

SkipWhenEnterprise skips a test if the Kong version is an Enterprise version

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

func VersionFromInfo

func VersionFromInfo(info map[string]interface{}) string

VersionFromInfo retrieves the version from the response of root or /kong endpoints

Types

type ACLGroup

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

func (in *ACLGroup) DeepCopy() *ACLGroup

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

func (*ACLGroup) DeepCopyInto

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

type ACLService service

ACLService handles consumer ACL groups in Kong.

func (*ACLService) Create

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

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

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

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

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

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

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

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

APIError is used for Kong Admin API errors.

func NewAPIError

func NewAPIError(code int, msg string) *APIError

func NewAPIErrorWithRaw

func NewAPIErrorWithRaw(code int, msg string, raw []byte) *APIError

func (*APIError) Code

func (e *APIError) Code() int

Code returns the HTTP status code for the error.

func (*APIError) Details

func (e *APIError) Details() any

Details returns optional details that might be relevant for proper handling of the APIError on the caller side.

func (*APIError) Error

func (e *APIError) Error() string

func (*APIError) Raw

func (e *APIError) Raw() []byte

Raw returns the raw HTTP error response body.

func (*APIError) SetDetails

func (e *APIError) SetDetails(details any)

SetDetails allows setting optional details that might be relevant for proper handling of the APIError on the caller side.

type AbstractACLService

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

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

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

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

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 AbstractConsumerGroupConsumerService

type AbstractConsumerGroupConsumerService interface {
	// Create creates a ConsumerGroupConsumer in Kong.
	Create(ctx context.Context, consumerGroupNameOrID *string, consumerNameOrID *string) (*ConsumerGroupObject, error)
	// Delete deletes a ConsumerGroupConsumer in Kong
	Delete(ctx context.Context, consumerGroupNameOrID *string, consumerNameOrID *string) error
	// ListAll fetches all ConsumerGroup's Consumers in Kong.
	ListAll(ctx context.Context, consumerGroupNameOrID *string) (*ConsumerGroupObject, error)
}

AbstractConsumerGroupConsumerService handles ConsumerGroups' Consumers in Kong.

type AbstractConsumerGroupService

type AbstractConsumerGroupService interface {
	// Create creates a ConsumerGroup in Kong.
	Create(ctx context.Context, consumerGroup *ConsumerGroup) (*ConsumerGroup, error)
	// Get fetches a ConsumerGroup from Kong.
	Get(ctx context.Context, nameOrID *string) (*ConsumerGroupObject, error)
	// Update updates a ConsumerGroup in Kong
	Update(ctx context.Context, consumerGroup *ConsumerGroup) (*ConsumerGroup, error)
	// Delete deletes a ConsumerGroup in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// List fetches a list of ConsumerGroups in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*ConsumerGroup, *ListOpt, error)
	// ListAll fetches all ConsumerGroups in Kong.
	ListAll(ctx context.Context) ([]*ConsumerGroup, error)

	// UpdateRateLimitingAdvancedPlugin upsert a RLA plugin for ConsumerGroups in Kong.
	UpdateRateLimitingAdvancedPlugin(
		ctx context.Context, nameOrID *string, config map[string]Configuration,
	) (*ConsumerGroupRLA, error)
}

AbstractConsumerGroupService handles ConsumerGroups in Kong.

type AbstractConsumerService

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

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 AbstractDegraphqlRouteService

type AbstractDegraphqlRouteService interface {
	// Creates a DeGraphQL route in kong.
	Create(ctx context.Context, route *DegraphqlRoute) (*DegraphqlRoute, error)
	// Fetches a DeGraphQL route from kong.
	Get(ctx context.Context, serviceNameOrID *string, ID *string) (*DegraphqlRoute, error)
	// Updates a DeGraphQL route in kong.
	Update(ctx context.Context, route *DegraphqlRoute) (*DegraphqlRoute, error)
	// Deletes a DeGraphQL route in kong.
	Delete(ctx context.Context, serviceNameOrID *string, id *string) error
	// Retrieves a page of DeGraphQL routes in kong.
	List(ctx context.Context, serviceNameOrID *string, listopt *ListOpt) ([]*DegraphqlRoute, *ListOpt, error)
	// Retrieves all DeGraphQL routes in kong.
	ListAll(ctx context.Context, serviceNameOrID *string) ([]*DegraphqlRoute, error)
}

type AbstractDeveloperRoleService

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

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 AbstractGraphqlRateLimitingCostDecorationService

type AbstractGraphqlRateLimitingCostDecorationService interface {
	// Creates a cost decoration for the GraphQL rate-limiting plugin in Kong.
	Create(ctx context.Context, costDeco *GraphqlRateLimitingCostDecoration) (*GraphqlRateLimitingCostDecoration, error)
	// Fetches a cost decoration for the GraphQL rate-limiting plugin from Kong.
	Get(ctx context.Context, ID *string) (*GraphqlRateLimitingCostDecoration, error)
	// UPdates a cost decoration for the GraphQL rate-limiting plugin in Kong.
	Update(ctx context.Context, costDeco *GraphqlRateLimitingCostDecoration) (*GraphqlRateLimitingCostDecoration, error)
	// Deletes a cost decoration for the GraphQL rate-limiting plugin in Kong.
	Delete(ctx context.Context, ID *string) error
	// Retrieves a page of cost decorations for the GraphQL rate-limiting plugin in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*GraphqlRateLimitingCostDecoration, *ListOpt, error)
	// Retrieves all decorations for the GraphQL rate-limiting plugin in Kong.
	ListAll(ctx context.Context) ([]*GraphqlRateLimitingCostDecoration, error)
}

type AbstractHMACAuthService

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 AbstractInfoService

type AbstractInfoService interface {
	// Get retrieves the general runtime information about the Kong gateway.
	Get(ctx context.Context) (*Info, error)
}

AbstractInfoService handles Kong's Information.

type AbstractJWTAuthService

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

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 AbstractKeyService

type AbstractKeyService interface {
	// Create creates a Key in Kong.
	Create(ctx context.Context, key *Key) (*Key, error)
	// Get fetches a Key in Kong.
	Get(ctx context.Context, nameOrID *string) (*Key, error)
	// Update updates a Key in Kong
	Update(ctx context.Context, key *Key) (*Key, error)
	// Delete deletes a Key in Kong
	Delete(ctx context.Context, nameOrID *string) error
	// List fetches a list of Keys in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Key, *ListOpt, error)
	// ListAll fetches all Keys in Kong.
	ListAll(ctx context.Context) ([]*Key, error)
}

type AbstractKeySetService

type AbstractKeySetService interface {
	// Create creates a Key in Kong.
	Create(ctx context.Context, keySet *KeySet) (*KeySet, error)
	// Get fetches a Key in Kong.
	Get(ctx context.Context, nameOrID *string) (*KeySet, error)
	// Update updates a Key in Kong
	Update(ctx context.Context, keySet *KeySet) (*KeySet, error)
	// Delete deletes a Key in Kong
	Delete(ctx context.Context, nameOrID *string) error
	// List fetches a list of Keys in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*KeySet, *ListOpt, error)
	// ListAll fetches all Keys in Kong.
	ListAll(ctx context.Context) ([]*KeySet, error)
}

type AbstractLicenseService

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

AbstractLicenseService handles Licenses in Kong.

type AbstractMTLSAuthService

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

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

type AbstractPluginService interface {
	// Create creates a Plugin in Kong.
	Create(ctx context.Context, plugin *Plugin) (*Plugin, error)
	// CreateForService creates a Plugin in Kong.
	CreateForService(ctx context.Context, serviceIDorName *string, plugin *Plugin) (*Plugin, error)
	// CreateForRoute creates a Plugin in Kong.
	CreateForRoute(ctx context.Context, routeIDorName *string, 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)
	// UpdateForService updates a Plugin in Kong for a service
	UpdateForService(ctx context.Context, serviceIDorName *string, plugin *Plugin) (*Plugin, error)
	// UpdateForRoute updates a Plugin in Kong for a service
	UpdateForRoute(ctx context.Context, routeIDorName *string, plugin *Plugin) (*Plugin, error)
	// Delete deletes a Plugin in Kong
	Delete(ctx context.Context, usernameOrID *string) error
	// DeleteForService deletes a Plugin in Kong
	DeleteForService(ctx context.Context, serviceIDorName *string, pluginID *string) error
	// DeleteForRoute deletes a Plugin in Kong
	DeleteForRoute(ctx context.Context, routeIDorName *string, pluginID *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, string, error)
	// GetSchema retrieves the config schema of a plugin.
	//
	// Deprecated: Use GetFullSchema instead.
	GetSchema(ctx context.Context, pluginName *string) (Schema, error)
	// GetFullSchema retrieves the full schema of a plugin.
	// This makes the use of `/schemas` endpoint in Kong.
	GetFullSchema(ctx context.Context, pluginName *string) (Schema, error)
}

AbstractPluginService handles Plugins in Kong.

type AbstractRBACEndpointPermissionService

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

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

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

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

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

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 AbstractSchemaService

type AbstractSchemaService interface {
	// Get fetches an entity schema from Kong.
	Get(ctx context.Context, entity string) (Schema, error)
}

AbstractSchemaService handles schemas in Kong.

type AbstractSvcService

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 AbstractTagService

type AbstractTagService interface {
	// Exists checks if the tags exists
	Exists(ctx context.Context) (bool, error)
}

AbstractTagService handles Tags in Kong.

type AbstractTargetService

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

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

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 AbstractVaultService

type AbstractVaultService interface {
	// Create creates a Vault in Kong
	Create(ctx context.Context, vault *Vault) (*Vault, error)
	// Get fetches a Vault in Kong.
	Get(ctx context.Context, nameOrID *string) (*Vault, error)
	// Update updates a Vault in Kong
	Update(ctx context.Context, vault *Vault) (*Vault, error)
	// Delete deletes a Vault in Kong
	Delete(ctx context.Context, nameOrID *string) error
	// List fetches a list of Vaults in Kong.
	List(ctx context.Context, opt *ListOpt) ([]*Vault, *ListOpt, error)
	// ListAll fetches all Vaults in Kong.
	ListAll(ctx context.Context) ([]*Vault, error)
}

AbstractVaultService handles Vaults in Kong.

type AbstractWorkspaceService

type AbstractWorkspaceService interface {
	// Exists checks the exitence of a Workspace in Kong.
	Exists(ctx context.Context, nameOrID *string) (bool, error)
	// ExistsByName checks the exitence of a Workspace using name only in Kong.
	ExistsByName(ctx context.Context, name *string) (bool, error)
	// 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 {
	// +kubebuilder:validation:Minimum=1
	Concurrency *int     `json:"concurrency,omitempty" yaml:"concurrency,omitempty"`
	Healthy     *Healthy `json:"healthy,omitempty" yaml:"healthy,omitempty"`
	// +kubebuilder:validation:Pattern=^/.*$
	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"`
	// +kubebuilder:validation:Minimum=0
	Timeout   *int                `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Unhealthy *Unhealthy          `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
	Headers   map[string][]string `json:"headers,omitempty" yaml:"headers,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

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

func (in *Admin) DeepCopy() *Admin

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

func (*Admin) DeepCopyInto

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

type AdminService service

AdminService handles Admins in Kong.

func (*AdminService) Create

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

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

Delete deletes an Admin in Kong

func (*AdminService) DeleteRoles

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

DeleteRoles deletes roles associated with an Admin

func (*AdminService) GenerateRegisterURL

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

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

Get fetches a Admin in Kong.

func (*AdminService) GetConsumer

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

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

Invite creates an Admin in Kong.

func (*AdminService) List

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

List fetches a list of all Admins in Kong.

func (*AdminService) ListRoles

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

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

func (*AdminService) ListWorkspaces

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

ListWorkspaces lists the workspaces associated with an admin

func (*AdminService) RegisterCredentials

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

RegisterCredentials registers credentials for existing Kong Admins

func (*AdminService) Update

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

Update updates an Admin in Kong.

func (*AdminService) UpdateRoles

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

UpdateRoles creates or updates roles associated with an Admin

type BasicAuth

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

func (in *BasicAuth) DeepCopy() *BasicAuth

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

func (*BasicAuth) DeepCopyInto

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

type BasicAuthService service

BasicAuthService handles basic-auth credentials in Kong.

func (*BasicAuthService) Create

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

func (s *BasicAuthService) Delete(ctx context.Context,
	consumerUsernameOrID, usernameOrID *string,
) error

Delete deletes a basic-auth credential in Kong

func (*BasicAuthService) Get

func (s *BasicAuthService) Get(ctx context.Context,
	consumerUsernameOrID, usernameOrID *string,
) (*BasicAuth, error)

Get fetches a basic-auth credential from Kong.

func (*BasicAuthService) List

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

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

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

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

Update updates a basic-auth credential in Kong

type CACertificate

type CACertificate struct {
	ID         *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Cert       *string   `json:"cert,omitempty" yaml:"cert,omitempty"`
	CertDigest *string   `json:"cert_digest,omitempty" yaml:"cert_digest,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

func (in *CACertificate) DeepCopy() *CACertificate

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

func (*CACertificate) DeepCopyInto

func (in *CACertificate) DeepCopyInto(out *CACertificate)

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

func (*CACertificate) FriendlyName

func (c *CACertificate) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type CACertificateService

type CACertificateService service

CACertificateService handles Certificates in Kong.

func (*CACertificateService) Create

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

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

Delete deletes a CACertificate in Kong

func (*CACertificateService) Get

Get fetches a CACertificate in Kong.

func (*CACertificateService) List

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

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

func (*CACertificateService) ListAll

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

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"`
	CertAlt   *string   `json:"cert_alt,omitempty" yaml:"cert_alt,omitempty"`
	Key       *string   `json:"key,omitempty" yaml:"key,omitempty"`
	KeyAlt    *string   `json:"key_alt,omitempty" yaml:"key_alt,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://docs.konghq.com/gateway/latest/admin-api/#certificate-object +k8s:deepcopy-gen=true

func (*Certificate) DeepCopy

func (in *Certificate) DeepCopy() *Certificate

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

func (*Certificate) DeepCopyInto

func (in *Certificate) DeepCopyInto(out *Certificate)

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

func (*Certificate) FriendlyName

func (c *Certificate) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

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 NewTestClient

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

func (*Client) BaseRootURL

func (c *Client) BaseRootURL() string

func (*Client) Do

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

Do executes an HTTP request and returns a kong.Response

func (*Client) DoRAW

func (c *Client) DoRAW(ctx context.Context, req *http.Request) (*http.Response, error)

DoRAW executes an HTTP request and returns an http.Response the caller is responsible for closing the response body.

func (*Client) Listeners

func (c *Client) Listeners(ctx context.Context) ([]ProxyListener, []StreamListener, error)

Listeners returns the proxy_listeners and stream_listeners that are currently configured in the Kong root as convenient native types rather than JSON or unstructured.

func (*Client) NewRequest

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

func (c *Client) NewRequestRaw(method, baseURL string, endpoint string, qs interface{},
	body interface{},
) (*http.Request, error)

NewRequestRaw creates a request based on the inputs.

func (*Client) ReloadDeclarativeRawConfig

func (c *Client) ReloadDeclarativeRawConfig(
	ctx context.Context,
	config io.Reader,
	checkHash bool,
	flattenErrors bool,
) ([]byte, error)

ReloadDeclarativeRawConfig sends out the specified config to configured Admin API endpoint using the provided reader which should contain the JSON serialized body that adheres to the configuration format specified at: https://docs.konghq.com/gateway/latest/production/deployment-topologies/db-less-and-declarative-config/#declarative-configuration-format It returns the response body and an error, if it encounters any.

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 / or /kong with a workspace).

func (*Client) RootJSON

func (c *Client) RootJSON(ctx context.Context) ([]byte, error)

RootJSON returns the response of GET request on the root of the Admin API (GET / or /kong with a workspace) returning the raw JSON response data.

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

func (c *Client) SetWorkspace(workspace string)

SetWorkspace sets the Kong Enteprise workspace in the client. Calling this function with an empty string resets the workspace to default workspace.

func (*Client) Status

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

Status returns the status of a Kong node

func (*Client) Workspace

func (c *Client) Workspace() string

Workspace return the workspace

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://docs.konghq.com/gateway/latest/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.

func (*Consumer) FillID

func (c *Consumer) FillID() error

FillID fills the ID of an entity. It is a no-op if the entity already has an ID. ID is generated in a deterministic way using UUIDv5. The UUIDv5 namespace is different for each entity type. The name used to generate the ID for Consumer is Consumer.Username.

func (*Consumer) FriendlyName

func (c *Consumer) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type ConsumerGroup

type ConsumerGroup 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"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

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

func (*ConsumerGroup) DeepCopy

func (in *ConsumerGroup) DeepCopy() *ConsumerGroup

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

func (*ConsumerGroup) DeepCopyInto

func (in *ConsumerGroup) DeepCopyInto(out *ConsumerGroup)

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

func (*ConsumerGroup) FriendlyName

func (s *ConsumerGroup) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type ConsumerGroupConsumer

type ConsumerGroupConsumer struct {
	Consumer      *Consumer      `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	ConsumerGroup *ConsumerGroup `json:"consumer_group,omitempty" yaml:"consumer_group,omitempty"`
	CreatedAt     *int64         `json:"created_at,omitempty" yaml:"created_at,omitempty"`
}

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

func (*ConsumerGroupConsumer) DeepCopy

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

func (*ConsumerGroupConsumer) DeepCopyInto

func (in *ConsumerGroupConsumer) DeepCopyInto(out *ConsumerGroupConsumer)

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

type ConsumerGroupConsumerService

type ConsumerGroupConsumerService service

ConsumerGroupService handles ConsumerGroup in Kong.

func (*ConsumerGroupConsumerService) Create

func (s *ConsumerGroupConsumerService) Create(ctx context.Context,
	consumerGroupNameOrID *string, consumerNameOrID *string,
) (*ConsumerGroupObject, error)

Create creates a ConsumerGroupConsumer in Kong. If an ID is specified, it will be used to create a consumer for a consumer group in Kong, otherwise an ID is auto-generated.

func (*ConsumerGroupConsumerService) Delete

func (s *ConsumerGroupConsumerService) Delete(ctx context.Context,
	consumerGroupNameOrID *string, consumerNameOrID *string,
) error

Delete deletes a ConsumerGroupConsumer in Kong

func (*ConsumerGroupConsumerService) ListAll

func (s *ConsumerGroupConsumerService) ListAll(
	ctx context.Context, consumerGroupNameOrID *string,
) (*ConsumerGroupObject, error)

List fetches a list all of ConsumerGroup's consumers in Kong.

type ConsumerGroupObject

type ConsumerGroupObject struct {
	ConsumerGroup *ConsumerGroup         `json:"consumer_group,omitempty" yaml:"consumer_group,omitempty"`
	Consumers     []*Consumer            `json:"consumers,omitempty" yaml:"consumers,omitempty"`
	Plugins       []*ConsumerGroupPlugin `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

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

func (*ConsumerGroupObject) DeepCopy

func (in *ConsumerGroupObject) DeepCopy() *ConsumerGroupObject

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

func (*ConsumerGroupObject) DeepCopyInto

func (in *ConsumerGroupObject) DeepCopyInto(out *ConsumerGroupObject)

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

type ConsumerGroupPlugin

type ConsumerGroupPlugin 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"`
	Config        Configuration  `json:"config,omitempty" yaml:"config,omitempty"`
	ConsumerGroup *ConsumerGroup `json:"consumer_group,omitempty" yaml:"consumer_group,omitempty"`
}

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

func (*ConsumerGroupPlugin) DeepCopy

func (in *ConsumerGroupPlugin) DeepCopy() *ConsumerGroupPlugin

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

func (*ConsumerGroupPlugin) DeepCopyInto

func (in *ConsumerGroupPlugin) DeepCopyInto(out *ConsumerGroupPlugin)

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

type ConsumerGroupRLA

type ConsumerGroupRLA struct {
	ConsumerGroup *string       `json:"consumer_group,omitempty" yaml:"consumer_group,omitempty"`
	Config        Configuration `json:"config,omitempty" yaml:"config,omitempty"`
	Plugin        *string       `json:"plugin,omitempty" yaml:"plugin,omitempty"`
}

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

func (*ConsumerGroupRLA) DeepCopy

func (in *ConsumerGroupRLA) DeepCopy() *ConsumerGroupRLA

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

func (*ConsumerGroupRLA) DeepCopyInto

func (in *ConsumerGroupRLA) DeepCopyInto(out *ConsumerGroupRLA)

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

type ConsumerGroupService

type ConsumerGroupService service

ConsumerGroupService handles ConsumerGroup in Kong.

func (*ConsumerGroupService) Create

func (s *ConsumerGroupService) Create(ctx context.Context,
	consumerGroup *ConsumerGroup,
) (*ConsumerGroup, error)

Create creates a ConsumerGroup in Kong. If an ID is specified, it will be used to create a consumer group in Kong, otherwise an ID is auto-generated.

func (*ConsumerGroupService) Delete

func (s *ConsumerGroupService) Delete(ctx context.Context,
	usernameOrID *string,
) error

Delete deletes a ConsumerGroup in Kong

func (*ConsumerGroupService) Get

func (s *ConsumerGroupService) Get(ctx context.Context,
	nameOrID *string,
) (*ConsumerGroupObject, error)

Get fetches a ConsumerGroup from Kong.

func (*ConsumerGroupService) List

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

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

func (*ConsumerGroupService) ListAll

func (s *ConsumerGroupService) ListAll(ctx context.Context) ([]*ConsumerGroup, error)

ListAll fetches all ConsumerGroup in Kong.

func (*ConsumerGroupService) Update

func (s *ConsumerGroupService) Update(ctx context.Context,
	consumerGroup *ConsumerGroup,
) (*ConsumerGroup, error)

Update updates a ConsumerGroup in Kong

func (*ConsumerGroupService) UpdateRateLimitingAdvancedPlugin

func (s *ConsumerGroupService) UpdateRateLimitingAdvancedPlugin(
	ctx context.Context, nameOrID *string, config map[string]Configuration,
) (*ConsumerGroupRLA, error)

UpdateRateLimitingAdvancedPlugin upsert a RLA plugin for ConsumerGroups in Kong.

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

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 DegraphqlRoute

type DegraphqlRoute struct {
	ID      *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Service *Service  `json:"service,omitempty" yaml:"service,omitempty"`
	Methods []*string `json:"methods,omitempty" yaml:"methods,omitempty"`
	URI     *string   `json:"uri,omitempty" yaml:"uri,omitempty"`
	Query   *string   `json:"query,omitempty" yaml:"query,omitempty"`
}

DegraphqlRoute represents a route from an exposed URI to a specific GraphQL query on the given Service. +k8s:deepcopy-gen=true

func (*DegraphqlRoute) DeepCopy

func (in *DegraphqlRoute) DeepCopy() *DegraphqlRoute

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

func (*DegraphqlRoute) DeepCopyInto

func (in *DegraphqlRoute) DeepCopyInto(out *DegraphqlRoute)

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

type DegraphqlRouteService

type DegraphqlRouteService service

func (*DegraphqlRouteService) Create

Create creates a DeGraphQL route in Kong. Note the Service must be specified.

func (*DegraphqlRouteService) Delete

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

Delete removes an existing DeGraphQL route from Kong given a Service and Route ID.

func (*DegraphqlRouteService) Get

func (s *DegraphqlRouteService) Get(
	ctx context.Context,
	serviceNameOrID *string,
	ID *string,
) (*DegraphqlRoute, error)

Get returns an existing DeGraphQL route from Kong, given a Service and Route ID.

func (*DegraphqlRouteService) List

func (s *DegraphqlRouteService) List(
	ctx context.Context,
	serviceNameOrID *string,
	opt *ListOpt,
) ([]*DegraphqlRoute, *ListOpt, error)

List returns a page of DeGraphQL routes from Kong, all associated to the specified Service.

func (*DegraphqlRouteService) ListAll

func (s *DegraphqlRouteService) ListAll(
	ctx context.Context,
	serviceNameOrID *string,
) ([]*DegraphqlRoute, error)

ListAll fetches all DeGraphQL routes associated with the given Service present in Kong. This method can take a while to pull all pages of content if there are many items present

func (*DegraphqlRouteService) Update

Update modifies an existing Degraphql route in Kong. Note that the Service must be specified.

type Developer

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

func (in *Developer) DeepCopy() *Developer

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

func (*Developer) DeepCopyInto

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

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

func (in *DeveloperRole) DeepCopy() *DeveloperRole

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

func (*DeveloperRole) DeepCopyInto

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

type DeveloperRoleService service

DeveloperRoleService handles Developer Roles in Kong.

func (*DeveloperRoleService) Create

Create creates a Developer Role in Kong.

func (*DeveloperRoleService) Delete

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

Delete deletes a Developer Role in Kong

func (*DeveloperRoleService) Get

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

Get fetches a Developer Role in Kong.

func (*DeveloperRoleService) List

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

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

func (*DeveloperRoleService) ListAll

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

Update updates a Developer Role in Kong.

type DeveloperService

type DeveloperService service

DeveloperService handles Developers in Kong.

func (*DeveloperService) Create

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

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

Delete deletes a Developer in Kong

func (*DeveloperService) Get

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

Get fetches a Developer in Kong.

func (*DeveloperService) GetByCustomID

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

GetByCustomID fetches a Developer in Kong.

func (*DeveloperService) List

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

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

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

Update updates a Developer in Kong

type ErrTooManyRequestsDetails

type ErrTooManyRequestsDetails struct {
	RetryAfter time.Duration
}

ErrTooManyRequestsDetails is expected to be available under APIError.Details() when the API returns status code 429 (Too many requests) and a `Retry-After` header is set.

type GraphqlRateLimitingCostDecoration

type GraphqlRateLimitingCostDecoration struct {
	ID           *string   `json:"id,omitempty" yaml:"id,omitempty"`
	TypePath     *string   `json:"type_path,omitempty" yaml:"type_path,omitempty"`
	AddConstant  *float64  `json:"add_constant,omitempty" yaml:"add_constant,omitempty"`
	AddArguments []*string `json:"add_arguments,omitempty" yaml:"add_arguments,omitempty"`
	MulConstant  *float64  `json:"mul_constant,omitempty" yaml:"mul_constant,omitempty"`
	MulArguments []*string `json:"mul_arguments,omitempty" yaml:"mul_arguments,omitempty"`
}

GraphqlRateLimitingCostDecoration represents a decoration that Kong uses to estimate the cost of a portion of a Graphql request. +k8s:deepcopy-gen=true

func (*GraphqlRateLimitingCostDecoration) DeepCopy

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

func (*GraphqlRateLimitingCostDecoration) DeepCopyInto

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

type GraphqlRateLimitingCostDecorationService

type GraphqlRateLimitingCostDecorationService service

func (*GraphqlRateLimitingCostDecorationService) Create

Create creates a CostDecoration item in Kong for the GraphQL rate limiting advanced plugin.

func (*GraphqlRateLimitingCostDecorationService) Delete

Delete deletes a CostDecoration item from Kong given an ID.

func (*GraphqlRateLimitingCostDecorationService) Get

Get fetches a CostDecoration item from Kong given an ID.

func (*GraphqlRateLimitingCostDecorationService) List

List fetches a list of CostDecoration items from Kong. opt can be used to control pagination.

func (*GraphqlRateLimitingCostDecorationService) ListAll

ListAll fetches all CostDecoration items present in Kong. This method can take a while to pull all pages of content if there are many items present

func (*GraphqlRateLimitingCostDecorationService) Update

Update updates a CostDecoration item in Kong. The given data must include the ID of an existing item.

type HMACAuth

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

func (in *HMACAuth) DeepCopy() *HMACAuth

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

func (*HMACAuth) DeepCopyInto

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

type HMACAuthService service

HMACAuthService handles hmac-auth credentials in Kong.

func (*HMACAuthService) Create

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

func (s *HMACAuthService) Delete(ctx context.Context,
	consumerUsernameOrID, usernameOrID *string,
) error

Delete deletes a hmac-auth credential in Kong

func (*HMACAuthService) Get

func (s *HMACAuthService) Get(ctx context.Context,
	consumerUsernameOrID, usernameOrID *string,
) (*HMACAuth, error)

Get fetches a hmac-auth credential from Kong.

func (*HMACAuthService) List

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

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

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

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

Update updates a hmac-auth credential in Kong

type HealthData

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

func (in *HealthData) DeepCopy() *HealthData

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

func (*HealthData) DeepCopyInto

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

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

func (in *HealthDataAddress) DeepCopy() *HealthDataAddress

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

func (*HealthDataAddress) DeepCopyInto

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

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

func (in *HealthDataWeight) DeepCopy() *HealthDataWeight

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

func (*HealthDataWeight) DeepCopyInto

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"`
	// +kubebuilder:validation:Minimum=0
	Interval *int `json:"interval,omitempty" yaml:"interval,omitempty"`
	// +kubebuilder:validation:Minimum=0
	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 IDFillable

type IDFillable interface {
	FillID() error
}

IDFillable is a type constraint for entities that can be filled with an ID.

type Info

type Info struct {
	Version       string                `json:"version,omitempty" yaml:"version,omitempty"`
	Configuration *RuntimeConfiguration `json:"configuration,omitempty" yaml:"configuration,omitempty"`
}

Info represents the information concerning Kong.

type InfoService

type InfoService service

func (*InfoService) Get

func (s *InfoService) Get(ctx context.Context) (*Info, error)

Get retrieves the high-level metadata of a Kong instance.

type JWTAuth

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

func (in *JWTAuth) DeepCopy() *JWTAuth

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

func (*JWTAuth) DeepCopyInto

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

type JWTAuthService service

JWTAuthService handles JWT credentials in Kong.

func (*JWTAuthService) Create

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

func (s *JWTAuthService) Delete(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) error

Delete deletes a JWT credential in Kong

func (*JWTAuthService) Get

func (s *JWTAuthService) Get(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) (*JWTAuth, error)

Get fetches a JWT credential from Kong.

func (*JWTAuthService) List

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

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

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

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

Update updates a JWT credential in Kong

type Key

type Key struct {
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt *int64    `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	Set       *KeySet   `json:"set,omitempty" yaml:"set,omitempty"`
	Name      *string   `json:"name,omitempty" yaml:"name,omitempty"`
	KID       *string   `json:"kid,omitempty" yaml:"kid,omitempty"`
	JWK       *string   `json:"jwk,omitempty" yaml:"jwk,omitempty"`
	PEM       *PEM      `json:"pem,omitempty" yaml:"pem,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Key represents a JWK or PEM key in Kong. +k8s:deepcopy-gen=true

func (*Key) DeepCopy

func (in *Key) DeepCopy() *Key

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

func (*Key) DeepCopyInto

func (in *Key) DeepCopyInto(out *Key)

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

type KeyAuth

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

func (in *KeyAuth) DeepCopy() *KeyAuth

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

func (*KeyAuth) DeepCopyInto

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

type KeyAuthService service

KeyAuthService handles key-auth credentials in Kong.

func (*KeyAuthService) Create

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

func (s *KeyAuthService) Delete(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) error

Delete deletes a key-auth credential in Kong

func (*KeyAuthService) Get

func (s *KeyAuthService) Get(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) (*KeyAuth, error)

Get fetches a key-auth credential from Kong.

func (*KeyAuthService) List

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

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

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

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

Update updates a key-auth credential in Kong

type KeyService

type KeyService service

func (*KeyService) Create

func (s *KeyService) Create(ctx context.Context,
	key *Key,
) (*Key, error)

Create creates a Key in Kong. If an ID is specified, it will be used to create a key in Kong, otherwise an ID is auto-generated.

func (*KeyService) Delete

func (s *KeyService) Delete(ctx context.Context,
	nameOrID *string,
) error

Delete deletes a Key in Kong

func (*KeyService) Get

func (s *KeyService) Get(ctx context.Context,
	nameOrID *string,
) (*Key, error)

Get fetches a Key in Kong.

func (*KeyService) List

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

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

func (*KeyService) ListAll

func (s *KeyService) ListAll(ctx context.Context) ([]*Key, error)

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

func (*KeyService) Update

func (s *KeyService) Update(ctx context.Context,
	key *Key,
) (*Key, error)

Update updates a Key in Kong

type KeySet

type KeySet struct {
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt *int64    `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	Name      *string   `json:"name,omitempty" yaml:"name,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

KeySet represents a set of keys in Kong. +k8s:deepcopy-gen=true

func (*KeySet) DeepCopy

func (in *KeySet) DeepCopy() *KeySet

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

func (*KeySet) DeepCopyInto

func (in *KeySet) DeepCopyInto(out *KeySet)

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

type KeySetService

type KeySetService service

func (*KeySetService) Create

func (s *KeySetService) Create(ctx context.Context,
	keySet *KeySet,
) (*KeySet, error)

Create creates a Key in Kong. If an ID is specified, it will be used to create a key in Kong, otherwise an ID is auto-generated.

func (*KeySetService) Delete

func (s *KeySetService) Delete(ctx context.Context,
	nameOrID *string,
) error

Delete deletes a KeySet in Kong

func (*KeySetService) Get

func (s *KeySetService) Get(ctx context.Context,
	nameOrID *string,
) (*KeySet, error)

Get fetches a KeySet in Kong.

func (*KeySetService) List

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

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

func (*KeySetService) ListAll

func (s *KeySetService) ListAll(ctx context.Context) ([]*KeySet, error)

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

func (*KeySetService) Update

func (s *KeySetService) Update(ctx context.Context,
	keySet *KeySet,
) (*KeySet, error)

Update updates a KeySet in Kong

type License

type License struct {
	ID        *string `json:"id,omitempty" yaml:"id,omitempty"`
	Payload   *string `json:"payload,omitempty" yaml:"payload,omitempty"`
	CreatedAt *int64  `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt *int64  `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
}

License represents a License in Kong. Read https://docs.konghq.com/gateway/latest/admin-api/#consumer-object +k8s:deepcopy-gen=true

func (*License) DeepCopy

func (in *License) DeepCopy() *License

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

func (*License) DeepCopyInto

func (in *License) DeepCopyInto(out *License)

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

func (*License) FriendlyName

func (c *License) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type LicenseService

type LicenseService service

LicenseService handles Licenses in Kong.

func (*LicenseService) Create

func (s *LicenseService) Create(ctx context.Context,
	license *License,
) (*License, error)

Create creates a License in Kong. If an ID is specified, it will be used to create a license in Kong, otherwise an ID is auto-generated.

func (*LicenseService) Delete

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

Delete deletes a License in Kong

func (*LicenseService) Get

func (s *LicenseService) Get(ctx context.Context,
	ID *string,
) (*License, error)

Get fetches a License in Kong.

func (*LicenseService) List

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

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

func (*LicenseService) ListAll

func (s *LicenseService) ListAll(ctx context.Context) ([]*License, error)

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

func (*LicenseService) Update

func (s *LicenseService) Update(ctx context.Context,
	license *License,
) (*License, error)

Update updates a License 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

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

func (in *MTLSAuth) DeepCopy() *MTLSAuth

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

func (*MTLSAuth) DeepCopyInto

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

type MTLSAuthService service

MTLSAuthService handles MTLS credentials in Kong.

func (*MTLSAuthService) Create

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

func (s *MTLSAuthService) Delete(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) error

Delete deletes an MTLS credential in Kong

func (*MTLSAuthService) Get

func (s *MTLSAuthService) Get(ctx context.Context,
	consumerUsernameOrID, keyOrID *string,
) (*MTLSAuth, error)

Get fetches an MTLS credential from Kong.

func (*MTLSAuthService) List

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

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

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

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

Update updates an MTLS credential in Kong

type Oauth2Credential

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"`
	ClientType   *string   `json:"client_type,omitempty" yaml:"client_type,omitempty"`
	HashSecret   *bool     `json:"hash_secret,omitempty" yaml:"hash_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

func (in *Oauth2Credential) DeepCopy() *Oauth2Credential

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

func (*Oauth2Credential) DeepCopyInto

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

type Oauth2Service service

Oauth2Service handles oauth2 credentials in Kong.

func (*Oauth2Service) Create

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

func (s *Oauth2Service) Delete(ctx context.Context,
	consumerUsernameOrID, clientIDorID *string,
) error

Delete deletes an oauth2 credential in Kong.

func (*Oauth2Service) Get

func (s *Oauth2Service) Get(ctx context.Context,
	consumerUsernameOrID, clientIDorID *string,
) (*Oauth2Credential, error)

Get fetches an oauth2 credential from Kong.

func (*Oauth2Service) List

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

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

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

func (s *Oauth2Service) Update(ctx context.Context,
	consumerUsernameOrID *string,
	oauth2Cred *Oauth2Credential,
) (*Oauth2Credential, error)

Update updates an oauth2 credential in Kong.

type PEM

type PEM struct {
	PublicKey  *string `json:"public_key,omitempty" yaml:"public_key,omitempty"`
	PrivateKey *string `json:"private_key,omitempty" yaml:"private_key,omitempty"`
}

PEM represents a PEM formatted key in Kong. +k8s:deepcopy-gen=true

func (*PEM) DeepCopy

func (in *PEM) DeepCopy() *PEM

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

func (*PEM) DeepCopyInto

func (in *PEM) DeepCopyInto(out *PEM)

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

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"`
	InstanceName *string         `json:"instance_name,omitempty" yaml:"instance_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"`
	Ordering     *PluginOrdering `json:"ordering,omitempty" yaml:"ordering,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://docs.konghq.com/gateway/latest/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.

func (*Plugin) FriendlyName

func (p *Plugin) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type PluginOrdering

type PluginOrdering struct {
	Before PluginOrderingPhase `json:"before,omitempty"`
	After  PluginOrderingPhase `json:"after,omitempty"`
}

PluginOrdering contains before or after instructions for plugin execution order +k8s:deepcopy-gen=true

func (*PluginOrdering) DeepCopy

func (in *PluginOrdering) DeepCopy() *PluginOrdering

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

func (*PluginOrdering) DeepCopyInto

func (in *PluginOrdering) DeepCopyInto(out *PluginOrdering)

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

type PluginOrderingPhase

type PluginOrderingPhase map[string][]string

PluginOrderingPhase indicates which plugins in a phase should affect the target plugin's order +k8s:deepcopy-gen=true

func (PluginOrderingPhase) DeepCopy

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

func (PluginOrderingPhase) DeepCopyInto

func (in PluginOrderingPhase) DeepCopyInto(out *PluginOrderingPhase)

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

func (s *PluginService) CreateForRoute(ctx context.Context,
	routeIDorName *string, plugin *Plugin,
) (*Plugin, error)

CreateForRoute creates a Plugin in Kong at Route level. If an ID is specified, it will be used to create a plugin in Kong, otherwise an ID is auto-generated.

func (*PluginService) CreateForService

func (s *PluginService) CreateForService(ctx context.Context,
	serviceIDorName *string, plugin *Plugin,
) (*Plugin, error)

CreateForService creates a Plugin in Kong at Service level. 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,
	pluginID *string,
) error

Delete deletes a Plugin in Kong

func (*PluginService) DeleteForRoute

func (s *PluginService) DeleteForRoute(ctx context.Context,
	routeIDorName *string, pluginID *string,
) error

DeleteForRoute deletes a Plugin in Kong at Route level.

func (*PluginService) DeleteForService

func (s *PluginService) DeleteForService(ctx context.Context,
	serviceIDorName *string, pluginID *string,
) error

DeleteForService deletes a Plugin in Kong at Service level.

func (*PluginService) Get

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

Get fetches a Plugin in Kong.

func (*PluginService) GetFullSchema

func (s *PluginService) GetFullSchema(ctx context.Context,
	pluginName *string,
) (Schema, error)

GetFullSchema retrieves the full schema of a plugin.

func (*PluginService) GetSchema deprecated

func (s *PluginService) GetSchema(ctx context.Context,
	pluginName *string,
) (Schema, error)

GetSchema retrieves the config schema of a plugin

Deprecated: Use GetFullSchema instead

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

func (s *PluginService) UpdateForRoute(ctx context.Context,
	routeIDorName *string, plugin *Plugin,
) (*Plugin, error)

UpdateForRoute updates a Plugin in Kong at Route level.

func (*PluginService) UpdateForService

func (s *PluginService) UpdateForService(ctx context.Context,
	serviceIDorName *string, plugin *Plugin,
) (*Plugin, error)

UpdateForService updates a Plugin in Kong at Service level.

func (*PluginService) Validate

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

Validate validates a Plugin against its schema

type ProxyListener

type ProxyListener struct {
	SSL           bool   `json:"ssl"             mapstructure:"ssl"`
	Listener      string `json:"listener"        mapstructure:"listener"`
	Port          int    `json:"port"            mapstructure:"port"`
	Bind          bool   `json:"bind"            mapstructure:"bind"`
	IP            string `json:"ip"              mapstructure:"ip"`
	HTTP2         bool   `json:"http2"           mapstructure:"http2"`
	ProxyProtocol bool   `json:"proxy_protocol"  mapstructure:"proxy_protocol"`
	Deferred      bool   `json:"deferred"        mapstructure:"deferred"`
	ReusePort     bool   `json:"reuseport"       mapstructure:"reuseport"`
	Backlog       bool   `json:"backlog=%d+"     mapstructure:"backlog=%d+"`
}

ProxyListener is a configured listener on the Kong Gateway for L7 routing.

type RBACEndpointPermission

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

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

func (*RBACEndpointPermission) DeepCopyInto

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

func (e *RBACEndpointPermission) FriendlyName() string

FriendlyName returns a composite Name base on Role , workspace, and endpoint

func (*RBACEndpointPermission) MarshalJSON

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

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

type RBACEndpointPermissionService

type RBACEndpointPermissionService service

RBACEndpointPermissionService handles RBACEndpointPermissions in Kong.

func (*RBACEndpointPermissionService) Create

Create creates a RBACEndpointPermission in Kong.

func (*RBACEndpointPermissionService) Delete

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

Delete deletes a EndpointPermission in Kong

func (*RBACEndpointPermissionService) Get

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

Get fetches a RBACEndpointPermission in Kong.

func (*RBACEndpointPermissionService) ListAllForRole

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

Update updates a RBACEndpointPermission in Kong.

type RBACEntityPermission

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

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

func (*RBACEntityPermission) DeepCopyInto

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

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

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

type RBACEntityPermissionService

type RBACEntityPermissionService service

RBACEntityPermissionService handles RBACEntityPermissions in Kong.

func (*RBACEntityPermissionService) Create

Create creates an RBACEntityPermission in Kong.

func (*RBACEntityPermissionService) Delete

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

Delete deletes an EntityPermission in Kong

func (*RBACEntityPermissionService) Get

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

Get fetches an EntityPermission in Kong.

func (*RBACEntityPermissionService) ListAllForRole

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

Update updates an EntityPermission in Kong.

type RBACPermissionsList

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

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

type RBACRole

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

func (in *RBACRole) DeepCopy() *RBACRole

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

func (*RBACRole) DeepCopyInto

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

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

func (*RBACRole) FriendlyName

func (r *RBACRole) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type RBACRoleService

type RBACRoleService service

RBACRoleService handles Roles in Kong.

func (*RBACRoleService) Create

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

Create creates a Role in Kong.

func (*RBACRoleService) Delete

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

Delete deletes a Role in Kong

func (*RBACRoleService) Get

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

Get fetches a Role in Kong.

func (*RBACRoleService) List

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

List fetches a list of all Roles in Kong.

func (*RBACRoleService) ListAll

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

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

Update updates a Role in Kong.

type RBACUser

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

func (in *RBACUser) DeepCopy() *RBACUser

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

func (*RBACUser) DeepCopyInto

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

type RBACUserService service

RBACUserService handles Users in Kong.

func (*RBACUserService) AddRoles

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

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

Create creates an RBAC User in Kong.

func (*RBACUserService) Delete

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

Delete deletes a User in Kong

func (*RBACUserService) DeleteRoles

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

DeleteRoles deletes roles associated with a User

func (*RBACUserService) Get

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

Get fetches a User in Kong.

func (*RBACUserService) List

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

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

ListAll fetches all users in Kong.

func (*RBACUserService) ListPermissions

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

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

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

Update updates a User in Kong.

type Range

type Range func(Version) bool

Range represents a range of versions which can be used to validate if a Version is valid for a Range.

func MustNewRange

func MustNewRange(rangeStr string) Range

MustNewRange creates a new instance of a Version; however it will panic if it cannot be created.

func NewRange

func NewRange(rangeStr string) (Range, error)

NewRange creates an instance of a Range. Valid ranges can consist of multiple comparisons and three/four digit versions:

  • "<1.0.0" || "<v1.0.0.0"
  • "<=1.0.0" || "<=1.0.0.0"
  • ">1.0.0" || ">1.0.0.0"
  • ">=1.0.0" || >= 1.0.0.0
  • "1.0.0", "=1.0.0", "==1.0.0" || "1.0.0.0", "=1.0.0.0", "==1.0.0.0"
  • "!1.0.0", "!=1.0.0" || "!1.0.0.0", "!=1.0.0.0"

A Range can consist of multiple ranges separated by space: Ranges can be linked by logical AND:

  • ">1.0.0 <2.0.0" would match between both ranges, so "1.1.1" and "1.8.7" but not "1.0.0" or "2.0.0"
  • ">1.0.0 <3.0.0 !2.0.3-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2

Four digit versions can be used in ranges with three digit version and linked by logical AND:

  • ">1.0.0 <2.0.0.0" would match between both ranges, so "1.0.0.1" and "1.8.7" but not "1.0.0", "2.0.0"
  • ">1.0.0 <3.0.0 !2.0.3.0-beta.2" would match every version between 1.0.0 and 3.0.0 except 2.0.3-beta.2 and 2.0.3.0-beta2

Ranges can also be linked by logical OR:

  • "<2.0.0 || >=3.0.0" would match "1.x.x" and "3.x.x" but not "2.x.x"

Four digit versions can be used in ranges with three digit version and linked by logical OR:

AND has a higher precedence than OR. It's not possible to use brackets.

Ranges can be combined by both AND and OR:

  • ">1.0.0 <2.0.0.0 || >3.0.0 !4.2.1" would match "1.2.3", "1.0.0.1", "1.9.9", "3.1.1", but not "4.2.1", "2.1.1"

type RequiredFeatures

type RequiredFeatures struct {
	Portal bool
	RBAC   bool
}

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"`
	Expression    *string             `json:"expression,omitempty" yaml:"expression,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"`
	Priority      *int                `json:"priority,omitempty" yaml:"priority,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://docs.konghq.com/gateway/latest/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.

func (*Route) FillID

func (r *Route) FillID() error

FillID fills the ID of an entity. It is a no-op if the entity already has an ID. ID is generated in a deterministic way using UUIDv5. The UUIDv5 namespace is different for each entity type. The name used to generate the ID for Route is Route.Name.

func (*Route) FriendlyName

func (r *Route) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

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 RuntimeConfiguration

type RuntimeConfiguration struct {
	Database string `json:"database,omitempty" yaml:"database,omitempty"`
	Portal   bool   `json:"portal,omitempty" yaml:"portal,omitempty"`
	RBAC     string `json:"rbac,omitempty" yaml:"rbac,omitempty"`
}

RuntimeConfiguration represents the runtime configuration of Kong.

func (*RuntimeConfiguration) IsInMemory

func (r *RuntimeConfiguration) IsInMemory() bool

IsInMemory check if Kong is in memory

func (*RuntimeConfiguration) IsRBACEnabled

func (r *RuntimeConfiguration) IsRBACEnabled() bool

IsRBACEnabled check if RBAC are enabled

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://docs.konghq.com/gateway/latest/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.

func (*SNI) FriendlyName

func (s *SNI) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

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 Schema

type Schema map[string]interface{}

Schema represents an entity schema in Kong.

type SchemaService

type SchemaService service

SchemaService handles schemas in Kong.

func (*SchemaService) Get

func (s *SchemaService) Get(ctx context.Context, entity string) (Schema, error)

Get retrieves the full schema of kong entities.

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"`
	Enabled           *bool        `json:"enabled,omitempty" yaml:"enabled,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://docs.konghq.com/gateway/latest/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.

func (*Service) FillID

func (s *Service) FillID() error

FillID fills the ID of an entity. It is a no-op if the entity already has an ID. ID is generated in a deterministic way using UUIDv5. The UUIDv5 namespace is different for each entity type. The name used to generate the ID for Service is Service.Name.

func (*Service) FriendlyName

func (s *Service) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

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"`
	ConfigurationHash string `json:"configuration_hash,omitempty" yaml:"configuration_hash,omitempty"`
}

Status respresents current status of a Kong node.

type StreamListener

type StreamListener struct {
	UDP           bool   `json:"udp"             mapstructure:"udp"`
	SSL           bool   `json:"ssl"             mapstructure:"ssl"`
	ProxyProtocol bool   `json:"proxy_protocol"  mapstructure:"proxy_protocol"`
	IP            string `json:"ip"              mapstructure:"ip"`
	Listener      string `json:"listener"        mapstructure:"listener"`
	Port          int    `json:"port"            mapstructure:"port"`
	Bind          bool   `json:"bind"            mapstructure:"bind"`
	ReusePort     bool   `json:"reuseport"       mapstructure:"reuseport"`
	Backlog       bool   `json:"backlog=%d+"     mapstructure:"backlog=%d+"`
}

StreamListener is a configured listener on the Kong Gateway for L4 routing.

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 TagService

type TagService service

TagService handles Tags in Kong.

func (*TagService) Exists

func (s *TagService) Exists(ctx context.Context) (bool, error)

Exists checks exitence of the Tags 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.

func (*Target) FriendlyName

func (t *Target) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

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 {
	// +kubebuilder:validation:Minimum=0
	HTTPFailures *int  `json:"http_failures,omitempty" yaml:"http_failures,omitempty"`
	HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
	// +kubebuilder:validation:Minimum=0
	TCPFailures *int `json:"tcp_failures,omitempty" yaml:"tcp_failures,omitempty"`
	// +kubebuilder:validation:Minimum=0
	Timeouts *int `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
	// +kubebuilder:validation:Minimum=0
	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"`
	HashOnQueryArg         *string      `json:"hash_on_query_arg,omitempty" yaml:"hash_on_query_arg,omitempty"`
	HashFallbackQueryArg   *string      `json:"hash_fallback_query_arg,omitempty" yaml:"hash_fallback_query_arg,omitempty"` //nolint:lll
	HashOnURICapture       *string      `json:"hash_on_uri_capture,omitempty" yaml:"hash_on_uri_capture,omitempty"`
	HashFallbackURICapture *string      `json:"hash_fallback_uri_capture,omitempty" yaml:"hash_fallback_uri_capture,omitempty"` //nolint:lll
	UseSrvName             *bool        `json:"use_srv_name,omitempty" yaml:"use_srv_name,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.

func (*Upstream) FriendlyName

func (u *Upstream) FriendlyName() string

FriendlyName returns the endpoint key name or ID.

type UpstreamNodeHealth

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

func (in *UpstreamNodeHealth) DeepCopy() *UpstreamNodeHealth

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

func (*UpstreamNodeHealth) DeepCopyInto

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

type UpstreamNodeHealthService service

UpstreamNodeHealthService handles Upstream Node Healths in Kong.

func (*UpstreamNodeHealthService) List

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

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 Vault

type Vault struct {
	ID          *string       `json:"id,omitempty" yaml:"id,omitempty"`
	Name        *string       `json:"name,omitempty" yaml:"name,omitempty"`
	Description *string       `json:"description,omitempty" yaml:"description,omitempty"`
	Prefix      *string       `json:"prefix,omitempty" yaml:"prefix,omitempty"`
	Config      Configuration `json:"config,omitempty" yaml:"config,omitempty"`
	CreatedAt   *int64        `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	UpdatedAt   *int64        `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	Tags        []*string     `json:"tags,omitempty" yaml:"tags,omitempty"`
}

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

func (*Vault) DeepCopy

func (in *Vault) DeepCopy() *Vault

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

func (*Vault) DeepCopyInto

func (in *Vault) DeepCopyInto(out *Vault)

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

func (*Vault) FriendlyName

func (s *Vault) FriendlyName() string

FriendlyName returns the endpoint key prefix or ID.

type VaultService

type VaultService service

VaultService handles Vaults in Kong.

func (*VaultService) Create

func (s *VaultService) Create(ctx context.Context, vault *Vault) (*Vault, error)

Create creates a Vault in Kong If an ID is specified, it will be used to create a Vault in Kong, otherwise an ID is auto-generated.

func (*VaultService) Delete

func (s *VaultService) Delete(ctx context.Context, prefixOrID *string) error

Delete deletes a Vault in Kong

func (*VaultService) Get

func (s *VaultService) Get(ctx context.Context, prefixOrID *string) (*Vault, error)

Get fetches a Vault in Kong.

func (*VaultService) List

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

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

func (*VaultService) ListAll

func (s *VaultService) ListAll(ctx context.Context) ([]*Vault, error)

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

func (*VaultService) Update

func (s *VaultService) Update(ctx context.Context, vault *Vault) (*Vault, error)

Update updates a Vault in Kong

type Version

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

Version represents a three or four digit version.

func MustNewVersion

func MustNewVersion(versionStr string) Version

MustNewVersion creates a new instance of a Version; however it will panic if it cannot be created.

func NewVersion

func NewVersion(versionStr string) (Version, error)

NewVersion creates a new instance of a Version.

func ParseSemanticVersion

func ParseSemanticVersion(v string) (Version, error)

ParseSemanticVersion creates a semantic version from the version returned by Kong.

func (Version) Build

func (v Version) Build() string

Build returns the build metadata string of Version.

func (Version) IsKongGatewayEnterprise

func (v Version) IsKongGatewayEnterprise() bool

IsKongGatewayEnterprise determines if a Version represents a Kong Gateway enterprise edition.

func (Version) Major

func (v Version) Major() uint64

Major returns the major digit of Version.

func (Version) Minor

func (v Version) Minor() uint64

Minor returns the minor digit of Version.

func (Version) Patch

func (v Version) Patch() uint64

Patch returns the patch digit of Version.

func (Version) PreRelease

func (v Version) PreRelease() string

PreRelease returns the pre-release string of Version.

func (Version) Revision

func (v Version) Revision() (uint64, error)

Revision returns the revision digit of Version; if revision has not been set then an error will be returned.

func (Version) String

func (v Version) String() string

String returns the textual or display value of the Version.

type Workspace

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

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

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

func (*WorkspaceEntity) DeepCopy

func (in *WorkspaceEntity) DeepCopy() *WorkspaceEntity

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

func (*WorkspaceEntity) DeepCopyInto

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

type WorkspaceService service

WorkspaceService handles Workspaces in Kong.

func (*WorkspaceService) AddEntities deprecated

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

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

Create creates a Workspace in Kong.

func (*WorkspaceService) Delete

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

Delete deletes a Workspace in Kong

func (*WorkspaceService) DeleteEntities deprecated

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

func (s *WorkspaceService) Exists(ctx context.Context,
	nameOrID *string,
) (bool, error)

Exists checks the exitence of the Workspace in Kong.

func (*WorkspaceService) ExistsByName

func (s *WorkspaceService) ExistsByName(ctx context.Context,
	name *string,
) (bool, error)

ExistsByName checks the exitence of the Workspace using its name in Kong.

func (*WorkspaceService) Get

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

Get fetches a Workspace in Kong.

func (*WorkspaceService) List

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

List fetches a list of all Workspaces in Kong.

func (*WorkspaceService) ListAll

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

ListAll fetches all workspaces in Kong.

func (*WorkspaceService) ListEntities deprecated

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

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