v1

package
v1.8.2 Latest Latest
Warning

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

Go to latest
Published: Apr 22, 2024 License: Apache-2.0 Imports: 9 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"
	// SchemeHTTPS represents the HTTPS protocol.
	SchemeHTTPS = "https"
	// SchemeGRPCS represents the GRPCS protocol.
	SchemeGRPCS = "grpcs"
	// SchemeTCP represents the TCP protocol.
	SchemeTCP = "tcp"
	// SchemeUDP represents the UDP protocol.
	SchemeUDP = "udp"

	// 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

	// PassHostPass represents pass option for pass_host Upstream settings.
	PassHostPass = "pass"
	// PassHostPass represents node option for pass_host Upstream settings.
	PassHostNode = "node"
	// PassHostPass represents rewrite option for pass_host Upstream settings.
	PassHostRewrite = "rewrite"
)

Variables

View Source
var ValidSchemes map[string]struct{} = map[string]struct{}{
	SchemeHTTP:  {},
	SchemeHTTPS: {},
	SchemeGRPC:  {},
	SchemeGRPCS: {},
}

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 ComposeExternalUpstreamName added in v1.7.0

func ComposeExternalUpstreamName(namespace, name string) string

ComposeExternalUpstreamName uses ApisixUpstream namespace, name to compose the upstream name.

func ComposeGlobalRuleName added in v1.7.0

func ComposeGlobalRuleName(namespace, name string) string

ComposeGlobalRuleName uses namespace, name to compose the global_rule name.

func ComposePluginConfigName added in v1.4.0

func ComposePluginConfigName(namespace, name string) string

ComposePluginConfigName uses namespace, name to compose the plugin_config 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, resolveGranularity string) string

ComposeUpstreamName uses namespace, name, subset (optional), port, resolveGranularity info to compose the upstream name. the resolveGranularity is not composited in the upstream name when it is endpoint.

Types

type BasicAuthConfig added in v1.7.0

type BasicAuthConfig struct {
}

BasicAuthConfig is the rule config for basic-auth plugin. +k8s:deepcopy-gen=true

func (*BasicAuthConfig) DeepCopy added in v1.7.0

func (in *BasicAuthConfig) DeepCopy() *BasicAuthConfig

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

func (*BasicAuthConfig) DeepCopyInto added in v1.7.0

func (in *BasicAuthConfig) DeepCopyInto(out *BasicAuthConfig)

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

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 CSRFConfig added in v1.7.0

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

CSRfConfig is the rule config for csrf plugin. +k8s:deepcopy-gen=true

func (*CSRFConfig) DeepCopy added in v1.7.0

func (in *CSRFConfig) DeepCopy() *CSRFConfig

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

func (*CSRFConfig) DeepCopyInto added in v1.7.0

func (in *CSRFConfig) DeepCopyInto(out *CSRFConfig)

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

type ClientTLS added in v1.4.0

type ClientTLS struct {
	Cert string `json:"client_cert,omitempty" yaml:"client_cert,omitempty"`
	Key  string `json:"client_key,omitempty" yaml:"client_key,omitempty"`
}

ClientTLS is tls cert and key use in mTLS

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 ForwardAuthConfig added in v1.7.0

type ForwardAuthConfig struct {
	URI             string   `json:"uri"`
	SSLVerify       bool     `json:"ssl_verify"`
	RequestHeaders  []string `json:"request_headers,omitempty"`
	UpstreamHeaders []string `json:"upstream_headers,omitempty"`
	ClientHeaders   []string `json:"client_headers,omitempty"`
}

ForwardAuthConfig is the rule config for forward-auth plugin. +k8s:deepcopy-gen=true

func (*ForwardAuthConfig) DeepCopy added in v1.7.0

func (in *ForwardAuthConfig) DeepCopy() *ForwardAuthConfig

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

func (*ForwardAuthConfig) DeepCopyInto added in v1.7.0

func (in *ForwardAuthConfig) DeepCopyInto(out *ForwardAuthConfig)

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" yaml:"id"`
	Plugins Plugins `json:"plugins" yaml:"plugins"`
}

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

func NewDefaultGlobalRule added in v1.7.0

func NewDefaultGlobalRule() *GlobalRule

NewDefaultGlobalRule returns an empty PluginConfig with default values.

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 HMACAuthConsumerConfig added in v1.7.0

