Documentation ¶
Index ¶
- Constants
- Variables
- func ExtendConfigParsed(typ string, cfg json.RawMessage) error
- func RegisterParseExtendConfig(typ string, f ParseExtendConfig) error
- type AbortInject
- type AccessLog
- type AddressInfo
- type Admin
- type CidrRange
- type CircuitBreakers
- type Cluster
- type ClusterManagerConfig
- type ClusterManagerConfigJson
- type ClusterSpecInfo
- type ClusterType
- type ClusterWeight
- type ClusterWeightConfig
- type CookieHashPolicy
- type Decorator
- type DelayInject
- type DelayInjectConfig
- type DirectResponseAction
- type DnsLookupFamily
- type DnsResolverConfig
- type DslExpressionMatcher
- type EWMAConfig
- type ExtendConfig
- type FaultInject
- type FaultInjectConfig
- type FaultToleranceFilterConfig
- type Filter
- type FilterChain
- type FilterChainConfig
- type GRPC
- type GRPCConfig
- type GoogleRe2Config
- type HashPolicy
- type HeaderHashPolicy
- type HeaderMatcher
- type HeaderValue
- type HeaderValueOption
- type HealthCheck
- type HealthCheckConfig
- type HealthCheckFilter
- type HealthCheckFilterConfig
- type Host
- type HostConfig
- type KeepAlive
- type KeepAliveConfig
- type LBOriDstConfig
- type LBSubsetConfig
- type LbConfig
- type LbMeta
- type LbType
- type Listener
- type ListenerConfig
- type ListenerType
- type MOSNConfig
- type MetadataConfig
- type MetricsConfig
- type Mode
- type OriginalDstType
- type PProfConfig
- type ParseExtendConfig
- type PatternConfig
- type PluginConfig
- type Proxy
- type RedirectAction
- type RegexRewrite
- type RequestMirrorPolicy
- type RetryPolicy
- type RetryPolicyConfig
- type RouteAction
- type Router
- type RouterActionConfig
- type RouterConfig
- type RouterConfiguration
- type RouterConfigurationConfig
- type RouterMatch
- type SampleConfig
- type SdsConfig
- type SecretConfigWrapper
- type SecretConfigWrapperConfig
- type ServerConfig
- type SkyWalkingTraceConfig
- type SkyWalkingTraceTLSConfig
- type SlowStartConfig
- type SocketAddress
- type SourceIPHashPolicy
- type StatsMatcher
- type StreamDSL
- type StreamFaultInject
- type StreamFilterGoPluginConfig
- type StreamGzip
- type StreamPayloadLimit
- type StreamProxy
- type StreamRoute
- type StreamRouteConfig
- type StreamTranscoder
- type SubscribeSpec
- type TLSConfig
- type ThirdPartCodec
- type ThirdPartCodecConfig
- type ThirdPartCodecType
- type Thresholds
- type TracingConfig
- type VariableMatcher
- type VirtualHost
- type WasmPluginConfig
- type WasmVmConfig
- type WebSocketProxy
- type WeightedCluster
Constants ¶
const ( MinHostWeight = uint32(1) MaxHostWeight = uint32(128) DefaultMaxRequestPerConn = uint32(1024) DefaultConnBufferLimitBytes = uint32(16 * 1024) )
const ( SlowStartDefaultAggression = 1.0 SlowStartDefaultMinWeightPercent = 0.10 // 10% SlowStartDurationMode = "duration" )
Slow Start
const ( CONNECTION_MANAGER = "connection_manager" // deprecated DEFAULT_NETWORK_FILTER = "proxy" TCP_PROXY = "tcp_proxy" UDP_PROXY = "udp_proxy" FAULT_INJECT_NETWORK_FILTER = "fault_inject" RPC_PROXY = "rpc_proxy" X_PROXY = "x_proxy" Transcoder = "transcoder" GRPC_NETWORK_FILTER = "grpc" TUNNEL = "tunnel" )
Network Filter's Type
const ( FaultStream = "fault" PayloadLimit = "payload_limit" Gzip = "gzip" FaultTolerance = "fault_tolerance" DSL = "dsl" Mirror = "mirror" DubboStream = "dubbo_stream" GoPluginStreamFilterSuffix = "so_plugin" GrpcMetricFilter = "grpc_metric" IPAccess = "ip_access" )
Stream Filter's Type
const ( LogReporter string = "log" GRPCReporter string = "gRPC" DefaultServiceName string = "mosn" )
const MaxFilePath = 128
const (
ORIGINALDST_LISTENER_FILTER = "original_dst"
)
Listener Filter's Type
Variables ¶
var ( ErrNoAddrListener = errors.New("address is required in listener config") ErrUnsupportNetwork = errors.New("listener network only support tcp/udp/unix") )
var ErrDuplicateExtendConfigParse = errors.New("duplicate parse functions of the type")
var ErrDuplicateStaticAndDynamic = errors.New("only one of static config or dynamic config should be exists")
var ErrDuplicateTLSConfig = errors.New("tls_context and tls_context_set can only exists one at the same time")
var GrpcDefaultGracefulStopTimeout = time.Second * 30
var NotPercentError = errors.New("not a percent")
Functions ¶
func ExtendConfigParsed ¶ added in v0.18.0
func ExtendConfigParsed(typ string, cfg json.RawMessage) error
ExtendConfigParsed called the registed ParseExtendConfig Notice the ParseExtendConfig maybe makes the config parse slowly.
func RegisterParseExtendConfig ¶ added in v0.18.0
func RegisterParseExtendConfig(typ string, f ParseExtendConfig) error
RegisterParseExtendConfig should be called before config parse.
Types ¶
type AbortInject ¶
type AccessLog ¶
type AccessLog struct { Path string `json:"log_path,omitempty"` Format string `json:"log_format,omitempty"` }
AccessLog for making up access log
type AddressInfo ¶ added in v0.25.0
type AddressInfo struct {
SocketAddress SocketAddress `json:"socket_address,omitempty"`
}
type Admin ¶ added in v0.25.0
type Admin struct {
Address *AddressInfo `json:"address,omitempty"`
}
func (*Admin) GetAddress ¶ added in v0.25.0
func (*Admin) GetPortValue ¶ added in v0.25.0
type CircuitBreakers ¶
type CircuitBreakers struct {
Thresholds []Thresholds
}
CircuitBreakers is a configuration of circuit breakers CircuitBreakers implements json.Marshaler and json.Unmarshaler
func (CircuitBreakers) MarshalJSON ¶
func (cb CircuitBreakers) MarshalJSON() (b []byte, err error)
CircuitBreakers's implements json.Marshaler and json.Unmarshaler
func (*CircuitBreakers) UnmarshalJSON ¶
func (cb *CircuitBreakers) UnmarshalJSON(b []byte) (err error)
type Cluster ¶
type Cluster struct { Name string `json:"name,omitempty"` ClusterType ClusterType `json:"type,omitempty"` SubType string `json:"sub_type,omitempty"` //not used yet LbType LbType `json:"lb_type,omitempty"` MaxRequestPerConn uint32 `json:"max_request_per_conn,omitempty"` Mark uint32 `json:"mark,omitempty"` ConnBufferLimitBytes uint32 `json:"conn_buffer_limit_bytes,omitempty"` CirBreThresholds CircuitBreakers `json:"circuit_breakers,omitempty"` HealthCheck HealthCheck `json:"health_check,omitempty"` Spec ClusterSpecInfo `json:"spec,omitempty"` LBSubSetConfig LBSubsetConfig `json:"lb_subset_config,omitempty"` LBOriDstConfig LBOriDstConfig `json:"original_dst_lb_config,omitempty"` ClusterManagerTLS bool `json:"cluster_manager_tls,omitempty"` TLS TLSConfig `json:"tls_context,omitempty"` Hosts []Host `json:"hosts,omitempty"` ConnectTimeout *api.DurationConfig `json:"connect_timeout,omitempty"` KeepAlive KeepAlive `json:"keepalive,omitempty"` IdleTimeout *api.DurationConfig `json:"idle_timeout,omitempty"` LbConfig *LbConfig `json:"lbconfig,omitempty"` DnsRefreshRate *api.DurationConfig `json:"dns_refresh_rate,omitempty"` RespectDnsTTL bool `json:"respect_dns_ttl,omitempty"` DnsLookupFamily DnsLookupFamily `json:"dns_lookup_family,omitempty"` DnsResolverConfig DnsResolverConfig `json:"dns_resolvers,omitempty"` DnsResolverFile string `json:"dns_resolver_file,omitempty"` DnsResolverPort string `json:"dns_resolver_port,omitempty"` SlowStart SlowStartConfig `json:"slow_start,omitempty"` ClusterPoolEnable bool `json:"cluster_pool_enable,omitempty"` }
Cluster represents a cluster's information
type ClusterManagerConfig ¶
type ClusterManagerConfig struct { ClusterManagerConfigJson Clusters []Cluster `json:"-"` }
ClusterManagerConfig for making up cluster manager Cluster is the global cluster of mosn
func (ClusterManagerConfig) MarshalJSON ¶
func (cc ClusterManagerConfig) MarshalJSON() (b []byte, err error)
Marshal memory config into json, if dynamic mode is configured, write json file
func (*ClusterManagerConfig) UnmarshalJSON ¶
func (cc *ClusterManagerConfig) UnmarshalJSON(b []byte) error
type ClusterSpecInfo ¶
type ClusterSpecInfo struct {
Subscribes []SubscribeSpec `json:"subscribe,omitempty"`
}
ClusterSpecInfo is a configuration of subscribe
type ClusterType ¶
type ClusterType string
ClusterType
const ( SIMPLE_CLUSTER ClusterType = "SIMPLE" STATIC_CLUSTER ClusterType = "STATIC" DYNAMIC_CLUSTER ClusterType = "DYNAMIC" EDS_CLUSTER ClusterType = "EDS" ORIGINALDST_CLUSTER ClusterType = "ORIGINAL_DST" STRICT_DNS_CLUSTER ClusterType = "STRICT_DNS" )
Group of cluster type
type ClusterWeight ¶
type ClusterWeight struct { ClusterWeightConfig MetadataMatch api.Metadata `json:"-"` }
ClusterWeight. clusters along with weights that indicate the percentage of traffic to be forwarded to each cluster
func (ClusterWeight) MarshalJSON ¶
func (cw ClusterWeight) MarshalJSON() (b []byte, err error)
func (*ClusterWeight) UnmarshalJSON ¶
func (cw *ClusterWeight) UnmarshalJSON(b []byte) error
type ClusterWeightConfig ¶
type ClusterWeightConfig struct { Name string `json:"name,omitempty"` Weight uint32 `json:"weight,omitempty"` MetadataConfig *MetadataConfig `json:"metadata_match,omitempty"` }
type CookieHashPolicy ¶ added in v0.14.0
type CookieHashPolicy struct { Name string `json:"name,omitempty"` Path string `json:"path,omitempty"` TTL api.DurationConfig `json:"ttl,omitempty"` }
type DelayInject ¶
type DelayInject struct { DelayInjectConfig Delay time.Duration `json:"-"` }
func (DelayInject) MarshalJSON ¶ added in v0.16.0
func (d DelayInject) MarshalJSON() (b []byte, err error)
func (*DelayInject) UnmarshalJSON ¶
func (d *DelayInject) UnmarshalJSON(b []byte) error
type DelayInjectConfig ¶
type DelayInjectConfig struct { Percent uint32 `json:"percentage,omitempty"` DelayDurationConfig api.DurationConfig `json:"fixed_delay,omitempty"` }
type DirectResponseAction ¶
type DirectResponseAction struct { StatusCode int `json:"status,omitempty"` Body string `json:"body,omitempty"` }
DirectResponseAction represents the direct response parameters
type DnsLookupFamily ¶ added in v0.13.0
type DnsLookupFamily string
const ( V4Only DnsLookupFamily = "V4_ONLY" V6Only DnsLookupFamily = "V6_ONLY" )
type DnsResolverConfig ¶ added in v0.13.0
type DslExpressionMatcher ¶ added in v0.21.0
type DslExpressionMatcher struct {
Expression string `json:"expression"`
}
type EWMAConfig ¶ added in v1.5.0
type EWMAConfig struct { Alpha float64 `json:"alpha"` Target float64 `json:"target"` Duration *api.DurationConfig `json:"duration"` }
EWMAConfig for configuring EWMA alpha
type ExtendConfig ¶ added in v0.20.0
type ExtendConfig struct { Type string `json:"type"` Config json.RawMessage `json:"config"` }
ExtendConfig for any extends
type FaultInject ¶
type FaultInject struct { FaultInjectConfig DelayDuration uint64 `json:"-"` }
FaultInject
func (FaultInject) MarshalJSON ¶ added in v0.16.0
func (f FaultInject) MarshalJSON() (b []byte, err error)
func (*FaultInject) UnmarshalJSON ¶
func (f *FaultInject) UnmarshalJSON(b []byte) error
type FaultInjectConfig ¶
type FaultInjectConfig struct { DelayPercent uint32 `json:"delay_percent,omitempty"` DelayDurationConfig api.DurationConfig `json:"delay_duration,omitempty"` }
type FaultToleranceFilterConfig ¶ added in v0.13.0
type Filter ¶
type Filter struct { Type string `json:"type,omitempty"` GoPluginConfig *StreamFilterGoPluginConfig `json:"go_plugin_config"` Config map[string]interface{} `json:"config,omitempty"` }
Filter is a config to make up a filter
type FilterChain ¶
type FilterChain struct { FilterChainConfig TLSContexts []TLSConfig `json:"-"` }
FilterChain wraps a set of match criteria, an option TLS context, a set of filters, and various other parameters.
func (FilterChain) MarshalJSON ¶
func (fc FilterChain) MarshalJSON() (b []byte, err error)
func (*FilterChain) UnmarshalJSON ¶
func (fc *FilterChain) UnmarshalJSON(b []byte) error
type FilterChainConfig ¶
type GRPC ¶ added in v0.23.0
type GRPC struct { GRPCConfig // GracefulStopTimeout grpc server graceful stop timeout GracefulStopTimeout time.Duration `json:"-"` }
func (*GRPC) MarshalJSON ¶ added in v0.24.0
func (*GRPC) UnmarshalJSON ¶ added in v0.24.0
type GRPCConfig ¶ added in v0.24.0
type GRPCConfig struct { // GracefulStopTimeoutConfig grpc server graceful stop timeout GracefulStopTimeoutConfig api.DurationConfig `json:"graceful_stop_timeout"` // ServerName determines which registered grpc server is used. // A server_name should be used only once. ServerName string `json:"server_name"` // GrpcConfig represents the configuration needed to create // a registered grpc server, which can be any types, usually json. GrpcConfig json.RawMessage `json:"grpc_config"` }
type GoogleRe2Config ¶ added in v0.15.0
type GoogleRe2Config struct {
MaxProgramSize uint32 `json:"max_program_size,omitempty"`
}
TODO: not implement yet
type HashPolicy ¶ added in v0.14.0
type HashPolicy struct { Header *HeaderHashPolicy `json:"header,omitempty"` Cookie *CookieHashPolicy `json:"cookie,omitempty"` SourceIP *SourceIPHashPolicy `json:"source_ip,omitempty"` }
type HeaderHashPolicy ¶ added in v0.14.0
type HeaderHashPolicy struct {
Key string `json:"key,omitempty"`
}
type HeaderMatcher ¶
type HeaderMatcher struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Regex bool `json:"regex,omitempty"` }
HeaderMatcher specifies a set of headers that the route should match on.
type HeaderValue ¶
HeaderValue is header name/value pair.
type HeaderValueOption ¶
type HeaderValueOption struct { Header *HeaderValue `json:"header,omitempty"` Append *bool `json:"append,omitempty"` }
HeaderValueOption is header name/value pair plus option to control append behavior.
type HealthCheck ¶
type HealthCheck struct { HealthCheckConfig Timeout time.Duration `json:"-"` Interval time.Duration `json:"-"` IntervalJitter time.Duration `json:"-"` }
HealthCheck is a configuration of health check use DurationConfig to parse string to time.Duration
func (HealthCheck) MarshalJSON ¶
func (hc HealthCheck) MarshalJSON() (b []byte, err error)
Marshal implement a json.Marshaler
func (*HealthCheck) UnmarshalJSON ¶
func (hc *HealthCheck) UnmarshalJSON(b []byte) error
type HealthCheckConfig ¶
type HealthCheckConfig struct { Protocol string `json:"protocol,omitempty"` TimeoutConfig api.DurationConfig `json:"timeout,omitempty"` IntervalConfig api.DurationConfig `json:"interval,omitempty"` IntervalJitterConfig api.DurationConfig `json:"interval_jitter,omitempty"` InitialDelaySeconds api.DurationConfig `json:"initial_delay_seconds,omitempty"` HealthyThreshold uint32 `json:"healthy_threshold,omitempty"` UnhealthyThreshold uint32 `json:"unhealthy_threshold,omitempty"` ServiceName string `json:"service_name,omitempty"` SessionConfig map[string]interface{} `json:"check_config,omitempty"` EventLogPath string `json:"event_log_path,omitempty"` CommonCallbacks []string `json:"common_callbacks,omitempty"` // HealthCheck support register some common callbacks that are not related to specific cluster }
type HealthCheckFilter ¶
type HealthCheckFilter struct { HealthCheckFilterConfig CacheTime time.Duration `json:"-"` }
HealthCheckFilter
func (HealthCheckFilter) MarshalJSON ¶
func (hf HealthCheckFilter) MarshalJSON() (b []byte, err error)
func (*HealthCheckFilter) UnmarshalJSON ¶
func (hf *HealthCheckFilter) UnmarshalJSON(b []byte) error
type HealthCheckFilterConfig ¶
type Host ¶
type Host struct { HostConfig MetaData api.Metadata `json:"-"` }
Host represenets a host information
func (Host) MarshalJSON ¶
func (*Host) UnmarshalJSON ¶
type HostConfig ¶
type HostConfig struct { Address string `json:"address,omitempty"` Hostname string `json:"hostname,omitempty"` Weight uint32 `json:"weight,omitempty"` MetaDataConfig *MetadataConfig `json:"metadata,omitempty"` TLSDisable bool `json:"tls_disable,omitempty"` }
type KeepAlive ¶ added in v1.6.1
type KeepAlive struct { KeepAliveConfig Interval time.Duration `json:"-"` Timeout time.Duration `json:"-"` }
func (KeepAlive) MarshalJSON ¶ added in v1.6.1
MarshalJSON Marshal implement a json.Marshaler
func (*KeepAlive) UnmarshalJSON ¶ added in v1.6.1
UnmarshalJSON implement a json.Unmarshaler
type KeepAliveConfig ¶ added in v1.6.1
type KeepAliveConfig struct { IntervalConfig api.DurationConfig `json:"interval,omitempty"` TimeoutConfig api.DurationConfig `json:"timeout,omitempty"` }
type LBOriDstConfig ¶ added in v0.11.0
type LBOriDstConfig struct { UseHeader bool `json:"use_header,omitempty"` HeaderName string `json:"header_name,omitempty"` // ReplaceLocal is true means the load balance will always choose // a host with local address ReplaceLocal bool `json:"replace_local,omitempty"` }
LBOriDstConfig for OriDst load balancer.
type LBSubsetConfig ¶
type LBSubsetConfig struct { FallBackPolicy uint8 `json:"fall_back_policy,omitempty"` DefaultSubset map[string]string `json:"default_subset,omitempty"` SubsetSelectors [][]string `json:"subset_selectors,omitempty"` }
LBSubsetConfig is a configuration of load balance subset
type LbConfig ¶ added in v1.5.0
type LbConfig struct { // The number of random healthy hosts from which // the host with the fewest active requests will be chosen. ChoiceCount uint32 `json:"choice_count,omitempty"` // The larger the active request bias is, the more aggressively active requests // will lower the effective weight when all host weights are not equal. ActiveRequestBias float64 `json:"active_request_bias,omitempty"` }
type Listener ¶
type Listener struct { ListenerConfig Addr net.Addr `json:"-"` ListenerTag uint64 `json:"-"` ListenerScope string `json:"-"` PerConnBufferLimitBytes uint32 `json:"-"` // do not support config InheritListener net.Listener `json:"-"` InheritPacketConn *net.PacketConn `json:"-"` Remain bool `json:"-"` }
Listener contains the listener's information
func (*Listener) IsOriginalDst ¶ added in v1.2.0
func (Listener) MarshalJSON ¶ added in v0.11.0
func (*Listener) UnmarshalJSON ¶ added in v0.15.0
type ListenerConfig ¶
type ListenerConfig struct { Name string `json:"name,omitempty"` Type ListenerType `json:"type,omitempty"` AddrConfig string `json:"address,omitempty"` BindToPort bool `json:"bind_port,omitempty"` Network string `json:"network,omitempty"` OriginalDst OriginalDstType `json:"use_original_dst,omitempty"` AccessLogs []AccessLog `json:"access_logs,omitempty"` ListenerFilters []Filter `json:"listener_filters,omitempty"` FilterChains []FilterChain `json:"filter_chains,omitempty"` // only one filterchains at this time StreamFilters []Filter `json:"stream_filters,omitempty"` Inspector bool `json:"inspector,omitempty"` ConnectionIdleTimeout *api.DurationConfig `json:"connection_idle_timeout,omitempty"` DefaultReadBufferSize int `json:"default_read_buffer_size,omitempty"` }
type ListenerType ¶
type ListenerType string
ListenerType: Ingress or Egress
const EGRESS ListenerType = "egress"
const INGRESS ListenerType = "ingress"
type MOSNConfig ¶
type MOSNConfig struct { Servers []ServerConfig `json:"servers,omitempty"` //server config ClusterManager ClusterManagerConfig `json:"cluster_manager,omitempty"` //cluster config DisableUpgrade bool `json:"disable_upgrade,omitempty"` // not upgrade from old mosn, default false CloseGraceful bool `json:"close_graceful,omitempty"` // deprecated, same as disable_upgrade InheritOldMosnconfig bool `json:"inherit_old_mosnconfig,omitempty"` // inherit old mosn config switch, default false Tracing TracingConfig `json:"tracing,omitempty"` Metrics MetricsConfig `json:"metrics,omitempty"` RawDynamicResources json.RawMessage `json:"dynamic_resources,omitempty"` //dynamic_resources raw message RawStaticResources json.RawMessage `json:"static_resources,omitempty"` //static_resources raw message Node json.RawMessage `json:"node,omitempty"` // node info for pilot RawAdmin *Admin `json:"admin,omitempty"` // admin Debug PProfConfig `json:"pprof,omitempty"` Pid string `json:"pid,omitempty"` // pid file UDSDir string `json:"uds_dir,omitempty"` // unix domain socket directory Plugin PluginConfig `json:"plugin,omitempty"` // plugin config ThirdPartCodec ThirdPartCodecConfig `json:"third_part_codec,omitempty"` // third part codec config Extends []ExtendConfig `json:"extends,omitempty"` // extend config Wasms []WasmPluginConfig `json:"wasm_global_plugins,omitempty"` // wasm config }
MOSNConfig make up mosn to start the mosn project Servers contains the listener, filter and so on ClusterManager used to manage the upstream
func (*MOSNConfig) GetAdmin ¶
func (c *MOSNConfig) GetAdmin() *Admin
func (*MOSNConfig) Mode ¶
func (c *MOSNConfig) Mode() Mode
type MetadataConfig ¶
type MetadataConfig struct {
MetaKey LbMeta `json:"filter_metadata"`
}
MetadataConfig is a config for metadata
type MetricsConfig ¶
type MetricsConfig struct { SinkConfigs []Filter `json:"sinks"` StatsMatcher StatsMatcher `json:"stats_matcher"` ShmZone string `json:"shm_zone"` ShmSize datasize.ByteSize `json:"shm_size"` FlushMosn bool `json:"flush_mosn"` LazyFlush bool `json:"lazy_flush"` SampleConfig SampleConfig `json:"sample"` EWMAConfig *EWMAConfig `json:"ewma,omitempty"` }
MetricsConfig for metrics sinks
type OriginalDstType ¶ added in v1.2.0
type OriginalDstType string
OriginalDstType: TProxy or Redirect
const REDIRECT OriginalDstType = "redirect"
const TPROXY OriginalDstType = "tproxy"
type PProfConfig ¶
type PProfConfig struct { StartDebug bool `json:"debug"` // If StartDebug is true, start a pprof, default is false Port int `json:"port_value"` // If port value is 0, will use 9090 as default Endpoint string `json:"endpoint"` // If endpoint is empty, will use "0.0.0.0" as default }
PProfConfig is used to start a pprof server for debug
type ParseExtendConfig ¶ added in v0.18.0
type ParseExtendConfig func(config json.RawMessage) error
type PatternConfig ¶ added in v0.15.0
type PatternConfig struct { GoogleRe2 GoogleRe2Config `json:"google_re2,omitempty"` Regex string `json:"regex,omitempty"` }
type PluginConfig ¶
type PluginConfig struct {
LogBase string `json:"log_base"`
}
PluginConfig for plugin config
type Proxy ¶
type Proxy struct { Name string `json:"name,omitempty"` DownstreamProtocol string `json:"downstream_protocol,omitempty"` UpstreamProtocol string `json:"upstream_protocol,omitempty"` FallbackForUnknownProtocol bool `json:"fallback_for_unknown_protocol,omitempty"` RouterConfigName string `json:"router_config_name,omitempty"` RouterHandlerName string `json:"router_handler_name,omitempty"` ValidateClusters bool `json:"validate_clusters,omitempty"` ExtendConfig map[string]interface{} `json:"extend_config,omitempty"` // proxy level concurrency config, // concurrency num = worker num in worker pool per connection // if concurrency num == 0, use global worker pool ConcurrencyNum int `json:"concurrency_num,omitempty"` }
Proxy
type RedirectAction ¶ added in v0.15.0
type RedirectAction struct { ResponseCode int `json:"response_code,omitempty"` PathRedirect string `json:"path_redirect,omitempty"` HostRedirect string `json:"host_redirect,omitempty"` SchemeRedirect string `json:"scheme_redirect,omitempty"` }
RedirectAction represents the redirect response parameters
type RegexRewrite ¶ added in v0.15.0
type RegexRewrite struct { Pattern PatternConfig `json:"pattern,omitempty"` Substitution string `json:"substitution,omitempty"` }
RegexRewrite represents the regex rewrite parameters
type RequestMirrorPolicy ¶ added in v0.15.0
type RequestMirrorPolicy struct { Cluster string `json:"cluster,omitempty"` Percent uint32 `json:"percent,omitempty"` TraceSampled bool `json:"trace_sampled,omitempty"` // TODO not implement }
RequestMirrorPolicy mirror policy
type RetryPolicy ¶
type RetryPolicy struct { RetryPolicyConfig RetryTimeout time.Duration `json:"-"` }
RetryPolicy represents the retry parameters
func (RetryPolicy) MarshalJSON ¶
func (rp RetryPolicy) MarshalJSON() (b []byte, err error)
func (*RetryPolicy) UnmarshalJSON ¶
func (rp *RetryPolicy) UnmarshalJSON(b []byte) error
type RetryPolicyConfig ¶
type RetryPolicyConfig struct { RetryOn bool `json:"retry_on,omitempty"` RetryTimeoutConfig api.DurationConfig `json:"retry_timeout,omitempty"` NumRetries uint32 `json:"num_retries,omitempty"` StatusCodes []uint32 `json:"status_codes,omitempty"` }
type RouteAction ¶
type RouteAction struct { RouterActionConfig MetadataMatch api.Metadata `json:"-"` Timeout time.Duration `json:"-"` }
RouteAction represents the information of route request to upstream clusters
func (RouteAction) MarshalJSON ¶
func (r RouteAction) MarshalJSON() (b []byte, err error)
func (*RouteAction) UnmarshalJSON ¶
func (r *RouteAction) UnmarshalJSON(b []byte) error
type Router ¶
type Router struct { RouterConfig // Metadata is created from MetadataConfig, which is used to subset Metadata api.Metadata `json:"-"` }
Router, the list of routes that will be matched, in order, for incoming requests. The first route that matches will be used.
func (Router) MarshalJSON ¶
func (*Router) UnmarshalJSON ¶
type RouterActionConfig ¶
type RouterActionConfig struct { ClusterName string `json:"cluster_name,omitempty"` ClusterVariable string `json:"cluster_variable,omitempty"` UpstreamProtocol string `json:"upstream_protocol,omitempty"` ClusterHeader string `json:"cluster_header,omitempty"` WeightedClusters []WeightedCluster `json:"weighted_clusters,omitempty"` HashPolicy []HashPolicy `json:"hash_policy,omitempty"` MetadataConfig *MetadataConfig `json:"metadata_match,omitempty"` TimeoutConfig api.DurationConfig `json:"timeout,omitempty"` RetryPolicy *RetryPolicy `json:"retry_policy,omitempty"` PrefixRewrite string `json:"prefix_rewrite,omitempty"` RegexRewrite *RegexRewrite `json:"regex_rewrite,omitempty"` HostRewrite string `json:"host_rewrite,omitempty"` AutoHostRewrite bool `json:"auto_host_rewrite,omitempty"` AutoHostRewriteHeader string `json:"auto_host_rewrite_header,omitempty"` RequestHeadersToAdd []*HeaderValueOption `json:"request_headers_to_add,omitempty"` RequestHeadersToRemove []string `json:"request_headers_to_remove,omitempty"` ResponseHeadersToAdd []*HeaderValueOption `json:"response_headers_to_add,omitempty"` ResponseHeadersToRemove []string `json:"response_headers_to_remove,omitempty"` }
type RouterConfig ¶
type RouterConfig struct { Match RouterMatch `json:"match,omitempty"` Route RouteAction `json:"route,omitempty"` Redirect *RedirectAction `json:"redirect,omitempty"` DirectResponse *DirectResponseAction `json:"direct_response,omitempty"` MetadataConfig *MetadataConfig `json:"metadata,omitempty"` PerFilterConfig map[string]interface{} `json:"per_filter_config,omitempty"` RequestMirrorPolicies *RequestMirrorPolicy `json:"request_mirror_policies,omitempty"` }
type RouterConfiguration ¶
type RouterConfiguration struct { VirtualHosts []VirtualHost `json:"-"` RouterConfigurationConfig }
RouterConfiguration is a config for routers
func (RouterConfiguration) MarshalJSON ¶
func (rc RouterConfiguration) MarshalJSON() (b []byte, err error)
Marshal memory config into json, if dynamic mode is configured, write json file
func (*RouterConfiguration) UnmarshalJSON ¶
func (rc *RouterConfiguration) UnmarshalJSON(b []byte) error
type RouterConfigurationConfig ¶
type RouterConfigurationConfig struct { RouterConfigName string `json:"router_config_name,omitempty"` RequestHeadersToAdd []*HeaderValueOption `json:"request_headers_to_add,omitempty"` RequestHeadersToRemove []string `json:"request_headers_to_remove,omitempty"` ResponseHeadersToAdd []*HeaderValueOption `json:"response_headers_to_add,omitempty"` ResponseHeadersToRemove []string `json:"response_headers_to_remove,omitempty"` RouterConfigPath string `json:"router_configs,omitempty"` StaticVirtualHosts []VirtualHost `json:"virtual_hosts,omitempty"` }
type RouterMatch ¶
type RouterMatch struct { Prefix string `json:"prefix,omitempty"` // Match request's Path with Prefix Comparing Path string `json:"path,omitempty"` // Match request's Path with Exact Comparing Regex string `json:"regex,omitempty"` // Match request's Path with Regex Comparing Headers []HeaderMatcher `json:"headers,omitempty"` // Match request's Headers Variables []VariableMatcher `json:"variables,omitempty"` // Match request's variable DslExpressions []DslExpressionMatcher `json:"dsl_expressions,omitempty"` }
RouterMatch represents the route matching parameters
type SampleConfig ¶ added in v1.5.0
type SampleConfig struct { Type string `json:"type"` Size int `json:"size"` ExpDecayAlpha float64 `json:"exp_decay_alpha"` }
SampleConfig for metrics histogram
type SdsConfig ¶
type SdsConfig struct { CertificateConfig *SecretConfigWrapper ValidationConfig *SecretConfigWrapper }
type SecretConfigWrapper ¶
type SecretConfigWrapper struct { Name string `json:"-"` SdsConfig interface{} `json:"-"` // contains filtered or unexported fields }
func (SecretConfigWrapper) MarshalJSON ¶
func (scw SecretConfigWrapper) MarshalJSON() (b []byte, err error)
func (*SecretConfigWrapper) UnmarshalJSON ¶
func (scw *SecretConfigWrapper) UnmarshalJSON(b []byte) error
type SecretConfigWrapperConfig ¶ added in v0.25.0
type ServerConfig ¶
type ServerConfig struct { //default logger ServerName string `json:"mosn_server_name,omitempty"` DefaultLogPath string `json:"default_log_path,omitempty"` DefaultLogLevel string `json:"default_log_level,omitempty"` GlobalLogRoller string `json:"global_log_roller,omitempty"` UseNetpollMode bool `json:"use_netpoll_mode,omitempty"` //graceful shutdown config GracefulTimeout api.DurationConfig `json:"graceful_timeout,omitempty"` // int go processor number // string set auto means use real cpu core or limit cpu core Processor interface{} `json:"processor,omitempty"` Listeners []Listener `json:"listeners,omitempty"` Routers []*RouterConfiguration `json:"routers,omitempty"` }
ServerConfig for making up server for mosn
type SkyWalkingTraceConfig ¶ added in v0.12.0
type SkyWalkingTraceTLSConfig ¶ added in v0.15.0
type SlowStartConfig ¶ added in v1.5.0
type SlowStartConfig struct { Mode string `json:"mode,omitempty"` SlowStartDuration *api.DurationConfig `json:"slow_start_duration,omitempty"` Aggression float64 `json:"aggression,omitempty"` MinWeightPercent float64 `json:"min_weight_percent,omitempty"` }
type SocketAddress ¶ added in v0.25.0
type SourceIPHashPolicy ¶ added in v0.14.0
type SourceIPHashPolicy struct { }
type StatsMatcher ¶
type StatsMatcher struct { RejectAll bool `json:"reject_all,omitempty"` ExclusionLabels []string `json:"exclusion_labels,omitempty"` ExclusionKeys []string `json:"exclusion_keys,omitempty"` }
StatsMatcher is a configuration for disabling stat instantiation. TODO: support inclusion_list TODO: support exclusion list/inclusion_list as pattern
type StreamDSL ¶ added in v0.15.0
type StreamDSL struct { Debug bool `json:"debug"` // TODO not implement BeforeRouterDSL string `json:"before_router_by_dsl"` AfterRouterDSL string `json:"after_router_by_dsl"` AfterBalancerDSL string `json:"after_balancer_by_dsl"` SendFilterDSL string `json:"send_filter_by_dsl"` LogDSL string `json:"log_filter_by_dsl"` }
StreamDSL ...
type StreamFaultInject ¶
type StreamFaultInject struct { Delay *DelayInject `json:"delay,omitempty"` Abort *AbortInject `json:"abort,omitempty"` UpstreamCluster string `json:"upstream_cluster,omitempty"` Headers []HeaderMatcher `json:"headers,omitempty"` }
StreamFaultInject
type StreamFilterGoPluginConfig ¶ added in v0.21.0
type StreamGzip ¶ added in v0.13.0
type StreamPayloadLimit ¶
type StreamPayloadLimit struct { MaxEntitySize int32 `json:"max_entity_size "` HttpStatus int32 `json:"http_status"` }
PayloadLimitInject
type StreamProxy ¶ added in v0.15.0
type StreamProxy struct { StatPrefix string `json:"stat_prefix,omitempty"` Cluster string `json:"cluster,omitempty"` IdleTimeout *time.Duration `json:"idle_timeout,omitempty"` MaxConnectAttempts uint32 `json:"max_connect_attempts,omitempty"` Routes []*StreamRoute `json:"routes,omitempty"` }
StreamProxy
type StreamRoute ¶ added in v0.15.0
type StreamRoute struct { Cluster string SourceAddrs []CidrRange DestinationAddrs []CidrRange SourcePort string DestinationPort string }
StreamRoute ...
type StreamRouteConfig ¶ added in v0.15.0
type StreamRouteConfig struct { Cluster string `json:"cluster,omitempty"` Sources []string `json:"source_addrs,omitempty"` Dests []string `json:"destination_addrs,omitempty"` }
Stream Proxy Route
type StreamTranscoder ¶ added in v0.11.0
type StreamTranscoder struct {
Type string `json:"type"`
}
Transcoder
type SubscribeSpec ¶
type SubscribeSpec struct { Subscriber string `json:"subscriber,omitempty"` ServiceName string `json:"service_name,omitempty"` }
SubscribeSpec describes the subscribe server
type TLSConfig ¶
type TLSConfig struct { Status bool `json:"status,omitempty"` Type string `json:"type,omitempty"` ServerName string `json:"server_name,omitempty"` CACert string `json:"ca_cert,omitempty"` CertChain string `json:"cert_chain,omitempty"` PrivateKey string `json:"private_key,omitempty"` VerifyClient bool `json:"verify_client,omitempty"` RequireClientCert bool `json:"require_client_cert,omitempty"` InsecureSkip bool `json:"insecure_skip,omitempty"` CipherSuites string `json:"cipher_suites,omitempty"` EcdhCurves string `json:"ecdh_curves,omitempty"` MinVersion string `json:"min_version,omitempty"` MaxVersion string `json:"max_version,omitempty"` ALPN string `json:"alpn,omitempty"` Ticket string `json:"ticket,omitempty"` Fallback bool `json:"fall_back,omitempty"` ExtendVerify map[string]interface{} `json:"extend_verify,omitempty"` Callbacks []string `json:"callbacks,omitempty"` SdsConfig *SdsConfig `json:"sds_source,omitempty"` }
TLSConfig is a configuration of tls context
type ThirdPartCodec ¶ added in v0.22.0
type ThirdPartCodec struct { Enable bool `json:"enable,omitempty"` Type ThirdPartCodecType `json:"type,omitempty"` Path string `json:"path,omitempty"` LoaderFuncName string `json:"loader_func_name,omitempty"` Config map[string]interface{} `json:"config,omitempty"` }
ThirdPartCodec represents configuration for a third part codec
type ThirdPartCodecConfig ¶ added in v0.22.0
type ThirdPartCodecConfig struct {
Codecs []ThirdPartCodec `json:"codecs"`
}
ThirdPartCodecConfig represents configurations for third part codec
type ThirdPartCodecType ¶ added in v0.22.0
type ThirdPartCodecType string
ThirdPartCodecType represents type of a third part codec
const ( GoPlugin ThirdPartCodecType = "go-plugin" Wasm ThirdPartCodecType = "wasm" )
Third part codec consts
type Thresholds ¶
type TracingConfig ¶
type TracingConfig struct { Enable bool `json:"enable,omitempty"` Tracer string `json:"tracer,omitempty"` // DEPRECATED Driver string `json:"driver,omitempty"` Config map[string]interface{} `json:"config,omitempty"` }
Tracing configuration for a server
type VariableMatcher ¶ added in v0.20.0
type VariableMatcher struct { Name string `json:"name,omitempty"` Value string `json:"value,omitempty"` Regex string `json:"regex,omitempty"` Model string `json:"model,omitempty"` // support && and || operator }
VariableMatcher specifies a set of variables that the route should match on.
type VirtualHost ¶
type VirtualHost struct { Name string `json:"name,omitempty"` Domains []string `json:"domains,omitempty"` Routers []Router `json:"routers,omitempty"` RequireTLS string `json:"require_tls,omitempty"` // not used yet RequestHeadersToAdd []*HeaderValueOption `json:"request_headers_to_add,omitempty"` RequestHeadersToRemove []string `json:"request_headers_to_remove,omitempty"` ResponseHeadersToAdd []*HeaderValueOption `json:"response_headers_to_add,omitempty"` ResponseHeadersToRemove []string `json:"response_headers_to_remove,omitempty"` PerFilterConfig map[string]interface{} `json:"per_filter_config,omitempty"` }
VirtualHost is used to make up the route table
type WasmPluginConfig ¶ added in v0.22.0
type WasmPluginConfig struct { PluginName string `json:"plugin_name,omitempty"` VmConfig *WasmVmConfig `json:"vm_config,omitempty"` InstanceNum int `json:"instance_num,omitempty"` }
func (WasmPluginConfig) Clone ¶ added in v0.22.0
func (w WasmPluginConfig) Clone() WasmPluginConfig
type WasmVmConfig ¶ added in v0.22.0
type WebSocketProxy ¶
type WebSocketProxy struct { StatPrefix string IdleTimeout *time.Duration MaxConnectAttempts uint32 }
WebSocketProxy
type WeightedCluster ¶
type WeightedCluster struct {
Cluster ClusterWeight `json:"cluster,omitempty"`
}
WeightedCluster ... Multiple upstream clusters unsupport stream filter type: healthcheckcan be specified for a given route. The request is routed to one of the upstream clusters based on weights assigned to each cluster