v1

package
v1.8.8 Latest Latest
Warning

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

Go to latest
Published: Jun 18, 2024 License: Apache-2.0 Imports: 8 Imported by: 3

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

func ComposeConsumerName(namespace, name string) string

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

func ComposeExternalUpstreamName

func ComposeExternalUpstreamName(namespace, name string) string

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

func ComposeGlobalRuleName

func ComposeGlobalRuleName(namespace, name string) string

ComposeGlobalRuleName uses namespace, name to compose the global_rule name.

func ComposePluginConfigName

func ComposePluginConfigName(namespace, name string) string

ComposePluginConfigName uses namespace, name to compose the plugin_config name.

func ComposeRouteName

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

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

func ComposeStreamRouteName

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

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

func ComposeUpstreamName

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

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

Types

type BasicAuthConfig

type BasicAuthConfig struct {
}

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

func (*BasicAuthConfig) DeepCopy

func (in *BasicAuthConfig) DeepCopy() *BasicAuthConfig

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

func (*BasicAuthConfig) DeepCopyInto

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

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

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

func (*BasicAuthConsumerConfig) DeepCopyInto

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

type BasicAuthRouteConfig struct{}

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

func (*BasicAuthRouteConfig) DeepCopy

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

func (*BasicAuthRouteConfig) DeepCopyInto

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

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

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

func (*CSRFConfig) DeepCopy

func (in *CSRFConfig) DeepCopy() *CSRFConfig

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

func (*CSRFConfig) DeepCopyInto

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

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

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

func NewDefaultConsumer() *Consumer

NewDefaultConsumer returns an empty Consumer with default values.

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 CorsConfig

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

func (in *CorsConfig) DeepCopy() *CorsConfig

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

func (*CorsConfig) DeepCopyInto

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

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

func (in *ForwardAuthConfig) DeepCopy() *ForwardAuthConfig

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

func (*ForwardAuthConfig) DeepCopyInto

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

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

func NewDefaultGlobalRule() *GlobalRule

NewDefaultGlobalRule returns an empty PluginConfig with default values.

func (*GlobalRule) DeepCopy

func (in *GlobalRule) DeepCopy() *GlobalRule

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

func (*GlobalRule) DeepCopyInto

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

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

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

func (*HMACAuthConsumerConfig) DeepCopyInto

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

type Headers map[string]any

func (*Headers) Add

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

func (Headers) DeepCopy

func (p Headers) DeepCopy() Headers

func (*Headers) DeepCopyInto

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

func (*Headers) GetAddedHeaders

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

func (*Headers) GetRemovedHeaders

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

func (*Headers) GetSetHeaders

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

func (*Headers) Remove

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

func (*Headers) Set

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

type IPRestrictConfig

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

func (in *IPRestrictConfig) DeepCopy() *IPRestrictConfig

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

func (*IPRestrictConfig) DeepCopyInto

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

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

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

func (*JwtAuthConsumerConfig) DeepCopyInto

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

type KeyAuthConfig struct {
}

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

func (*KeyAuthConfig) DeepCopy

func (in *KeyAuthConfig) DeepCopy() *KeyAuthConfig

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

func (*KeyAuthConfig) DeepCopyInto

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

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

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

func (*KeyAuthConsumerConfig) DeepCopyInto

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

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

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

type LDAPAuthConsumerConfig

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

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

func (*LDAPAuthConsumerConfig) DeepCopyInto

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

func (in *Metadata) DeepCopy() *Metadata

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

func (*Metadata) DeepCopyInto

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

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

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

func (*MutualTLSClientConfig) DeepCopyInto

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

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

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

func NewDefaultPluginConfig

func NewDefaultPluginConfig() *PluginConfig

NewDefaultPluginConfig returns an empty PluginConfig with default values.

func (*PluginConfig) DeepCopy

func (in *PluginConfig) DeepCopy() *PluginConfig

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

func (*PluginConfig) DeepCopyInto

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

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

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

func (in *RedirectConfig) DeepCopy() *RedirectConfig

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

func (*RedirectConfig) DeepCopyInto

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

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

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

func (*RequestMirror) DeepCopy

func (in *RequestMirror) DeepCopy() *RequestMirror

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

func (*RequestMirror) DeepCopyInto

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

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

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

func (*ResponseRewriteConfig) DeepCopyInto

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

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

func (in *RewriteConfig) DeepCopy() *RewriteConfig

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

func (*RewriteConfig) DeepCopyInto

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

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

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

func (s *Schema) DeepCopy() *Schema

func (*Schema) DeepCopyInto

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

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

func NewDefaultStreamRoute() *StreamRoute

NewDefaultStreamRoute returns an empty StreamRoute with default values.

func (*StreamRoute) DeepCopy

func (in *StreamRoute) DeepCopy() *StreamRoute

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

func (*StreamRoute) DeepCopyInto

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

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

func (in *StringOrSlice) DeepCopy() *StringOrSlice

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

func (*StringOrSlice) DeepCopyInto

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

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

func (*StringOrSlice) UnmarshalJSON

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

type TrafficSplitConfig

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

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

func (*TrafficSplitConfig) DeepCopy

func (in *TrafficSplitConfig) DeepCopy() *TrafficSplitConfig

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

func (*TrafficSplitConfig) DeepCopyInto

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

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

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

func (*TrafficSplitConfigRule) DeepCopyInto

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

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

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

func (*TrafficSplitConfigRuleWeightedUpstream) DeepCopyInto

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

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

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

MarshalJSON is used to implement custom json.MarshalJSON

type UpstreamActiveHealthCheck

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

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

func (*UpstreamActiveHealthCheck) DeepCopyInto

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

type UpstreamActiveHealthCheckHealthy

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

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

func (*UpstreamActiveHealthCheckHealthy) DeepCopyInto

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

type UpstreamActiveHealthCheckUnhealthy

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

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

func (*UpstreamActiveHealthCheckUnhealthy) DeepCopyInto

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

type UpstreamHealthCheck

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

func (in *UpstreamHealthCheck) DeepCopy() *UpstreamHealthCheck

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

func (*UpstreamHealthCheck) DeepCopyInto

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

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

func (in *UpstreamNode) DeepCopy() *UpstreamNode

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

func (*UpstreamNode) DeepCopyInto

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

type UpstreamNodes []UpstreamNode

UpstreamNodes is the upstream node list.

func (*UpstreamNodes) UnmarshalJSON

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

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

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

func (*UpstreamPassiveHealthCheck) DeepCopyInto

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

type UpstreamPassiveHealthCheckHealthy

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

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

func (*UpstreamPassiveHealthCheckHealthy) DeepCopyInto

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

type UpstreamPassiveHealthCheckUnhealthy

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

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

func (*UpstreamPassiveHealthCheckUnhealthy) DeepCopyInto

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

type UpstreamServiceRelation

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

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

func (*UpstreamServiceRelation) DeepCopyInto

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

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

type Vars [][]StringOrSlice

Vars represents the route match expressions of APISIX.

func (*Vars) UnmarshalJSON

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

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

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

func (*WolfRBACConsumerConfig) DeepCopyInto

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