Documentation
¶
Index ¶
- Constants
- func CapabilitySummary(cfg *Config) map[string]any
- func EffectiveConfigProvider(cfg *Config) (string, error)
- func StandaloneBuckets() []string
- func StandaloneConfigFile(provider string) string
- type Admin
- type AdminAPIMTLS
- type AdminKey
- type AdminListen
- type Apisix
- type Config
- type Control
- type DataEncryption
- type Deployment
- type Discovery
- type Etcd
- type EtcdTLS
- type Events
- type ExtPlugin
- type GraphQL
- type LRU
- type LRUCache
- type Listen
- type NginxConfig
- type NginxEvent
- type NginxHTTP
- type NginxMeta
- type NginxStream
- type NginxUpstream
- type NodeListen
- type PluginAttr
- type Proxy
- type ProxyCache
- type ProxyProtocol
- type RoleConfig
- type RoleTraditionalConfig
- type Router
- type Ssl
- type StandaloneFileWatcher
- func (w *StandaloneFileWatcher) Reload() error
- func (w *StandaloneFileWatcher) ReloadSnapshot() (StandaloneReloadResult, error)
- func (w *StandaloneFileWatcher) SeedCurrentSnapshot(snapshot map[string]map[string][]byte)
- func (w *StandaloneFileWatcher) SetAcknowledgedReloadCallback(callback func(StandaloneReloadResult, error) error)
- func (w *StandaloneFileWatcher) SetReloadCallback(callback func(StandaloneReloadResult, error))
- func (w *StandaloneFileWatcher) Start() error
- func (w *StandaloneFileWatcher) Stop() error
- func (w *StandaloneFileWatcher) Watch()
- type StandaloneReloadResult
- type Status
- type StreamProxy
- type TcpListen
- type Wasm
- type WasmPlugin
- type XRPC
- type XRPCProtocol
- type Zone
Constants ¶
const (
DefaultConfigFile = "conf/config-default.yaml"
)
const HTTPDataPlaneV1Profile = "http-data-plane-v1"
Variables ¶
This section is empty.
Functions ¶
func CapabilitySummary ¶
func EffectiveConfigProvider ¶
func StandaloneBuckets ¶
func StandaloneBuckets() []string
StandaloneBuckets returns the buckets owned by the standalone configuration file. The returned slice is independent from the package-level definition.
func StandaloneConfigFile ¶
Types ¶
type Admin ¶
type Admin struct {
AdminKeyRequired bool `mapstructure:"admin_key_required"`
AdminKey []AdminKey `mapstructure:"admin_key"`
EnableAdminCORS bool `mapstructure:"enable_admin_cors"`
EnableAdminUI bool `mapstructure:"enable_admin_ui"`
AllowAdmin []string `mapstructure:"allow_admin"`
AdminListen AdminListen `mapstructure:"admin_listen"`
HTTPSAdmin bool `mapstructure:"https_admin"`
AdminAPIMTLS AdminAPIMTLS `mapstructure:"admin_api_mtls"`
AdminAPIVersion string `mapstructure:"admin_api_version"`
}
type AdminAPIMTLS ¶
type AdminListen ¶
type Apisix ¶
type Apisix struct {
ID string `mapstructure:"id"`
NodeListen []NodeListen `mapstructure:"node_listen"`
EnableAdmin bool `mapstructure:"enable_admin"`
EnableDevMode bool `mapstructure:"enable_dev_mode"`
EnableReuseport bool `mapstructure:"enable_reuseport"`
ShowUpstreamStatusInResponseHeader bool `mapstructure:"show_upstream_status_in_response_header"`
EnableIpv6 bool `mapstructure:"enable_ipv6"`
EnableHttp2 bool `mapstructure:"enable_http2"`
EnableServerTokens bool `mapstructure:"enable_server_tokens"`
ExtraLuaPath string `mapstructure:"extra_lua_path"`
ExtraLuaCpath string `mapstructure:"extra_lua_cpath"`
LuaModuleHook string `mapstructure:"lua_module_hook"`
ProxyProtocol ProxyProtocol `mapstructure:"proxy_protocol"`
ProxyCache ProxyCache `mapstructure:"proxy_cache"`
DeleteURITailSlash bool `mapstructure:"delete_uri_tail_slash"`
NormalizeURILikeServlet bool `mapstructure:"normalize_uri_like_servlet"`
MatchURIEncodedSlash bool `mapstructure:"match_uri_encoded_slash"`
MaxPostArgsReadableSize int `mapstructure:"max_post_args_readable_size"`
Router Router `mapstructure:"router"`
ProxyMode string `mapstructure:"proxy_mode"`
StreamProxy StreamProxy `mapstructure:"stream_proxy"`
DnsResolver []string `mapstructure:"dns_resolver"`
DnsResolverValid int `mapstructure:"dns_resolver_valid"`
ResolverTimeout int `mapstructure:"resolver_timeout"`
EnableResolvSearchOpt bool `mapstructure:"enable_resolv_search_opt"`
Ssl Ssl `mapstructure:"ssl"`
EnableControl bool `mapstructure:"enable_control"`
Control Control `mapstructure:"control"`
DisableSyncConfigurationDuringStart bool `mapstructure:"disable_sync_configuration_during_start"`
WorkerStartupTimeThreshold int `mapstructure:"worker_startup_time_threshold"`
DataEncryption DataEncryption `mapstructure:"data_encryption"`
LRU LRU `mapstructure:"lru"`
Tracing bool `mapstructure:"tracing"`
Status Status `mapstructure:"status"`
DisableUpstreamHealthcheck bool `mapstructure:"disable_upstream_healthcheck"`
TrustedAddresses []string `mapstructure:"trusted_addresses"`
}
func (Apisix) ListenAddresses ¶
type Config ¶
type Config struct {
Debug bool `mapstructure:"debug"`
Apisix Apisix `mapstructure:"apisix"`
NginxConfig NginxConfig `mapstructure:"nginx_config"`
// NGINX-only directives are retained for config compatibility; the Go server
// applies the HTTP timeout settings that have direct net/http equivalents.
Proxy Proxy `mapstructure:"proxy"`
Discovery Discovery `mapstructure:"discovery"`
GraphQL GraphQL `mapstructure:"graphql"`
ExtPlugin ExtPlugin `mapstructure:"ext-plugin"`
Wasm Wasm `mapstructure:"wasm"`
XRPC XRPC `mapstructure:"xrpc"`
Events Events `mapstructure:"events"`
Plugins []string `mapstructure:"plugins"`
StreamPlugins []string `mapstructure:"stream_plugins"`
// PluginAttr PluginAttr `mapstructure:"plugin_attr"`
PluginAttr map[string]map[string]any `mapstructure:"plugin_attr"`
Deployment Deployment `mapstructure:"deployment"`
}
var GlobalConfig *Config
type DataEncryption ¶
type Deployment ¶
type Deployment struct {
// TODO: add validation here
Profile string `mapstructure:"profile"`
Role string `mapstructure:"role"`
RoleTraditional RoleTraditionalConfig `mapstructure:"role_traditional"`
RoleDataPlane RoleConfig `mapstructure:"role_data_plane"`
RoleControlPlane RoleConfig `mapstructure:"role_control_plane"`
Admin Admin `mapstructure:"admin"`
Etcd Etcd `mapstructure:"etcd"`
}
type Etcd ¶
type Etcd struct {
Host []string `mapstructure:"host"`
Prefix string `mapstructure:"prefix"`
// TODO: not support yet
Timeout int `mapstructure:"timeout"`
WatchTimeout int `mapstructure:"watch_timeout"`
ResyncDelay int `mapstructure:"resync_delay"`
HealthCheckTimeout int `mapstructure:"health_check_timeout"`
StartupRetry int `mapstructure:"startup_retry"`
User string `mapstructure:"user"`
Password string `mapstructure:"password"`
// TODO: not support yet
TLS EtcdTLS `mapstructure:"tls"`
}
type NginxConfig ¶
type NginxConfig struct {
ErrorLog string `mapstructure:"error_log"`
ErrorLogLevel string `mapstructure:"error_log_level"`
WorkerProcesses string `mapstructure:"worker_processes"`
EnableCPUAffinity bool `mapstructure:"enable_cpu_affinity"`
WorkerRlimitNofile int `mapstructure:"worker_rlimit_nofile"`
WorkerShutdownTimeout time.Duration `mapstructure:"worker_shutdown_timeout"`
MaxPendingTimers int `mapstructure:"max_pending_timers"`
MaxRunningTimers int `mapstructure:"max_running_timers"`
Event NginxEvent `mapstructure:"event"`
Meta NginxMeta `mapstructure:"meta"`
Stream NginxStream `mapstructure:"stream"`
MainConfigurationSnippet string `mapstructure:"main_configuration_snippet"`
HTTPConfigurationSnippet string `mapstructure:"http_configuration_snippet"`
HTTPServerConfigurationSnippet string `mapstructure:"http_server_configuration_snippet"`
HTTPServerLocationConfigurationSnippet string `mapstructure:"http_server_location_configuration_snippet"`
HTTPAdminConfigurationSnippet string `mapstructure:"http_admin_configuration_snippet"`
HTTPEndConfigurationSnippet string `mapstructure:"http_end_configuration_snippet"`
StreamConfigurationSnippet string `mapstructure:"stream_configuration_snippet"`
HTTP NginxHTTP `mapstructure:"http"`
}
type NginxEvent ¶
type NginxEvent struct {
WorkerConnections int `mapstructure:"worker_connections"`
}
type NginxHTTP ¶
type NginxHTTP struct {
EnableAccessLog bool `mapstructure:"enable_access_log"`
AccessLog string `mapstructure:"access_log"`
AccessLogBuffer int `mapstructure:"access_log_buffer"`
AccessLogFormat string `mapstructure:"access_log_format"`
AccessLogFormatEscape string `mapstructure:"access_log_format_escape"`
KeepaliveTimeout time.Duration `mapstructure:"keepalive_timeout"`
ClientHeaderTimeout time.Duration `mapstructure:"client_header_timeout"`
ClientBodyTimeout time.Duration `mapstructure:"client_body_timeout"`
ClientMaxBodySize int64 `mapstructure:"client_max_body_size"`
SendTimeout time.Duration `mapstructure:"send_timeout"`
UnderscoresInHeaders string `mapstructure:"underscores_in_headers"`
RealIPHeader string `mapstructure:"real_ip_header"`
RealIPRecursive string `mapstructure:"real_ip_recursive"`
RealIPFrom []string `mapstructure:"real_ip_from"`
ProxySSLServerName bool `mapstructure:"proxy_ssl_server_name"`
Upstream NginxUpstream `mapstructure:"upstream"`
Charset string `mapstructure:"charset"`
VariablesHashMaxSize int `mapstructure:"variables_hash_max_size"`
}
type NginxStream ¶
type NginxUpstream ¶
type NodeListen ¶
type PluginAttr ¶
type Proxy ¶
type Proxy struct {
// keepalive_timeout: 60s
// client_header_timeout: 60s
DialerTimeout int `mapstructure:"dialer_timeout"`
DialerKeepAlive int `mapstructure:"dialer_keep_alive"`
IdleConnTimeout int `mapstructure:"idle_conn_timeout"`
TLSHandshakeTimeout int `mapstructure:"tls_handshake_timeout"`
ExpectContinueTimeout int `mapstructure:"expect_continue_timeout"`
ResponseHeaderTimeout int `mapstructure:"response_header_timeout"`
MaxIdleConns int `mapstructure:"max_idle_conns"`
MaxIdleConnsPerHost int `mapstructure:"max_idle_conns_per_host"`
MaxConnsPerHost int `mapstructure:"max_conns_per_host"`
MaxInFlight int `mapstructure:"max_in_flight"`
}
section: proxy
type ProxyCache ¶
type ProxyProtocol ¶
type RoleConfig ¶
type RoleConfig struct {
ConfigProvider string `mapstructure:"config_provider"`
}
type RoleTraditionalConfig ¶
type RoleTraditionalConfig struct {
ConfigProvider string `mapstructure:"config_provider"`
}
type Ssl ¶
type Ssl struct {
Enable bool `mapstructure:"enable"`
Listen []Listen `mapstructure:"listen"`
SslTrustedCertificate string `mapstructure:"ssl_trusted_certificate"`
SslProtocols string `mapstructure:"ssl_protocols"`
SslCiphers string `mapstructure:"ssl_ciphers"`
SslSessionTickets bool `mapstructure:"ssl_session_tickets"`
FallbackSNI string `mapstructure:"fallback_sni"`
}
type StandaloneFileWatcher ¶
type StandaloneFileWatcher struct {
// contains filtered or unexported fields
}
StandaloneFileWatcher loads the APISIX file-driven configuration and emits store events for added, updated, and removed resources.
func NewStandaloneFileWatcher ¶
func NewStandaloneFileWatcher(path, provider string, events chan *store.Event) *StandaloneFileWatcher
func (*StandaloneFileWatcher) Reload ¶
func (w *StandaloneFileWatcher) Reload() error
func (*StandaloneFileWatcher) ReloadSnapshot ¶
func (w *StandaloneFileWatcher) ReloadSnapshot() (StandaloneReloadResult, error)
ReloadSnapshot emits the complete resource diff before returning its result.
func (*StandaloneFileWatcher) SeedCurrentSnapshot ¶
func (w *StandaloneFileWatcher) SeedCurrentSnapshot(snapshot map[string]map[string][]byte)
SeedCurrentSnapshot sets the last-good standalone baseline. All map and byte slices are cloned so callers can safely reuse or mutate their input.
func (*StandaloneFileWatcher) SetAcknowledgedReloadCallback ¶
func (w *StandaloneFileWatcher) SetAcknowledgedReloadCallback( callback func(StandaloneReloadResult, error) error, )
SetAcknowledgedReloadCallback installs a serialized apply callback. A non-nil callback error keeps the previous snapshot so the next file event replays the complete diff.
func (*StandaloneFileWatcher) SetReloadCallback ¶
func (w *StandaloneFileWatcher) SetReloadCallback(callback func(StandaloneReloadResult, error))
func (*StandaloneFileWatcher) Start ¶
func (w *StandaloneFileWatcher) Start() error
Start registers the standalone file watcher. It is safe to call more than once; only the first call acquires filesystem resources.
func (*StandaloneFileWatcher) Stop ¶
func (w *StandaloneFileWatcher) Stop() error
Stop cancels and joins the file watcher. It never closes the shared Store event channel and is safe before Start or when called repeatedly.
func (*StandaloneFileWatcher) Watch ¶
func (w *StandaloneFileWatcher) Watch()
Watch preserves the historical logging-only API while Start exposes setup errors to lifecycle owners such as Server.
type StandaloneReloadResult ¶
type StandaloneReloadResult struct {
ChangedHTTPRouteBuckets []string
ChangedStreamBuckets []string
}
StandaloneReloadResult describes the route-relevant resources changed by one successfully applied standalone snapshot.
func (StandaloneReloadResult) AffectsHTTPRoutes ¶
func (r StandaloneReloadResult) AffectsHTTPRoutes() bool
func (StandaloneReloadResult) AffectsStreams ¶
func (r StandaloneReloadResult) AffectsStreams() bool
type StreamProxy ¶
type Wasm ¶
type Wasm struct {
Plugins []WasmPlugin `mapstructure:"plugins"`
}
type WasmPlugin ¶
type XRPC ¶
type XRPC struct {
Protocols []XRPCProtocol `mapstructure:"protocols"`
}
type XRPCProtocol ¶
type XRPCProtocol struct {
Name string `mapstructure:"name"`
}