v1

package
v1.2.0 Latest Latest
Warning

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

Go to latest
Published: Aug 14, 2021 License: Apache-2.0 Imports: 6 Imported by: 10

Documentation

Overview

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Licensed to the Apache Software Foundation (ASF) under one or more contributor license agreements. See the NOTICE file distributed with this work for additional information regarding copyright ownership. The ASF licenses this file to You under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

Index

Constants

View Source
const (
	// HashOnVars means the hash scope is variable.
	HashOnVars = "vars"
	// HashOnVarsCombination means the hash scope is the
	// variable combination.
	HashOnVarsCombination = "vars_combinations"
	// HashOnHeader means the hash scope is HTTP request
	// headers.
	HashOnHeader = "header"
	// HashOnCookie means the hash scope is HTTP Cookie.
	HashOnCookie = "cookie"
	// HashOnConsumer means the hash scope is APISIX consumer.
	HashOnConsumer = "consumer"

	// LbRoundRobin is the round robin load balancer.
	LbRoundRobin = "roundrobin"
	// LbConsistentHash is the consistent hash load balancer.
	LbConsistentHash = "chash"
	// LbEwma is the ewma load balancer.
	LbEwma = "ewma"
	// LbLeaseConn is the least connection load balancer.
	LbLeastConn = "least_conn"

	// SchemeHTTP represents the HTTP protocol.
	SchemeHTTP = "http"
	// SchemeGRPC represents the GRPC protocol.
	SchemeGRPC = "grpc"

	// HealthCheckHTTP represents the HTTP kind health check.
	HealthCheckHTTP = "http"
	// HealthCheckHTTPS represents the HTTPS kind health check.
	HealthCheckHTTPS = "https"
	// HealthCheckTCP represents the TCP kind health check.
	HealthCheckTCP = "tcp"

	// HealthCheckMaxConsecutiveNumber is the max number for
	// the consecutive success/failure in upstream health check.
	HealthCheckMaxConsecutiveNumber = 254
	// ActiveHealthCheckMinInterval is the minimum interval for
	// the active health check.
	ActiveHealthCheckMinInterval = time.Second

	// DefaultUpstreamTimeout represents the default connect,
	// read and send timeout (in seconds) with upstreams.
	DefaultUpstreamTimeout = 60
)

Variables

This section is empty.

Functions

func ComposeConsumerName added in v1.0.0

func ComposeConsumerName(namespace, name string) string

ComposeConsumerName uses namespace and name of ApisixConsumer to compose the Consumer name.

func ComposeRouteName added in v0.4.0

func ComposeRouteName(namespace, name string, rule string) string

ComposeRouteName uses namespace, name and rule name to compose the route name.

func ComposeStreamRouteName added in v1.0.0

func ComposeStreamRouteName(namespace, name string, rule string) string

ComposeStreamRouteName uses namespace, name and rule name to compose the stream_route name.

func ComposeUpstreamName added in v0.4.0

func ComposeUpstreamName(namespace, name, subset string, port int32) string

ComposeUpstreamName uses namespace, name, subset (optional) and port info to compose the upstream name.

Types

type BasicAuthConsumerConfig added in v1.0.0

type BasicAuthConsumerConfig struct {
	Username string `json:"username"`
	Password string `json:"password"`
}

BasicAuthConsumerConfig is the rule config for basic-auth plugin used in Consumer object. +k8s:deepcopy-gen=true

func (*BasicAuthConsumerConfig) DeepCopy added in v1.0.0

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

func (*BasicAuthConsumerConfig) DeepCopyInto added in v1.0.0

func (in *BasicAuthConsumerConfig) DeepCopyInto(out *BasicAuthConsumerConfig)

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

type BasicAuthRouteConfig added in v1.0.0

type BasicAuthRouteConfig struct{}

BasicAuthRouteConfig is the rule config for basic-auth plugin used in Route object. +k8s:deepcopy-gen=true

func (*BasicAuthRouteConfig) DeepCopy added in v1.0.0

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

func (*BasicAuthRouteConfig) DeepCopyInto added in v1.0.0

func (in *BasicAuthRouteConfig) DeepCopyInto(out *BasicAuthRouteConfig)

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

type Consumer added in v1.0.0