type HMACAuthConsumerConfig struct {
	AccessKey           string   `json:"access_key" yaml:"access_key"`
	SecretKey           string   `json:"secret_key" yaml:"secret_key"`
	Algorithm           string   `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	ClockSkew           int64    `json:"clock_skew,omitempty" yaml:"clock_skew,omitempty"`
	SignedHeaders       []string `json:"signed_headers,omitempty" yaml:"signed_headers,omitempty"`
	KeepHeaders         bool     `json:"keep_headers,omitempty" yaml:"keep_headers,omitempty"`
	EncodeURIParams     bool     `json:"encode_uri_params,omitempty" yaml:"encode_uri_params,omitempty"`
	ValidateRequestBody bool     `json:"validate_request_body,omitempty" yaml:"validate_request_body,omitempty"`
	MaxReqBody          int64    `json:"max_req_body,omitempty" yaml:"max_req_body,omitempty"`
}

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

func (*HMACAuthConsumerConfig) DeepCopy added in v1.7.0

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

func (*HMACAuthConsumerConfig) DeepCopyInto added in v1.7.0

func (in *HMACAuthConsumerConfig) DeepCopyInto(out *HMACAuthConsumerConfig)

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

type Headers added in v1.7.0

type Headers map[string]any

func (*Headers) Add added in v1.7.0

func (p *Headers) Add(headersToAdd []string)

func (*Headers) DeepCopy added in v1.7.0

func (p *Headers) DeepCopy() *Headers

func (*Headers) DeepCopyInto added in v1.7.0

func (p *Headers) DeepCopyInto(out *Headers)

func (*Headers) GetAddedHeaders added in v1.7.0

func (p *Headers) GetAddedHeaders() []string

func (*Headers) GetRemovedHeaders added in v1.7.0

func (p *Headers) GetRemovedHeaders() []string

func (*Headers) GetSetHeaders added in v1.7.0

func (p *Headers) GetSetHeaders() map[string]string

func (*Headers) Remove added in v1.7.0

func (p *Headers) Remove(headersToRemove []string)

func (*Headers) Set added in v1.7.0

func (p *Headers) Set(headersToSet []string)

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 JwtAuthConsumerConfig added in v1.7.0

type JwtAuthConsumerConfig struct {
	Key                 string `json:"key" yaml:"key"`
	Secret              string `json:"secret,omitempty" yaml:"secret,omitempty"`
	PublicKey           string `json:"public_key,omitempty" yaml:"public_key,omitempty"`
	PrivateKey          string `json:"private_key" yaml:"private_key,omitempty"`
	Algorithm           string `json:"algorithm,omitempty" yaml:"algorithm,omitempty"`
	Exp                 int64  `json:"exp,omitempty" yaml:"exp,omitempty"`
	Base64Secret        bool   `json:"base64_secret,omitempty" yaml:"base64_secret,omitempty"`
	LifetimeGracePeriod int64  `json:"lifetime_grace_period,omitempty" yaml:"lifetime_grace_period,omitempty"`
}

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

func (*JwtAuthConsumerConfig) DeepCopy added in v1.7.0

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

func (*JwtAuthConsumerConfig) DeepCopyInto added in v1.7.0

func (in *JwtAuthConsumerConfig) DeepCopyInto(out *JwtAuthConsumerConfig)

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

type KeyAuthConfig added in v1.7.0

type KeyAuthConfig struct {
}

KeyAuthConfig is the rule config for key-auth plugin. +k8s:deepcopy-gen=true

func (*KeyAuthConfig) DeepCopy added in v1.7.0

func (in *KeyAuthConfig) DeepCopy() *KeyAuthConfig

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

func (*KeyAuthConfig) DeepCopyInto added in v1.7.0

func (in *KeyAuthConfig) DeepCopyInto(out *KeyAuthConfig)

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 LDAPAuthConsumerConfig added in v1.7.0

type LDAPAuthConsumerConfig struct {
	UserDN string `json:"user_dn"`
}

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

func (*LDAPAuthConsumerConfig) DeepCopy added in v1.7.0

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

func (*LDAPAuthConsumerConfig) DeepCopyInto added in v1.7.0

func (in *LDAPAuthConsumerConfig) DeepCopyInto(out *LDAPAuthConsumerConfig)

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

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"`
	SkipMTLSUriRegex []string `json:"skip_mtls_uri_regex,omitempty" yaml:"skip_mtls_uri_regex, 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 PluginConfig added in v1.4.0

type PluginConfig struct {
	Metadata `json:",inline" yaml:",inline"`
	Plugins  Plugins `json:"plugins" yaml:"plugins"`
}

PluginConfig apisix plugin object +k8s:deepcopy-gen=true

func NewDefaultPluginConfig added in v1.4.0

func NewDefaultPluginConfig() *PluginConfig

NewDefaultPluginConfig returns an empty PluginConfig with default values.

func (*PluginConfig) DeepCopy added in v1.4.0

func (in *PluginConfig) DeepCopy() *PluginConfig

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

func (*PluginConfig) DeepCopyInto added in v1.4.0

func (in *PluginConfig) DeepCopyInto(out *PluginConfig)

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

type PluginMetadata added in v1.7.0

type PluginMetadata struct {
	Name     string
	Metadata map[string]any
}

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"`
	URI         string `json:"uri,omitempty"`
	RetCode     int    `json:"ret_code,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 RequestMirror added in v1.7.0

type RequestMirror struct {
	Host string `json:"host"`
}

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

func (*RequestMirror) DeepCopy added in v1.7.0

func (in *RequestMirror) DeepCopy() *RequestMirror

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

func (*RequestMirror) DeepCopyInto added in v1.7.0

func (in *RequestMirror) DeepCopyInto(out *RequestMirror)

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

type ResponseRewriteConfig added in v1.7.0

type ResponseRewriteConfig struct {
	StatusCode   int                 `json:"status_code,omitempty"`
	Body         string              `json:"body,omitempty"`
	BodyBase64   bool                `json:"body_base64,omitempty"`
	Headers      Headers             `json:"headers,omitempty"`
	LuaRestyExpr []expr.Expr         `json:"vars,omitempty"`
	Filters      []map[string]string `json:"filters,omitempty"`
}

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

func (*ResponseRewriteConfig) DeepCopy added in v1.7.0

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

func (*ResponseRewriteConfig) DeepCopyInto added in v1.7.0

func (in *ResponseRewriteConfig) DeepCopyInto(out *ResponseRewriteConfig)

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"`
	Headers            Headers  `json:"headers,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"`
	Timeout         *UpstreamTimeout `json:"timeout,omitempty" yaml:"timeout,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"`
	PluginConfigId  string           `json:"plugin_config_id,omitempty" yaml:"plugin_config_id,omitempty"`
	FilterFunc      string           `json:"filter_func,omitempty" yaml:"filter_func,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"`
	SNI        string            `json:"sni,omitempty" yaml:"sni,omitempty"`
	UpstreamId string            `json:"upstream_id,omitempty" yaml:"upstream_id,omitempty"`
	Upstream   *Upstream         `json:"upstream,omitempty" yaml:"upstream,omitempty"`
	Plugins    Plugins           `json:"plugins,omitempty" yaml:"plugins,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"`
	TLS          *ClientTLS           `json:"tls,omitempty" yaml:"tls,omitempty"`
	PassHost     string               `json:"pass_host,omitempty" yaml:"pass_host,omitempty"`
	UpstreamHost string               `json:"upstream_host,omitempty" yaml:"upstream_host,omitempty"`

	// for Service Discovery
	ServiceName   string            `json:"service_name,omitempty" yaml:"service_name,omitempty"`
	DiscoveryType string            `json:"discovery_type,omitempty" yaml:"discovery_type,omitempty"`
	DiscoveryArgs map[string]string `json:"discovery_args,omitempty" yaml:"discovery_args,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.

func (Upstream) MarshalJSON added in v1.7.0

func (up Upstream) MarshalJSON() ([]byte, error)

MarshalJSON is used to implement custom json.MarshalJSON

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     int   `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 UpstreamServiceRelation added in v1.7.0

type UpstreamServiceRelation struct {
	ServiceName   string              `json:"service_name" yaml:"service_name"`
	UpstreamNames map[string]struct{} `json:"upstream_name,omitempty" yaml:"upstream_name,omitempty"`
}

UpstreamServiceRelation Upstream association object +k8s:deepcopy-gen=true

func (*UpstreamServiceRelation) DeepCopy added in v1.7.0

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

func (*UpstreamServiceRelation) DeepCopyInto added in v1.7.0

func (in *UpstreamServiceRelation) DeepCopyInto(out *UpstreamServiceRelation)

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.

type WolfRBACConsumerConfig added in v1.7.0

type WolfRBACConsumerConfig struct {
	Server       string `json:"server,omitempty"`
	Appid        string `json:"appid,omitempty"`
	HeaderPrefix string `json:"header_prefix,omitempty"`
}

WolfRBACConsumerConfig is the rule config for wolf-rbac plugin used in Consumer object. +k8s:deepcopy-gen=true

func (*WolfRBACConsumerConfig) DeepCopy added in v1.7.0

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

func (*WolfRBACConsumerConfig) DeepCopyInto added in v1.7.0

func (in *WolfRBACConsumerConfig) DeepCopyInto(out *WolfRBACConsumerConfig)

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

Jump to

Keyboard shortcuts

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