kong

package
v0.0.0-...-7c76caf Latest Latest
Warning

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

Go to latest
Published: Jun 22, 2023 License: MPL-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	HealthchecksTypes = []string{"http", "tcp", "https"}
)

Functions

func ImportConsumerCredential

func ImportConsumerCredential(d *schema.ResourceData, m interface{}) ([]*schema.ResourceData, error)

func Provider

func Provider() *schema.Provider

Provider returns a terraform.ResourceProvider.

Types

type ActiveHealthy

type ActiveHealthy struct {
	Successes    int   `json:"successes"`
	Interval     int   `json:"interval"`
	HttpStatuses []int `json:"http_statuses,omitempty"`
}

type ActiveUnhealthy

type ActiveUnhealthy struct {
	HttpStatuses []int `json:"http_statuses,omitempty"`
	TcpFailures  int   `json:"tcp_failures"`
	Timeouts     int   `json:"timeouts"`
	HttpFailures int   `json:"http_failures"`
	Interval     int   `json:"interval"`
}

type BasicAuthCredential

type BasicAuthCredential struct {
	ID       string   `json:"id,omitempty"`
	Username string   `json:"username,omitempty"`
	Password string   `json:"password,omitempty"`
	Consumer string   `json:"-"`
	Tags     []string `json:"tags"`
}

type CACertificate

type CACertificate struct {
	ID         string   `json:"id,omitempty"`
	Cert       string   `json:"cert,omitempty"`
	CertDigest string   `json:"cert_digest,omitempty"`
	Tags       []string `json:"tags"`
}

type Certificate

type Certificate struct {
	ID      string   `json:"id,omitempty"`
	Cert    string   `json:"cert,omitempty"`
	Key     string   `json:"key,omitempty"`
	CertAlt string   `json:"cert_alt,omitempty"`
	KeyAlt  string   `json:"key_alt,omitempty"`
	Tags    []string `json:"tags"`
}

type Config

type Config struct {
	Address  string
	Username string
	Password string
}

func (*Config) Client

func (c *Config) Client() (*sling.Sling, error)

type Consumer

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

type ConsumerACLGroup

type ConsumerACLGroup struct {
	ID       string   `json:"id,omitempty"`
	Group    string   `json:"group,omitempty"`
	Consumer string   `json:"-"`
	Tags     []string `json:"tags"`
}

type HealthChecksActive

type HealthChecksActive struct {
	HttpsVerifyCertificate bool             `json:"https_verify_certificate"`
	HttpPath               string           `json:"http_path,omitempty"`
	Timeout                int              `json:"timeout,omitempty"`
	HttpsSni               *string          `json:"https_sni,omitempty"`
	Concurrency            int              `json:"concurrency,omitempty"`
	Type                   string           `json:"type,omitempty"`
	Healthy                *ActiveHealthy   `json:"healthy,omitempty"`
	Unhealthy              *ActiveUnhealthy `json:"unhealthy,omitempty"`
}

type HealthChecksPassive

type HealthChecksPassive struct {
	Type      string            `json:"type,omitempty"`
	Healthy   *PassiveHealthy   `json:"healthy,omitempty"`
	Unhealthy *PassiveUnhealthy `json:"unhealthy,omitempty"`
}

type JWTCredential

type JWTCredential struct {
	ID           string   `json:"id,omitempty"`
	Key          string   `json:"key,omitempty"`
	Algorithm    string   `json:"algorithm,omitempty"`
	RSAPublicKey string   `json:"rsa_public_key,omitempty"`
	Secret       string   `json:"secret,omitempty"`
	Consumer     string   `json:"-"`
	Tags         []string `json:"tags"`
}

type KeyAuthCredential

type KeyAuthCredential struct {
	ID       string   `json:"id,omitempty"`
	Key      string   `json:"key,omitempty"`
	Consumer string   `json:"-"`
	TTL      int      `json:"ttl,omitempty"`
	Tags     []string `json:"tags"`
}

type PassiveHealthy

type PassiveHealthy struct {
	Successes    int   `json:"successes"`
	HttpStatuses []int `json:"http_statuses,omitempty"`
}

type PassiveUnhealthy

type PassiveUnhealthy struct {
	HttpFailures int   `json:"http_failures"`
	HttpStatuses []int `json:"http_statuses,omitempty"`
	TcpFailures  int   `json:"tcp_failures"`
	Timeouts     int   `json:"timeouts"`
}

type Plugin

