kong

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jul 30, 2020 License: Apache-2.0 Imports: 16 Imported by: 19

Documentation

Overview

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

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Bool

func Bool(b bool) *bool

Bool returns a pointer to b.

func HTTPClientWithHeaders added in v0.12.0

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

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

func Int

func Int(i int) *int

Int returns a pointer to i.

func IsNotFoundErr

func IsNotFoundErr(e error) bool

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

func String

func String(s string) *string

String returns pointer to s.

func StringSlice

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

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

Types

type ACLGroup added in v0.7.0

type ACLGroup struct {
	Consumer  *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Group     *string   `json:"group,omitempty" yaml:"group,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

ACLGroup represents an ACL group for a consumer in Kong. +k8s:deepcopy-gen=true

func (*ACLGroup) DeepCopy added in v0.7.0

func (in *ACLGroup) DeepCopy() *ACLGroup

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

func (*ACLGroup) DeepCopyInto added in v0.7.0

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

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

type ACLService added in v0.7.0

type ACLService service

ACLService handles consumer ACL groups in Kong.

func (*ACLService) Create added in v0.7.0

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

Create adds a consumer to an ACL group in Kong If an ID is specified, it will be used to create the group association in Kong, otherwise an ID is auto-generated.

func (*ACLService) Delete added in v0.7.0

func (s *ACLService) Delete(ctx context.Context,
	consumerUsernameOrID, groupOrID *string) error

Delete deletes an ACL group association for a consumer in Kong

func (*ACLService) Get added in v0.7.0

func (s *ACLService) Get(ctx context.Context,
	consumerUsernameOrID, groupOrID *string) (*ACLGroup, error)

Get fetches an ACL group for a consumer in Kong.

func (*ACLService) List added in v0.7.0

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

List fetches a list of all ACL group and consumer associations in Kong. opt can be used to control pagination.

func (*ACLService) ListAll added in v0.7.0

func (s *ACLService) ListAll(ctx context.Context) ([]*ACLGroup, error)

ListAll fetches all all ACL group associations in Kong. This method can take a while if there a lot of ACLGroup associations are present.

func (*ACLService) ListForConsumer added in v0.7.0

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

ListForConsumer fetches a list of ACL groups in Kong associated with a specific consumer. opt can be used to control pagination.

func (*ACLService) Update added in v0.7.0

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

Update updates an ACL group for a consumer in Kong

type ActiveHealthcheck

type ActiveHealthcheck struct {
	Concurrency            *int       `json:"concurrency,omitempty" yaml:"concurrency,omitempty"`
	Healthy                *Healthy   `json:"healthy,omitempty" yaml:"healthy,omitempty"`
	HTTPPath               *string    `json:"http_path,omitempty" yaml:"http_path,omitempty"`
	HTTPSSni               *string    `json:"https_sni,omitempty" yaml:"https_sni,omitempty"`
	HTTPSVerifyCertificate *bool      `json:"https_verify_certificate,omitempty" yaml:"https_verify_certificate,omitempty"`
	Type                   *string    `json:"type,omitempty" yaml:"type,omitempty"`
	Timeout                *int       `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Unhealthy              *Unhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
}

ActiveHealthcheck configures active health check probing. +k8s:deepcopy-gen=true

func (*ActiveHealthcheck) DeepCopy

func (in *ActiveHealthcheck) DeepCopy() *ActiveHealthcheck

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

func (*ActiveHealthcheck) DeepCopyInto

func (in *ActiveHealthcheck) DeepCopyInto(out *ActiveHealthcheck)

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

type Admin added in v0.12.0

type Admin struct {
	CreatedAt        *int    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID               *string `json:"id,omitempty" yaml:"id,omitempty"`
	Email            *string `json:"email,omitempty" yaml:"email,omitempty"`
	Username         *string `json:"username,omitempty" yaml:"username,omitempty"`
	Password         *string `json:"password,omitempty" yaml:"password,omitempty"`
	CustomID         *string `json:"custom_id,omitempty" yaml:"custom_id,omitempty"`
	RBACTokenEnabled *bool   `json:"rbac_token_enabled,omitempty" yaml:"rbac_token_enabled,omitempty"`
	Status           *int    `json:"status,omitempty" yaml:"status,omitempty"`
	Token            *string `json:"token,omitempty" yaml:"token,omitempty"`
}

Admin represents an Admin in Kong.

type AdminService added in v0.12.0

type AdminService service

AdminService handles Admins in Kong.

func (*AdminService) Create added in v0.12.0

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

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

func (*AdminService) Delete added in v0.12.0

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

Delete deletes an Admin in Kong

func (*AdminService) GenerateRegisterURL added in v0.12.0

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

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

func (*AdminService) Get added in v0.12.0

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

Get fetches a Admin in Kong.

func (*AdminService) Invite added in v0.12.0

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