type Consumer struct {
	Username string            `json:"username" yaml:"username"`
	Desc     string            `json:"desc,omitempty" yaml:"desc,omitempty"`
	Labels   map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	Plugins  Plugins           `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

Consumer represents the consumer object in APISIX. +k8s:deepcopy-gen=true

func NewDefaultConsumer added in v1.0.0

func NewDefaultConsumer() *Consumer

NewDefaultConsumer returns an empty Consumer with default values.

func (*Consumer) DeepCopy added in v1.0.0

func (in *Consumer) DeepCopy() *Consumer

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

func (*Consumer) DeepCopyInto added in v1.0.0

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

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

type CorsConfig added in v1.0.0

type CorsConfig struct {
	AllowOrigins string `json:"allow_origins,omitempty"`
	AllowMethods string `json:"allow_methods,omitempty"`
	AllowHeaders string `json:"allow_headers,omitempty"`
}

CorsConfig is the rule config for cors plugin. +k8s:deepcopy-gen=true

func (*CorsConfig) DeepCopy added in v1.0.0

func (in *CorsConfig) DeepCopy() *CorsConfig

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

func (*CorsConfig) DeepCopyInto added in v1.0.0

func (in *CorsConfig) DeepCopyInto(out *CorsConfig)

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

type GlobalRule added in v1.0.0

type GlobalRule struct {
	ID      string  `json:"id,omitempty" yaml:"id,omitempty"`
	Plugins Plugins `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

GlobalRule represents the global_rule object in APISIX. +k8s:deepcopy-gen=true

func (*GlobalRule) DeepCopy added in v1.0.0

func (in *GlobalRule) DeepCopy() *GlobalRule

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

func (*GlobalRule) DeepCopyInto added in v1.0.0

func (in *GlobalRule) DeepCopyInto(out *GlobalRule)

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

type IPRestrictConfig added in v1.0.0

type IPRestrictConfig struct {
	Allowlist []string `json:"whitelist,omitempty"`
	Blocklist []string `json:"blacklist,omitempty"`
}

IPRestrictConfig is the rule config for ip-restriction plugin. +k8s:deepcopy-gen=true

func (*IPRestrictConfig) DeepCopy added in v1.0.0

func (in *IPRestrictConfig) DeepCopy() *IPRestrictConfig

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

func (*IPRestrictConfig) DeepCopyInto added in v1.0.0

func (in *IPRestrictConfig) DeepCopyInto(out *IPRestrictConfig)

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

type KeyAuthConsumerConfig added in v1.0.0

type KeyAuthConsumerConfig struct {
	Key string `json:"key"`
}

KeyAuthConsumerConfig is the rule config for key-auth plugin used in Consumer object. +k8s:deepcopy-gen=true

func (*KeyAuthConsumerConfig) DeepCopy added in v1.0.0

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

func (*KeyAuthConsumerConfig) DeepCopyInto added in v1.0.0

func (in *KeyAuthConsumerConfig) DeepCopyInto(out *KeyAuthConsumerConfig)

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

type KeyAuthRouteConfig added in v1.0.0

type KeyAuthRouteConfig struct {
	Header string `json:"header,omitempty"`
}

KeyAuthRouteConfig is the rule config for key-auth plugin used in Route object.

type Metadata

type Metadata struct {
	ID     string            `json:"id,omitempty" yaml:"id,omitempty"`
	Name   string            `json:"name,omitempty" yaml:"name,omitempty"`
	Desc   string            `json:"desc,omitempty" yaml:"desc,omitempty"`
	Labels map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
}

Metadata contains all meta information about resources. +k8s:deepcopy-gen=true

func (*Metadata) DeepCopy added in v1.0.0

func (in *Metadata) DeepCopy() *Metadata

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

func (*Metadata) DeepCopyInto added in v1.0.0

func (in *Metadata) DeepCopyInto(out *Metadata)

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

type MutualTLSClientConfig added in v1.0.0

type MutualTLSClientConfig struct {
	CA    string `json:"ca,omitempty" yaml:"ca,omitempty"`
	Depth int    `json:"depth,omitempty" yaml:"depth,omitempty"`
}

MutualTLSClientConfig apisix SSL client field +k8s:deepcopy-gen=true

func (*MutualTLSClientConfig) DeepCopy added in v1.0.0

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

func (*MutualTLSClientConfig) DeepCopyInto added in v1.0.0

func (in *MutualTLSClientConfig) DeepCopyInto(out *MutualTLSClientConfig)

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

type Plugins

type Plugins map[string]interface{}

func (*Plugins) DeepCopy

func (p *Plugins) DeepCopy() *Plugins

func (*Plugins) DeepCopyInto

func (p *Plugins) DeepCopyInto(out *Plugins)

type RedirectConfig added in v1.0.0

type RedirectConfig struct {
	HttpToHttps bool `json:"http_to_https,omitempty"`
}

RedirectConfig is the rule config for redirect plugin. +k8s:deepcopy-gen=true

func (*RedirectConfig) DeepCopy added in v1.0.0

func (in *RedirectConfig) DeepCopy() *RedirectConfig

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

func (*RedirectConfig) DeepCopyInto added in v1.0.0

func (in *RedirectConfig) DeepCopyInto(out *RedirectConfig)

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

type RewriteConfig added in v1.0.0

type RewriteConfig struct {
	RewriteTarget      string   `json:"uri,omitempty"`
	RewriteTargetRegex []string `json:"regex_uri,omitempty"`
}

RewriteConfig is the rule config for proxy-rewrite plugin. +k8s:deepcopy-gen=true

func (*RewriteConfig) DeepCopy added in v1.0.0

func (in *RewriteConfig) DeepCopy() *RewriteConfig

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

func (*RewriteConfig) DeepCopyInto added in v1.0.0

func (in *RewriteConfig) DeepCopyInto(out *RewriteConfig)

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

type Route

type Route struct {
	Metadata `json:",inline" yaml:",inline"`

	Host            string   `json:"host,omitempty" yaml:"host,omitempty"`
	Hosts           []string `json:"hosts,omitempty" yaml:"hosts,omitempty"`
	Uri             string   `json:"uri,omitempty" yaml:"uri,omitempty"`
	Priority        int      `json:"priority,omitempty" yaml:"priority,omitempty"`
	Vars            Vars     `json:"vars,omitempty" yaml:"vars,omitempty"`
	Uris            []string `json:"uris,omitempty" yaml:"uris,omitempty"`
	Methods         []string `json:"methods,omitempty" yaml:"methods,omitempty"`
	EnableWebsocket bool     `json:"enable_websocket,omitempty" yaml:"enable_websocket,omitempty"`
	RemoteAddrs     []string `json:"remote_addrs,omitempty" yaml:"remote_addrs,omitempty"`
	UpstreamId      string   `json:"upstream_id,omitempty" yaml:"upstream_id,omitempty"`
	Plugins         Plugins  `json:"plugins,omitempty" yaml:"plugins,omitempty"`
}

Route apisix route object +k8s:deepcopy-gen=true

func NewDefaultRoute added in v1.0.0

func NewDefaultRoute() *Route

NewDefaultRoute returns an empty Route with default values.

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 Schema added in v1.2.0

type Schema struct {
	Name    string `json:"name,omitempty" yaml:"name,omitempty"`
	Content string `json:"content,omitempty" yaml:"content,omitempty"`
}

Schema represents the schema of APISIX objects.

func (*Schema) DeepCopy added in v1.2.0

func (s *Schema) DeepCopy() *Schema

func (*Schema) DeepCopyInto added in v1.2.0

func (s *Schema) DeepCopyInto(out *Schema)

type Ssl

type Ssl struct {
	ID     string                 `json:"id,omitempty" yaml:"id,omitempty"`
	Snis   []string               `json:"snis,omitempty" yaml:"snis,omitempty"`
	Cert   string                 `json:"cert,omitempty" yaml:"cert,omitempty"`
	Key    string                 `json:"key,omitempty" yaml:"key,omitempty"`
	Status int                    `json:"status,omitempty" yaml:"status,omitempty"`
	Labels map[string]string      `json:"labels,omitempty" yaml:"labels,omitempty"`
	Client *MutualTLSClientConfig `json:"client,omitempty" yaml:"client,omitempty"`
}

Ssl apisix ssl object +k8s:deepcopy-gen=true

func (*Ssl) DeepCopy

func (in *Ssl) DeepCopy() *Ssl

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

func (*Ssl) DeepCopyInto

func (in *Ssl) DeepCopyInto(out *Ssl)

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

type StreamRoute added in v1.0.0

type StreamRoute struct {
	// TODO metadata should use Metadata type
	ID         string            `json:"id,omitempty" yaml:"id,omitempty"`
	Desc       string            `json:"desc,omitempty" yaml:"desc,omitempty"`
	Labels     map[string]string `json:"labels,omitempty" yaml:"labels,omitempty"`
	ServerPort int32             `json:"server_port,omitempty" yaml:"server_port,omitempty"`
	UpstreamId string            `json:"upstream_id,omitempty" yaml:"upstream_id,omitempty"`
	Upstream   *Upstream         `json:"upstream,omitempty" yaml:"upstream,omitempty"`
}

StreamRoute represents the stream_route object in APISIX. +k8s:deepcopy-gen=true

func NewDefaultStreamRoute added in v1.0.0

func NewDefaultStreamRoute() *StreamRoute

NewDefaultStreamRoute returns an empty StreamRoute with default values.

func (*StreamRoute) DeepCopy added in v1.0.0

func (in *StreamRoute) DeepCopy() *StreamRoute

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

func (*StreamRoute) DeepCopyInto added in v1.0.0

func (in *StreamRoute) DeepCopyInto(out *StreamRoute)

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

type StringOrSlice added in v1.0.0

type StringOrSlice struct {
	StrVal   string   `json:"-"`
	SliceVal []string `json:"-"`
}

StringOrSlice represents a string or a string slice. TODO Do not use interface{} to avoid the reflection overheads. +k8s:deepcopy-gen=true

func (*StringOrSlice) DeepCopy added in v1.0.0

func (in *StringOrSlice) DeepCopy() *StringOrSlice

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

func (*StringOrSlice) DeepCopyInto added in v1.0.0

func (in *StringOrSlice) DeepCopyInto(out *StringOrSlice)

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

func (*StringOrSlice) MarshalJSON added in v1.0.0

func (s *StringOrSlice) MarshalJSON() ([]byte, error)

func (*StringOrSlice) UnmarshalJSON added in v1.0.0

func (s *StringOrSlice) UnmarshalJSON(p []byte) error

type TrafficSplitConfig added in v1.0.0

type TrafficSplitConfig struct {
	Rules []TrafficSplitConfigRule `json:"rules"`
}

TrafficSplitConfig is the config of traffic-split plugin. +k8s:deepcopy-gen=true

func (*TrafficSplitConfig) DeepCopy added in v1.0.0

func (in *TrafficSplitConfig) DeepCopy() *TrafficSplitConfig

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

func (*TrafficSplitConfig) DeepCopyInto added in v1.0.0

func (in *TrafficSplitConfig) DeepCopyInto(out *TrafficSplitConfig)

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

type TrafficSplitConfigRule added in v1.0.0

type TrafficSplitConfigRule struct {
	WeightedUpstreams []TrafficSplitConfigRuleWeightedUpstream `json:"weighted_upstreams"`
}

TrafficSplitConfigRule is the rule config in traffic-split plugin config. +k8s:deepcopy-gen=true

func (*TrafficSplitConfigRule) DeepCopy added in v1.0.0

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

func (*TrafficSplitConfigRule) DeepCopyInto added in v1.0.0

func (in *TrafficSplitConfigRule) DeepCopyInto(out *TrafficSplitConfigRule)

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

type TrafficSplitConfigRuleWeightedUpstream added in v1.0.0

type TrafficSplitConfigRuleWeightedUpstream struct {
	UpstreamID string `json:"upstream_id,omitempty"`
	Weight     int    `json:"weight"`
}

TrafficSplitConfigRuleWeightedUpstream is the weighted upstream config in the traffic split plugin rule. +k8s:deepcopy-gen=true

func (*TrafficSplitConfigRuleWeightedUpstream) DeepCopy added in v1.0.0

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

func (*TrafficSplitConfigRuleWeightedUpstream) DeepCopyInto added in v1.0.0

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

type Upstream

type Upstream struct {
	Metadata `json:",inline" yaml:",inline"`

	Type    string               `json:"type,omitempty" yaml:"type,omitempty"`
	HashOn  string               `json:"hash_on,omitempty" yaml:"hash_on,omitempty"`
	Key     string               `json:"key,omitempty" yaml:"key,omitempty"`
	Checks  *UpstreamHealthCheck `json:"checks,omitempty" yaml:"checks,omitempty"`
	Nodes   UpstreamNodes        `json:"nodes" yaml:"nodes"`
	Scheme  string               `json:"scheme,omitempty" yaml:"scheme,omitempty"`
	Retries int                  `json:"retries,omitempty" yaml:"retries,omitempty"`
	Timeout *UpstreamTimeout     `json:"timeout,omitempty" yaml:"timeout,omitempty"`
}

Upstream is the apisix upstream definition. +k8s:deepcopy-gen=true

func NewDefaultUpstream added in v0.4.0

func NewDefaultUpstream() *Upstream

NewDefaultUpstream returns an empty Upstream with default values.

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 UpstreamActiveHealthCheck added in v0.4.0

type UpstreamActiveHealthCheck struct {
	Type               string                             `json:"type,omitempty" yaml:"type,omitempty"`
	Timeout            int                                `json:"timeout,omitempty" yaml:"timeout,omitempty"`
	Concurrency        int                                `json:"concurrency,omitempty" yaml:"concurrency,omitempty"`
	Host               string                             `json:"host,omitempty" yaml:"host,omitempty"`
	Port               int32                              `json:"port,omitempty" yaml:"port,omitempty"`
	HTTPPath           string                             `json:"http_path,omitempty" yaml:"http_path,omitempty"`
	HTTPSVerifyCert    bool                               `json:"https_verify_certificate,omitempty" yaml:"https_verify_certificate,omitempty"`
	HTTPRequestHeaders []string                           `json:"req_headers,omitempty" yaml:"req_headers,omitempty"`
	Healthy            UpstreamActiveHealthCheckHealthy   `json:"healthy,omitempty" yaml:"healthy,omitempty"`
	Unhealthy          UpstreamActiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
}

UpstreamActiveHealthCheck defines the active kind of upstream health check. +k8s:deepcopy-gen=true

func (*UpstreamActiveHealthCheck) DeepCopy added in v0.4.0

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

func (*UpstreamActiveHealthCheck) DeepCopyInto added in v0.4.0

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

type UpstreamActiveHealthCheckHealthy added in v0.4.0

type UpstreamActiveHealthCheckHealthy struct {
	UpstreamPassiveHealthCheckHealthy `json:",inline" yaml:",inline"`

	Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
}

UpstreamActiveHealthCheckHealthy defines the conditions to judge whether an upstream node is healthy with the active manner. +k8s:deepcopy-gen=true

func (*UpstreamActiveHealthCheckHealthy) DeepCopy added in v0.4.0

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

func (*UpstreamActiveHealthCheckHealthy) DeepCopyInto added in v0.4.0

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

type UpstreamActiveHealthCheckUnhealthy added in v0.4.0

type UpstreamActiveHealthCheckUnhealthy struct {
	UpstreamPassiveHealthCheckUnhealthy `json:",inline" yaml:",inline"`

	Interval int `json:"interval,omitempty" yaml:"interval,omitempty"`
}

UpstreamActiveHealthCheckUnhealthy defines the conditions to judge whether an upstream node is unhealthy with the active manager. +k8s:deepcopy-gen=true

func (*UpstreamActiveHealthCheckUnhealthy) DeepCopy added in v0.4.0

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

func (*UpstreamActiveHealthCheckUnhealthy) DeepCopyInto added in v0.4.0

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

type UpstreamHealthCheck added in v0.4.0

type UpstreamHealthCheck struct {
	Active  *UpstreamActiveHealthCheck  `json:"active" yaml:"active"`
	Passive *UpstreamPassiveHealthCheck `json:"passive,omitempty" yaml:"passive,omitempty"`
}

UpstreamHealthCheck defines the active and/or passive health check for an Upstream, with the upstream health check feature, pods can be kicked out or joined in quickly, if the feedback of Kubernetes liveness/readiness probe is long. +k8s:deepcopy-gen=true

func (*UpstreamHealthCheck) DeepCopy added in v0.4.0

func (in *UpstreamHealthCheck) DeepCopy() *UpstreamHealthCheck

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

func (*UpstreamHealthCheck) DeepCopyInto added in v0.4.0

func (in *UpstreamHealthCheck) DeepCopyInto(out *UpstreamHealthCheck)

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

type UpstreamNode added in v0.4.0

type UpstreamNode struct {
	Host   string `json:"host,omitempty" yaml:"host,omitempty"`
	Port   int    `json:"port,omitempty" yaml:"port,omitempty"`
	Weight int    `json:"weight,omitempty" yaml:"weight,omitempty"`
}

UpstreamNode is the node in upstream +k8s:deepcopy-gen=true

func (*UpstreamNode) DeepCopy added in v0.4.0

func (in *UpstreamNode) DeepCopy() *UpstreamNode

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

func (*UpstreamNode) DeepCopyInto added in v0.4.0

func (in *UpstreamNode) DeepCopyInto(out *UpstreamNode)

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

type UpstreamNodes added in v1.0.0

type UpstreamNodes []UpstreamNode

UpstreamNodes is the upstream node list.

func (*UpstreamNodes) UnmarshalJSON added in v1.0.0

func (n *UpstreamNodes) UnmarshalJSON(p []byte) error

UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.

type UpstreamPassiveHealthCheck added in v0.4.0

type UpstreamPassiveHealthCheck struct {
	Type      string                              `json:"type,omitempty" yaml:"type,omitempty"`
	Healthy   UpstreamPassiveHealthCheckHealthy   `json:"healthy,omitempty" yaml:"healthy,omitempty"`
	Unhealthy UpstreamPassiveHealthCheckUnhealthy `json:"unhealthy,omitempty" yaml:"unhealthy,omitempty"`
}

UpstreamPassiveHealthCheck defines the passive kind of upstream health check. +k8s:deepcopy-gen=true

func (*UpstreamPassiveHealthCheck) DeepCopy added in v0.4.0

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

func (*UpstreamPassiveHealthCheck) DeepCopyInto added in v0.4.0

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

type UpstreamPassiveHealthCheckHealthy added in v0.4.0

type UpstreamPassiveHealthCheckHealthy struct {
	HTTPStatuses []int `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
	Successes    int   `json:"successes,omitempty" yaml:"successes,omitempty"`
}

UpstreamPassiveHealthCheckHealthy defines the conditions to judge whether an upstream node is healthy with the passive manner. +k8s:deepcopy-gen=true

func (*UpstreamPassiveHealthCheckHealthy) DeepCopy added in v0.4.0

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

func (*UpstreamPassiveHealthCheckHealthy) DeepCopyInto added in v0.4.0

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

type UpstreamPassiveHealthCheckUnhealthy added in v0.4.0

type UpstreamPassiveHealthCheckUnhealthy struct {
	HTTPStatuses []int   `json:"http_statuses,omitempty" yaml:"http_statuses,omitempty"`
	HTTPFailures int     `json:"http_failures,omitempty" yaml:"http_failures,omitempty"`
	TCPFailures  int     `json:"tcp_failures,omitempty" yaml:"tcp_failures,omitempty"`
	Timeouts     float64 `json:"timeouts,omitempty" yaml:"timeouts,omitempty"`
}

UpstreamPassiveHealthCheckUnhealthy defines the conditions to judge whether an upstream node is unhealthy with the passive manager. +k8s:deepcopy-gen=true

func (*UpstreamPassiveHealthCheckUnhealthy) DeepCopy added in v0.4.0

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

func (*UpstreamPassiveHealthCheckUnhealthy) DeepCopyInto added in v0.4.0

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

type UpstreamTimeout added in v0.4.0

type UpstreamTimeout struct {
	// Connect is the connect timeout
	Connect int `json:"connect" yaml:"connect"`
	// Send is the send timeout
	Send int `json:"send" yaml:"send"`
	// Read is the read timeout
	Read int `json:"read" yaml:"read"`
}

UpstreamTimeout represents the timeout settings on Upstream.

type Vars added in v1.0.0

type Vars [][]StringOrSlice

Vars represents the route match expressions of APISIX.

func (*Vars) UnmarshalJSON added in v1.0.0

func (vars *Vars) UnmarshalJSON(p []byte) error

UnmarshalJSON implements json.Unmarshaler interface. lua-cjson doesn't distinguish empty array and table, and by default empty array will be encoded as '{}'. We have to maintain the compatibility.

Jump to

Keyboard shortcuts

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