type Plugin struct {
	ID            string                 `json:"id,omitempty"`
	Name          string                 `json:"name,omitempty"`
	Configuration map[string]interface{} `json:"config,omitempty"`
	Protocols     []string               `json:"protocols,omitempty"`
	Service       map[string]string      `json:"service,omitempty"`
	Route         map[string]string      `json:"route,omitempty"`
	Consumer      map[string]string      `json:"consumer,omitempty"`
	Tags          []string               `json:"tags"`
	Enabled       bool                   `json:"enabled"`
}

Plugin : Kong Service/API plugin request object structure

type Route

type Route struct {
	ID                      string              `json:"id,omitempty"`
	Name                    string              `json:"name,omitempty"`
	Protocols               []string            `json:"protocols"`
	Methods                 []string            `json:"methods"`
	Hosts                   []string            `json:"hosts"`
	Paths                   []string            `json:"paths"`
	Headers                 map[string][]string `json:"headers"`
	HttpsRedirectStatusCode int                 `json:"https_redirect_status_code,omitempty"`
	RegexPriority           int                 `json:"regex_priority"`
	StripPath               bool                `json:"strip_path,omitempty"`
	PathHandling            string              `json:"path_handling,omitempty"`
	PreserveHost            bool                `json:"preserve_host,omitempty"`
	RequestBuffering        bool                `json:"request_buffering"`
	ResponseBuffering       bool                `json:"response_buffering"`
	SNIs                    []string            `json:"snis,omitempty"`
	// Sources                 []string            `json:"sources,omitempty"`
	// Destinations            []string            `json:"destinations,omitempty"`
	Tags    []string `json:"tags"`
	Service Service  `json:"service,omitempty"`
}

Route : Kong Route request object structure

type SNI

type SNI struct {
	Name             string      `json:"name,omitempty"`
	SSLCertificateID Certificate `json:"certificate,omitempty"`
	Tags             []string    `json:"tags"`
}

type Service

type Service struct {
	ID                string      `json:"id,omitempty"`
	Name              string      `json:"name,omitempty"`
	Retries           int         `json:"retries,omitempty"`
	Protocol          string      `json:"protocol,omitempty"`
	Host              string      `json:"host,omitempty"`
	Port              int         `json:"port,omitempty"`
	Path              string      `json:"path,omitempty"`
	ConnectTimeout    int         `json:"connect_timeout,omitempty"`
	WriteTimeout      int         `json:"write_timeout,omitempty"`
	ReadTimeout       int         `json:"read_timeout,omitempty"`
	Tags              []string    `json:"tags"`
	ClientCertificate Certificate `json:"-"`                          // TO DO: add if statement which assign value only if Protocol is HTTPS
	TlsVerify         bool        `json:"tls_verify,omitempty"`       //
	TlsVerifyDepth    int         `json:"tls_verify_depth,omitempty"` //
	CACertificates    []string    `json:"-"`                          //
	Enabled           bool        `json:"enabled"`
}

Service : Kong Service request object structure

type Target

type Target struct {
	ID       string   `json:"id,omitempty"`
	Upstream string   `json:"-"`
	Target   string   `json:"target,omitempty"`
	Weight   int      `json:"weight,omitempty"`
	Tags     []string `json:"tags"`
}

type Upstream

type Upstream struct {
	ID                      string                `json:"id,omitempty"`
	Name                    string                `json:"name,omitempty"`
	Algorithm               string                `json:"algorithm,omitempty"`
	HashOn                  string                `json:"hash_on"`
	HashFallback            string                `json:"hash_fallback"`
	HashOnHeader            string                `json:"hash_on_header,omitempty"`
	HashFallbackHeader      string                `json:"hash_fallback_header,omitempty"`
	HashOnCookie            string                `json:"hash_on_cookie,omitempty"`
	HashOnCookiePath        string                `json:"hash_on_cookie_path,omitempty"`
	HashOnQueryArg          string                `json:"hash_on_query_arg,omitempty"`
	HashFallbackOnQueryArg  string                `json:"hash_fallback_query_arg,omitempty"`
	HashOnUriCapture        string                `json:"hash_on_uri_capture,omitempty"`
	HashFallbacOnUriCapture string                `json:"hash_fallback_uri_capture,omitempty"`
	Slots                   int                   `json:"slots,omitempty"`
	HealthChecks            *UpstreamHealthChecks `json:"healthchecks,omitempty"`
	Tags                    []string              `json:"tags"`
	HostHeader              string                `json:"host_header,omitempty"`
	ClientCertificate       Certificate           `json:"-"`
	UseSrvName              bool                  `json:"use_srv_name"`
}

type UpstreamHealthChecks

type UpstreamHealthChecks struct {
	Active  *HealthChecksActive  `json:"active,omitempty"`
	Passive *HealthChecksPassive `json:"passive,omitempty"`
}

Jump to

Keyboard shortcuts

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