Invite creates an Admin in Kong.

func (*AdminService) List added in v0.12.0

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

List fetches a list of all Admins in Kong.

func (*AdminService) RegisterCredentials added in v0.12.0

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

RegisterCredentials registers credentials for existing Kong Admins

func (*AdminService) Update added in v0.12.0

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

Update updates an Admin in Kong.

type BasicAuth added in v0.7.0

type BasicAuth struct {
	Consumer  *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Username  *string   `json:"username,omitempty" yaml:"username,omitempty"`
	Password  *string   `json:"password,omitempty" yaml:"password,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

BasicAuth represents a basic-auth credential in Kong. +k8s:deepcopy-gen=true

func (*BasicAuth) DeepCopy added in v0.7.0

func (in *BasicAuth) DeepCopy() *BasicAuth

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

func (*BasicAuth) DeepCopyInto added in v0.7.0

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

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

type BasicAuthService added in v0.7.0

type BasicAuthService service

BasicAuthService handles basic-auth credentials in Kong.

func (*BasicAuthService) Create added in v0.7.0

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

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

func (*BasicAuthService) Delete added in v0.7.0

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

Delete deletes a basic-auth credential in Kong

func (*BasicAuthService) Get added in v0.7.0

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

Get fetches a basic-auth credential from Kong.

func (*BasicAuthService) List added in v0.7.0

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

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

func (*BasicAuthService) ListAll added in v0.7.0

func (s *BasicAuthService) ListAll(ctx context.Context) ([]*BasicAuth, error)

ListAll fetches all basic-auth credentials in Kong. This method can take a while if there a lot of basic-auth credentials present.

func (*BasicAuthService) ListForConsumer added in v0.7.0

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

ListForConsumer fetches a list of basic-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*BasicAuthService) Update added in v0.7.0

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

Update updates a basic-auth credential in Kong

type CACertificate added in v0.6.0

type CACertificate struct {
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Cert      *string   `json:"cert,omitempty" yaml:"cert,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

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

func (*CACertificate) DeepCopy added in v0.6.0

func (in *CACertificate) DeepCopy() *CACertificate

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

func (*CACertificate) DeepCopyInto added in v0.6.0

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

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

type CACertificateService added in v0.6.0

type CACertificateService service

CACertificateService handles Certificates in Kong.

func (*CACertificateService) Create added in v0.6.0

func (s *CACertificateService) Create(ctx context.Context,
	certificate *CACertificate) (*CACertificate, error)

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

func (*CACertificateService) Delete added in v0.6.0

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

Delete deletes a CACertificate in Kong

func (*CACertificateService) Get added in v0.6.0

Get fetches a CACertificate in Kong.

func (*CACertificateService) List added in v0.6.0

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

func (*CACertificateService) ListAll added in v0.6.0

func (s *CACertificateService) ListAll(ctx context.Context) ([]*CACertificate,
	error)

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

func (*CACertificateService) Update added in v0.6.0

func (s *CACertificateService) Update(ctx context.Context,
	certificate *CACertificate) (*CACertificate, error)

Update updates a CACertificate in Kong

type CIDRPort

type CIDRPort struct {
	IP   *string `json:"ip,omitempty" yaml:"ip,omitempty"`
	Port *int    `json:"port,omitempty" yaml:"port,omitempty"`
}

CIDRPort represents a set of CIDR and a port. +k8s:deepcopy-gen=true

func (*CIDRPort) DeepCopy

func (in *CIDRPort) DeepCopy() *CIDRPort

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

func (*CIDRPort) DeepCopyInto

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

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

type Certificate

type Certificate struct {
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Cert      *string   `json:"cert,omitempty" yaml:"cert,omitempty"`
	Key       *string   `json:"key,omitempty" yaml:"key,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	SNIs      []*string `json:"snis,omitempty" yaml:"snis,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Certificate represents a Certificate in Kong. Read https://getkong.org/docs/0.14.x/admin-api/#certificate-object +k8s:deepcopy-gen=true

func (*Certificate) DeepCopy

func (in *Certificate) DeepCopy() *Certificate

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

func (*Certificate) DeepCopyInto

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

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

type CertificateService

type CertificateService service

CertificateService handles Certificates in Kong.

func (*CertificateService) Create

func (s *CertificateService) Create(ctx context.Context,
	certificate *Certificate) (*Certificate, error)

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

func (*CertificateService) Delete

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

Delete deletes a Certificate in Kong

func (*CertificateService) Get

func (s *CertificateService) Get(ctx context.Context,
	usernameOrID *string) (*Certificate, error)

Get fetches a Certificate in Kong.

func (*CertificateService) List

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

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

func (*CertificateService) ListAll

func (s *CertificateService) ListAll(ctx context.Context) ([]*Certificate,
	error)

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

func (*CertificateService) Update

func (s *CertificateService) Update(ctx context.Context,
	certificate *Certificate) (*Certificate, error)

Update updates a Certificate in Kong

type Client

type Client struct {
	Consumers      *ConsumerService
	Services       *Svcservice
	Routes         *RouteService
	CACertificates *CACertificateService
	Certificates   *CertificateService
	Plugins        *PluginService
	SNIs           *SNIService
	Upstreams      *UpstreamService
	Targets        *TargetService
	Workspaces     *WorkspaceService
	Admins         *AdminService

	KeyAuths   *KeyAuthService
	BasicAuths *BasicAuthService
	HMACAuths  *HMACAuthService
	JWTAuths   *JWTAuthService
	MTLSAuths  *MTLSAuthService
	ACLs       *ACLService

	Oauth2Credentials *Oauth2Service

	CustomEntities *CustomEntityService

	custom.Registry
	// contains filtered or unexported fields
}

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

func NewClient

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

NewClient returns a Client which talks to Admin API of Kong

func (*Client) Do

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

Do executes a HTTP request and returns a response

func (*Client) NewRequest added in v0.9.0

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

NewRequest creates a request based on the inputs. endpoint should be relative to the baseURL specified during client creation. body is always marshaled into JSON.

func (*Client) Root

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

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

func (*Client) SetDebugMode

func (c *Client) SetDebugMode(enableDebug bool)

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

func (*Client) SetLogger

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

SetLogger sets the debug logger, defaults to os.StdErr

func (*Client) Status

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

Status returns the status of a Kong node

type Configuration

type Configuration map[string]interface{}

Configuration represents a config of a plugin in Kong.

func (Configuration) DeepCopy

func (in Configuration) DeepCopy() Configuration

DeepCopy copies the receiver, creating a new Configuration.

func (Configuration) DeepCopyInto

func (in Configuration) DeepCopyInto(out *Configuration)

DeepCopyInto copies the receiver, writing into out. in must be non-nil.

type Consumer

type Consumer struct {
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	CustomID  *string   `json:"custom_id,omitempty" yaml:"custom_id,omitempty"`
	Username  *string   `json:"username,omitempty" yaml:"username,omitempty"`
	CreatedAt *int64    `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Consumer represents a Consumer in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#consumer-object +k8s:deepcopy-gen=true

func (*Consumer) DeepCopy

func (in *Consumer) DeepCopy() *Consumer

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

func (*Consumer) DeepCopyInto

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

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

type ConsumerService

type ConsumerService service

ConsumerService handles Consumers in Kong.

func (*ConsumerService) Create

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

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

func (*ConsumerService) Delete

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

Delete deletes a Consumer in Kong

func (*ConsumerService) Get

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

Get fetches a Consumer in Kong.

func (*ConsumerService) GetByCustomID added in v0.9.0

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

GetByCustomID fetches a Consumer in Kong.

func (*ConsumerService) List

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

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

func (*ConsumerService) ListAll

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

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

func (*ConsumerService) Update

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

Update updates a Consumer in Kong

type CustomEntityService

type CustomEntityService service

CustomEntityService handles custom entities in Kong.

func (*CustomEntityService) Create

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

Create creates a custom entity based on entity. All required fields must be present in entity.

func (*CustomEntityService) Delete

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

Delete deletes a custom entity in Kong.

func (*CustomEntityService) Get

Get fetches a custom entity. The primary key and all relations of the entity must be populated in entity.

func (*CustomEntityService) List

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

List fetches all custom entities based on relations

func (*CustomEntityService) ListAll

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

ListAll fetches all custom entities based on relations

func (*CustomEntityService) Update

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

Update updates a custom entity in Kong.

type HMACAuth added in v0.7.0

type HMACAuth struct {
	Consumer  *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Username  *string   `json:"username,omitempty" yaml:"username,omitempty"`
	Secret    *string   `json:"secret,omitempty" yaml:"secret,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

HMACAuth represents a hmac-auth credential in Kong. +k8s:deepcopy-gen=true

func (*HMACAuth) DeepCopy added in v0.7.0

func (in *HMACAuth) DeepCopy() *HMACAuth

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

func (*HMACAuth) DeepCopyInto added in v0.7.0

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

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

type HMACAuthService added in v0.7.0

type HMACAuthService service

HMACAuthService handles hmac-auth credentials in Kong.

func (*HMACAuthService) Create added in v0.7.0

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

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

func (*HMACAuthService) Delete added in v0.7.0

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

Delete deletes a hmac-auth credential in Kong

func (*HMACAuthService) Get added in v0.7.0

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

Get fetches a hmac-auth credential from Kong.

func (*HMACAuthService) List added in v0.7.0

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

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

func (*HMACAuthService) ListAll added in v0.7.0

func (s *HMACAuthService) ListAll(ctx context.Context) ([]*HMACAuth, error)

ListAll fetches all hmac-auth credentials in Kong. This method can take a while if there a lot of hmac-auth credentials present.

func (*HMACAuthService) ListForConsumer added in v0.7.0

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

ListForConsumer fetches a list of hmac-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*HMACAuthService) Update added in v0.7.0

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

Update updates a hmac-auth credential in Kong

type Healthcheck

type Healthcheck struct {
	Active    *ActiveHealthcheck  `json:"active,omitempty" yaml:"active,omitempty"`
	Passive   *PassiveHealthcheck `json:"passive,omitempty" yaml:"passive,omitempty"`
	Threshold *float64            `json:"threshold,omitempty" yaml:"threshold,omitempty"`
}

Healthcheck represents a health-check config of an upstream in Kong. +k8s:deepcopy-gen=true

func (*Healthcheck) DeepCopy

func (in *Healthcheck) DeepCopy() *Healthcheck

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

func (*Healthcheck) DeepCopyInto

func (in *Healthcheck) DeepCopyInto(out *Healthcheck)

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

type Healthy

type Healthy struct {
	HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
	Interval     *int  `json:"interval,omitempty" yaml:"interval,omitempty"`
	Successes    *int  `json:"successes,omitempty" yaml:"successes,omitempty"`
}

Healthy configures thresholds and HTTP status codes to mark targets healthy for an upstream. +k8s:deepcopy-gen=true

func (*Healthy) DeepCopy

func (in *Healthy) DeepCopy() *Healthy

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

func (*Healthy) DeepCopyInto

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

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

type JWTAuth added in v0.7.0

type JWTAuth struct {
	Consumer     *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt    *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID           *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Algorithm    *string   `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	Key          *string   `json:"key,omitempty" yaml:"key,omitempty"`
	RSAPublicKey *string   `json:"rsa_public_key,omitempty" yaml:"rsa_public_key,omitempty"`
	Secret       *string   `json:"secret,omitempty" yaml:"secret,omitempty"`
	Tags         []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

JWTAuth represents a JWT credential in Kong. +k8s:deepcopy-gen=true

func (*JWTAuth) DeepCopy added in v0.7.0

func (in *JWTAuth) DeepCopy() *JWTAuth

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

func (*JWTAuth) DeepCopyInto added in v0.7.0

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

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

type JWTAuthService added in v0.7.0

type JWTAuthService service

JWTAuthService handles JWT credentials in Kong.

func (*JWTAuthService) Create added in v0.7.0

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

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

func (*JWTAuthService) Delete added in v0.7.0

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

Delete deletes a JWT credential in Kong

func (*JWTAuthService) Get added in v0.7.0

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

Get fetches a JWT credential from Kong.

func (*JWTAuthService) List added in v0.7.0

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

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

func (*JWTAuthService) ListAll added in v0.7.0

func (s *JWTAuthService) ListAll(ctx context.Context) ([]*JWTAuth, error)

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

func (*JWTAuthService) ListForConsumer added in v0.7.0

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

ListForConsumer fetches a list of jwt credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*JWTAuthService) Update added in v0.7.0

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

Update updates a JWT credential in Kong

type KeyAuth added in v0.7.0

type KeyAuth struct {
	Consumer  *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Key       *string   `json:"key,omitempty" yaml:"key,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

KeyAuth represents a key-auth credential in Kong. +k8s:deepcopy-gen=true

func (*KeyAuth) DeepCopy added in v0.7.0

func (in *KeyAuth) DeepCopy() *KeyAuth

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

func (*KeyAuth) DeepCopyInto added in v0.7.0

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

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

type KeyAuthService added in v0.7.0

type KeyAuthService service

KeyAuthService handles key-auth credentials in Kong.

func (*KeyAuthService) Create added in v0.7.0

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

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

func (*KeyAuthService) Delete added in v0.7.0

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

Delete deletes a key-auth credential in Kong

func (*KeyAuthService) Get added in v0.7.0

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

Get fetches a key-auth credential from Kong.

func (*KeyAuthService) List added in v0.7.0

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

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

func (*KeyAuthService) ListAll added in v0.7.0

func (s *KeyAuthService) ListAll(ctx context.Context) ([]*KeyAuth, error)

ListAll fetches all key-auth credentials in Kong. This method can take a while if there a lot of key-auth credentials present.

func (*KeyAuthService) ListForConsumer added in v0.7.0

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

ListForConsumer fetches a list of key-auth credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*KeyAuthService) Update added in v0.7.0

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

Update updates a key-auth credential in Kong

type ListOpt

type ListOpt struct {
	// Size of the page
	Size int `url:"size,omitempty"`
	// Offset for the current page
	Offset string `url:"offset,omitempty"`

	// Tags to use for filtering the list.
	Tags []*string `url:"tags,omitempty"`
	// Tags are ORed by default, meaning entities
	// containing even a single tag in the list are listed.
	// If true, tags are ANDed, meaning only entities
	// matching each tag in the Tags array are listed.
	MatchAllTags bool
}

ListOpt aids in paginating through list endpoints

type MTLSAuth added in v0.12.0

type MTLSAuth struct {
	Consumer      *Consumer      `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt     *int           `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID            *string        `json:"id,omitempty" yaml:"id,omitempty"`
	SubjectName   *string        `json:"subject_name,omitempty" yaml:"subject_name,omitempty"`
	CACertificate *CACertificate `json:"ca_certificate,omitempty" yaml:"ca_certificate,omitempty"`
	Tags          []*string      `json:"tags,omitempty" yaml:"tags,omitempty"`
}

MTLSAuth represents a MTLS credential in Kong. +k8s:deepcopy-gen=true

func (*MTLSAuth) DeepCopy added in v0.12.0

func (in *MTLSAuth) DeepCopy() *MTLSAuth

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

func (*MTLSAuth) DeepCopyInto added in v0.12.0

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

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

type MTLSAuthService added in v0.12.0

type MTLSAuthService service

MTLSAuthService handles MTLS credentials in Kong.

func (*MTLSAuthService) Create added in v0.12.0

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

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

func (*MTLSAuthService) Delete added in v0.12.0

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

Delete deletes an MTLS credential in Kong

func (*MTLSAuthService) Get added in v0.12.0

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

Get fetches an MTLS credential from Kong.

func (*MTLSAuthService) List added in v0.12.0

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

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

func (*MTLSAuthService) ListAll added in v0.12.0

func (s *MTLSAuthService) ListAll(ctx context.Context) ([]*MTLSAuth, error)

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

func (*MTLSAuthService) ListForConsumer added in v0.12.0

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

ListForConsumer fetches a list of mtls credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*MTLSAuthService) Update added in v0.12.0

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

Update updates an MTLS credential in Kong

type Oauth2Credential added in v0.8.0

type Oauth2Credential struct {
	Consumer     *Consumer `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	CreatedAt    *int      `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID           *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Name         *string   `json:"name,omitempty" yaml:"name,omitempty"`
	ClientID     *string   `json:"client_id,omitempty" yaml:"client_id,omitempty"`
	ClientSecret *string   `json:"client_secret,omitempty" yaml:"client_secret,omitempty"`
	RedirectURIs []*string `json:"redirect_uris,omitempty" yaml:"redirect_uris,omitempty"`
	Tags         []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Oauth2Credential represents a Oauth2 credential in Kong. +k8s:deepcopy-gen=true

func (*Oauth2Credential) DeepCopy added in v0.8.0

func (in *Oauth2Credential) DeepCopy() *Oauth2Credential

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

func (*Oauth2Credential) DeepCopyInto added in v0.8.0

func (in *Oauth2Credential) DeepCopyInto(out *Oauth2Credential)

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

type Oauth2Service added in v0.8.0

type Oauth2Service service

Oauth2Service handles oauth2 credentials in Kong.

func (*Oauth2Service) Create added in v0.8.0

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

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

func (*Oauth2Service) Delete added in v0.8.0

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

Delete deletes an oauth2 credential in Kong.

func (*Oauth2Service) Get added in v0.8.0

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

Get fetches an oauth2 credential from Kong.

func (*Oauth2Service) List added in v0.8.0

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

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

func (*Oauth2Service) ListAll added in v0.8.0

func (s *Oauth2Service) ListAll(
	ctx context.Context) ([]*Oauth2Credential, error)

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

func (*Oauth2Service) ListForConsumer added in v0.8.0

func (s *Oauth2Service) ListForConsumer(ctx context.Context,
	consumerUsernameOrID *string, opt *ListOpt) ([]*Oauth2Credential,
	*ListOpt, error)

ListForConsumer fetches a list of oauth2 credentials in Kong associated with a specific consumer. opt can be used to control pagination.

func (*Oauth2Service) Update added in v0.8.0

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

Update updates an oauth2 credential in Kong.

type PassiveHealthcheck

type PassiveHealthcheck struct {
	Healthy   *Healthy   `json:"healthy,omitempty" yaml:"healthy,omitempty"`
	Type      *string    `json:"type,omitempty" yaml:"type,omitempty"`
	Unhealthy *Unhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
}

PassiveHealthcheck configures passive checks around passive health checks. +k8s:deepcopy-gen=true

func (*PassiveHealthcheck) DeepCopy

func (in *PassiveHealthcheck) DeepCopy() *PassiveHealthcheck

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

func (*PassiveHealthcheck) DeepCopyInto

func (in *PassiveHealthcheck) DeepCopyInto(out *PassiveHealthcheck)

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

type Plugin

type Plugin struct {
	CreatedAt *int          `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string       `json:"id,omitempty" yaml:"id,omitempty"`
	Name      *string       `json:"name,omitempty" yaml:"name,omitempty"`
	Route     *Route        `json:"route,omitempty" yaml:"route,omitempty"`
	Service   *Service      `json:"service,omitempty" yaml:"service,omitempty"`
	Consumer  *Consumer     `json:"consumer,omitempty" yaml:"consumer,omitempty"`
	Config    Configuration `json:"config,omitempty" yaml:"config,omitempty"`
	Enabled   *bool         `json:"enabled,omitempty" yaml:"enabled,omitempty"`
	RunOn     *string       `json:"run_on,omitempty" yaml:"run_on,omitempty"`
	Protocols []*string     `json:"protocols,omitempty" yaml:"protocols,omitempty"`
	Tags      []*string     `json:"tags,omitempty" yaml:"tags,omitempty"`
}

Plugin represents a Plugin in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Plugin-object +k8s:deepcopy-gen=true

func (*Plugin) DeepCopy

func (in *Plugin) DeepCopy() *Plugin

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

func (*Plugin) DeepCopyInto

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

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

type PluginService

type PluginService service

PluginService handles Plugins in Kong.

func (*PluginService) Create

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

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

func (*PluginService) Delete

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

Delete deletes a Plugin in Kong

func (*PluginService) Get

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

Get fetches a Plugin in Kong.

func (*PluginService) List

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

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

func (*PluginService) ListAll

func (s *PluginService) ListAll(ctx context.Context) ([]*Plugin, error)

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

func (*PluginService) ListAllForConsumer

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

ListAllForConsumer fetches all Plugins in Kong enabled for a consumer.

func (*PluginService) ListAllForRoute

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

ListAllForRoute fetches all Plugins in Kong enabled for a service.

func (*PluginService) ListAllForService

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

ListAllForService fetches all Plugins in Kong enabled for a service.

func (*PluginService) Update

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

Update updates a Plugin in Kong

type Response

type Response struct {
	*http.Response
}

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

type Route

type Route struct {
	CreatedAt     *int                `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Hosts         []*string           `json:"hosts,omitempty" yaml:"hosts,omitempty"`
	Headers       map[string][]string `json:"headers,omitempty" yaml:"headers,omitempty"`
	ID            *string             `json:"id,omitempty" yaml:"id,omitempty"`
	Name          *string             `json:"name,omitempty" yaml:"name,omitempty"`
	Methods       []*string           `json:"methods,omitempty" yaml:"methods,omitempty"`
	Paths         []*string           `json:"paths,omitempty" yaml:"paths,omitempty"`
	PathHandling  *string             `json:"path_handling,omitempty" yaml:"path_handling,omitempty"`
	PreserveHost  *bool               `json:"preserve_host,omitempty" yaml:"preserve_host,omitempty"`
	Protocols     []*string           `json:"protocols,omitempty" yaml:"protocols,omitempty"`
	RegexPriority *int                `json:"regex_priority,omitempty" yaml:"regex_priority,omitempty"`
	Service       *Service            `json:"service,omitempty" yaml:"service,omitempty"`
	StripPath     *bool               `json:"strip_path,omitempty" yaml:"strip_path,omitempty"`
	UpdatedAt     *int                `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	SNIs          []*string           `json:"snis,omitempty" yaml:"snis,omitempty"`
	Sources       []*CIDRPort         `json:"sources,omitempty" yaml:"sources,omitempty"`
	Destinations  []*CIDRPort         `json:"destinations,omitempty" yaml:"destinations,omitempty"`
	Tags          []*string           `json:"tags,omitempty" yaml:"tags,omitempty"`

	HTTPSRedirectStatusCode *int `json:"https_redirect_status_code,omitempty" yaml:"https_redirect_status_code,omitempty"`
}

Route represents a Route in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Route-object +k8s:deepcopy-gen=true

func (*Route) DeepCopy

func (in *Route) DeepCopy() *Route

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

func (*Route) DeepCopyInto

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

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

type RouteService

type RouteService service

RouteService handles routes in Kong.

func (*RouteService) Create

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

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

func (*RouteService) CreateInService

func (s *RouteService) CreateInService(ctx context.Context,
	serviceID *string, route *Route) (*Route, error)

CreateInService creates a route associated with serviceID

func (*RouteService) Delete

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

Delete deletes a Route in Kong

func (*RouteService) Get

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

Get fetches a Route in Kong.

func (*RouteService) List

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

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

func (*RouteService) ListAll

func (s *RouteService) ListAll(ctx context.Context) ([]*Route, error)

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

func (*RouteService) ListForService

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

ListForService fetches a list of Routes in Kong associated with a service. opt can be used to control pagination.

func (*RouteService) Update

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

Update updates a Route in Kong

type SNI

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

SNI represents a SNI in Kong. Read https://getkong.org/docs/0.14.x/admin-api/#sni-object +k8s:deepcopy-gen=true

func (*SNI) DeepCopy

func (in *SNI) DeepCopy() *SNI

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

func (*SNI) DeepCopyInto

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

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

type SNIService

type SNIService service

SNIService handles SNIs in Kong.

func (*SNIService) Create

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

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

func (*SNIService) Delete

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

Delete deletes a SNI in Kong

func (*SNIService) Get

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

Get fetches a SNI in Kong.

func (*SNIService) List

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

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

func (*SNIService) ListAll

func (s *SNIService) ListAll(ctx context.Context) ([]*SNI, error)

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

func (*SNIService) ListForCertificate

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

ListForCertificate fetches a list of SNIs in Kong associated with certificateID. opt can be used to control pagination.

func (*SNIService) Update

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

Update updates a SNI in Kong

type Service

type Service struct {
	ClientCertificate *Certificate `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty"`
	ConnectTimeout    *int         `json:"connect_timeout,omitempty" yaml:"connect_timeout,omitempty"`
	CreatedAt         *int         `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	Host              *string      `json:"host,omitempty" yaml:"host,omitempty"`
	ID                *string      `json:"id,omitempty" yaml:"id,omitempty"`
	Name              *string      `json:"name,omitempty" yaml:"name,omitempty"`
	Path              *string      `json:"path,omitempty" yaml:"path,omitempty"`
	Port              *int         `json:"port,omitempty" yaml:"port,omitempty"`
	Protocol          *string      `json:"protocol,omitempty" yaml:"protocol,omitempty"`
	ReadTimeout       *int         `json:"read_timeout,omitempty" yaml:"read_timeout,omitempty"`
	Retries           *int         `json:"retries,omitempty" yaml:"retries,omitempty"`
	UpdatedAt         *int         `json:"updated_at,omitempty" yaml:"updated_at,omitempty"`
	WriteTimeout      *int         `json:"write_timeout,omitempty" yaml:"write_timeout,omitempty"`
	Tags              []*string    `json:"tags,omitempty" yaml:"tags,omitempty"`
	TLSVerify         *bool        `json:"tls_verify,omitempty" yaml:"tls_verify,omitempty"`
	TLSVerifyDepth    *int         `json:"tls_verify_depth,omitempty" yaml:"tls_verify_depth,omitempty"`
	CACertificates    []*string    `json:"ca_certificates,omitempty" yaml:"ca_certificates,omitempty"`
}

Service represents a Service in Kong. Read https://getkong.org/docs/0.13.x/admin-api/#Service-object +k8s:deepcopy-gen=true

func (*Service) DeepCopy

func (in *Service) DeepCopy() *Service

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

func (*Service) DeepCopyInto

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

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

type Status

type Status struct {
	Database struct {
		Reachable bool `json:"reachable"`
	} `json:"database"`
	Server struct {
		ConnectionsAccepted int `json:"connections_accepted"`
		ConnectionsActive   int `json:"connections_active"`
		ConnectionsHandled  int `json:"connections_handled"`
		ConnectionsReading  int `json:"connections_reading"`
		ConnectionsWaiting  int `json:"connections_waiting"`
		ConnectionsWriting  int `json:"connections_writing"`
		TotalRequests       int `json:"total_requests"`
	} `json:"server"`
}

Status respresents current status of a Kong node.

type Svcservice

type Svcservice service

Svcservice handles services in Kong.

func (*Svcservice) Create

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

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

func (*Svcservice) Delete

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

Delete deletes an Service in Kong

func (*Svcservice) Get

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

Get fetches an Service in Kong.

func (*Svcservice) GetForRoute

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

GetForRoute fetches a Service associated with routeID in Kong.

func (*Svcservice) List

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

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

func (*Svcservice) ListAll

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

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

func (*Svcservice) Update

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

Update updates an Service in Kong

type Target

type Target struct {
	CreatedAt *float64  `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string   `json:"id,omitempty" yaml:"id,omitempty"`
	Target    *string   `json:"target,omitempty" yaml:"target,omitempty"`
	Upstream  *Upstream `json:"upstream,omitempty" yaml:"upstream,omitempty"`
	Weight    *int      `json:"weight,omitempty" yaml:"weight,omitempty"`
	Tags      []*string `json:"tags,omitempty" yaml:"tags,omitempty"`
}

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

func (*Target) DeepCopy

func (in *Target) DeepCopy() *Target

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

func (*Target) DeepCopyInto

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

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

type TargetService

type TargetService service

TargetService handles Targets in Kong.

func (*TargetService) Create

func (s *TargetService) Create(ctx context.Context,
	upstreamNameOrID *string, target *Target) (*Target, error)

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

func (*TargetService) Delete

func (s *TargetService) Delete(ctx context.Context,
	upstreamNameOrID *string, targetOrID *string) error

Delete deletes a Target in Kong

func (*TargetService) List

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

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

func (*TargetService) ListAll

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

ListAll fetches all Targets in Kong for an upstream.

func (*TargetService) MarkHealthy

func (s *TargetService) MarkHealthy(ctx context.Context,
	upstreamNameOrID *string, target *Target) error

MarkHealthy marks target belonging to upstreamNameOrID as healthy in Kong's load balancer.

func (*TargetService) MarkUnhealthy

func (s *TargetService) MarkUnhealthy(ctx context.Context,
	upstreamNameOrID *string, target *Target) error

MarkUnhealthy marks target belonging to upstreamNameOrID as unhealthy in Kong's load balancer.

type Unhealthy

type Unhealthy struct {
	HTTPFailures *int  `json:"http_failures,omitempty" yaml:"http_failures,omitempty"`
	HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
	TCPFailures  *int  `json:"tcp_failures,omitempty" yaml:"tcp_failures,omitempty"`
	Timeouts     *int  `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
	Interval     *int  `json:"interval,omitempty" yaml:"interval,omitempty"`
}

Unhealthy configures thresholds and HTTP status codes to mark targets unhealthy. +k8s:deepcopy-gen=true

func (*Unhealthy) DeepCopy

func (in *Unhealthy) DeepCopy() *Unhealthy

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

func (*Unhealthy) DeepCopyInto

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

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

type Upstream

type Upstream struct {
	ID                 *string      `json:"id,omitempty" yaml:"id,omitempty"`
	Name               *string      `json:"name,omitempty" yaml:"name,omitempty"`
	HostHeader         *string      `json:"host_header,omitempty" yaml:"host_header,omitempty"`
	ClientCertificate  *Certificate `json:"client_certificate,omitempty" yaml:"client_certificate,omitempty"`
	Algorithm          *string      `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	Slots              *int         `json:"slots,omitempty" yaml:"slots,omitempty"`
	Healthchecks       *Healthcheck `json:"healthchecks,omitempty" yaml:"healthchecks,omitempty"`
	CreatedAt          *int64       `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	HashOn             *string      `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
	HashFallback       *string      `json:"hash_fallback,omitempty" yaml:"hash_fallback,omitempty"`
	HashOnHeader       *string      `json:"hash_on_header,omitempty" yaml:"hash_on_header,omitempty"`
	HashFallbackHeader *string      `json:"hash_fallback_header,omitempty" yaml:"hash_fallback_header,omitempty"`
	HashOnCookie       *string      `json:"hash_on_cookie,omitempty" yaml:"hash_on_cookie,omitempty"`
	HashOnCookiePath   *string      `json:"hash_on_cookie_path,omitempty" yaml:"hash_on_cookie_path,omitempty"`
	Tags               []*string    `json:"tags,omitempty" yaml:"tags,omitempty"`
}

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

func (*Upstream) DeepCopy

func (in *Upstream) DeepCopy() *Upstream

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

func (*Upstream) DeepCopyInto

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

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

type UpstreamService

type UpstreamService service

UpstreamService handles Upstreams in Kong.

func (*UpstreamService) Create

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

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

func (*UpstreamService) Delete

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

Delete deletes a Upstream in Kong

func (*UpstreamService) Get

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

Get fetches a Upstream in Kong.

func (*UpstreamService) List

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

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

func (*UpstreamService) ListAll

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

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

func (*UpstreamService) Update

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

Update updates a Upstream in Kong

type Workspace added in v0.12.0

type Workspace struct {
	CreatedAt *int                   `json:"created_at,omitempty" yaml:"created_at,omitempty"`
	ID        *string                `json:"id,omitempty" yaml:"id,omitempty"`
	Name      *string                `json:"name,omitempty" yaml:"name,omitempty"`
	Comment   *string                `json:"comment,omitempty" yaml:"comment,omitempty"`
	Config    map[string]interface{} `json:"config,omitempty" yaml:"config,omitempty"`
	Meta      map[string]interface{} `json:"meta,omitempty" yaml:"meta,omitempty"`
}

Workspace represents a Workspace in Kong.

type WorkspaceService added in v0.12.0

type WorkspaceService service

WorkspaceService handles Workspaces in Kong.

func (*WorkspaceService) Create added in v0.12.0

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

Create creates a Workspace in Kong.

func (*WorkspaceService) Delete added in v0.12.0

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

Delete deletes a Workspace in Kong

func (*WorkspaceService) Get added in v0.12.0

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

Get fetches a Workspace in Kong.

func (*WorkspaceService) List added in v0.12.0

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

List fetches a list of all Workspaces in Kong.

func (*WorkspaceService) ListAll added in v0.12.0

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

ListAll fetches all workspaces in Kong.

func (*WorkspaceService) Update added in v0.12.0

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

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

Directories

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

Jump to

Keyboard shortcuts

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