Documentation ¶
Index ¶
- Constants
- Variables
- type AbortInject
- type AccessLog
- type ApplicationInfo
- 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 ExtendItem
- type FaultInject
- type FaultInjectConfig
- type FaultToleranceFilterConfig
- type Filter
- type FilterChain
- type FilterChainConfig
- 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 IsCluster_LbConfig
- type LBOriDstConfig
- type LBSubsetConfig
- type LbMeta
- type LbType
- type LeastRequestLbConfig
- type Listener
- type ListenerConfig
- type ListenerType
- type MOSNConfig
- type MetadataConfig
- type MetricsConfig
- type Mixer
- type Mode
- type PProfConfig
- type PatternConfig
- type PluginConfig
- type Proxy
- type ProxyGeneralExtendConfig
- type PublishContent
- type PublishInfo
- 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 SdsConfig
- type SecretConfigWrapper
- type ServerConfig
- type ServiceRegistryInfo
- type SkyWalkingTraceConfig
- type SkyWalkingTraceTLSConfig
- type SourceIPHashPolicy
- type StatsMatcher
- type StreamDSL
- type StreamFaultInject
- type StreamGzip
- type StreamPayloadLimit
- type StreamProxy
- type StreamRoute
- type StreamRouteConfig
- type StreamTranscoder
- type SubscribeSpec
- type TLSConfig
- type Thresholds
- type TracingConfig
- type VirtualHost
- type WebSocketProxy
- type WeightedCluster
- type XProxyExtendConfig
Constants ¶
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" )
Network Filter's Type
const ( MIXER = "mixer" FaultStream = "fault" PayloadLimit = "payload_limit" Gzip = "gzip" FaultTolerance = "fault_tolerance" IstioStats = "istio.stats" DSL = "dsl" Mirror = "mirror" DubboStream = "dubbo_stream" )
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 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 ErrNoAddrListener = errors.New("address is required in listener config")
Functions ¶
This section is empty.
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 ApplicationInfo ¶
type ApplicationInfo struct { DataCenter string `json:"data_center,omitempty"` AppName string `json:"app_name,omitempty"` Zone string `json:"zone,omitempty"` DeployMode bool `json:"deploy_mode,omitempty"` MasterSystem bool `json:"master_system,omitempty"` CloudName string `json:"cloud_name,omitempty"` HostMachine string `json:"host_machine,omitempty"` InstanceId string `json:"instance_id,omitempty"` RegistryEndpoint string `json:"registry_endpoint,omitempty"` AccessKey string `json:"access_key,omitempty"` SecretKey string `json:"secret_key,omitempty"` }
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"` 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"` LbConfig IsCluster_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"` }
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 ( STATIC_CLUSTER ClusterType = "STATIC" SIMPLE_CLUSTER ClusterType = "SIMPLE" 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 ExtendItem ¶ added in v0.15.0
type ExtendItem struct { Type string `json:"type"` Config json.RawMessage `json:"config"` }
ExtendItem is used to extend the mosn config by user need
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"` 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 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"` 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"` 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 IsCluster_LbConfig ¶ added in v0.12.0
type IsCluster_LbConfig interface {
// contains filtered or unexported methods
}
type LBOriDstConfig ¶ added in v0.11.0
type LBOriDstConfig struct { UseHeader bool `json:"use_header,omitempty"` HeaderName string `json:"header_name,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 LeastRequestLbConfig ¶ added in v0.12.0
type LeastRequestLbConfig struct {
ChoiceCount uint32
}
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) 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"` UseOriginalDst bool `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"` }
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 ServiceRegistry ServiceRegistryInfo `json:"service_registry,omitempty"` //service registry config, used by service discovery module CloseGraceful bool `json:"close_graceful,omitempty"` // graceful switch, default false Pid string `json:"pid,omitempty"` // pid file Tracing TracingConfig `json:"tracing,omitempty"` // tracing config 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 RawAdmin json.RawMessage `json:"admin,omitempty"` // admin raw message Debug PProfConfig `json:"pprof,omitempty"` Plugin PluginConfig `json:"plugin,omitempty"` // plugin config Extend []ExtendItem `json:"extend,omitempty"` // extend 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() *xdsboot.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"` }
MetricsConfig for metrics sinks
type Mixer ¶
type Mixer struct {
client.HttpClientConfig
}
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 }
PProfConfig is used to start a pprof server for debug
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"` RouterConfigName string `json:"router_config_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 ProxyGeneralExtendConfig ¶ added in v0.14.0
type ProxyGeneralExtendConfig struct { Http2UseStream bool `json:"http2_use_stream,omitempty"` MaxRequestBodySize int `json:"max_request_body_size,omitempty"` MaxHeaderSize int `json:"max_header_size,omitempty"` }
ProxyGeneralExtendConfig is a general config for proxy
type PublishContent ¶
type PublishInfo ¶
type PublishInfo struct {
Pub PublishContent
}
PublishInfo implements json.Marshaler and json.Unmarshaler
func (PublishInfo) MarshalJSON ¶
func (pb PublishInfo) MarshalJSON() (b []byte, err error)
func (*PublishInfo) UnmarshalJSON ¶
func (pb *PublishInfo) UnmarshalJSON(b []byte) (err error)
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"` }
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"` 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"` 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"` 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 }
RouterMatch represents the route matching parameters
type SdsConfig ¶
type SdsConfig struct { CertificateConfig *SecretConfigWrapper ValidationConfig *SecretConfigWrapper }
type SecretConfigWrapper ¶
type SecretConfigWrapper struct {
Config *auth.SdsSecretConfig
}
func (SecretConfigWrapper) MarshalJSON ¶
func (sc SecretConfigWrapper) MarshalJSON() (b []byte, err error)
func (*SecretConfigWrapper) UnmarshalJSON ¶
func (sc *SecretConfigWrapper) UnmarshalJSON(b []byte) error
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"` //go processor number Processor int `json:"processor,omitempty"` Listeners []Listener `json:"listeners,omitempty"` Routers []*RouterConfiguration `json:"routers,omitempty"` }
ServerConfig for making up server for mosn
type ServiceRegistryInfo ¶
type ServiceRegistryInfo struct { ServiceAppInfo ApplicationInfo `json:"application,omitempty"` ServicePubInfo []PublishInfo `json:"publish_info,omitempty"` MsgMetaInfo map[string][]string `json:"msg_meta_info,omitempty"` MqClientKey map[string]string `json:"mq_client_key,omitempty"` MqMeta map[string]string `json:"mq_meta_info,omitempty"` MqConsumers map[string][]string `json:"mq_consumers,omitempty"` }
ServiceRegistryInfo
type SkyWalkingTraceConfig ¶ added in v0.12.0
type SkyWalkingTraceTLSConfig ¶ added in v0.15.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 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"` SdsConfig *SdsConfig `json:"sds_source,omitempty"` }
TLSConfig is a configuration of tls context
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 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"` ResponseHeadersToAdd []*HeaderValueOption `json:"response_headers_to_add,omitempty"` ResponseHeadersToRemove []string `json:"response_headers_to_remove,omitempty"` }
VirtualHost is used to make up the route table
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
type XProxyExtendConfig ¶
type XProxyExtendConfig struct {
SubProtocol string `json:"sub_protocol,omitempty"`
}
XProxyExtendConfig