model

package
v0.0.0-...-5dc8409 Latest Latest
Warning

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

Go to latest
Published: Jan 28, 2018 License: Apache-2.0 Imports: 2 Imported by: 0

Documentation

Index

Constants

View Source
const (
	ConsumerType = "Consumer"
	ProviderType = "Provider"
)

constant for consumer and provider

Variables

View Source
var (
	//default config fo hystric.
	DefaultIsolation = IsolationPropertyStruct{
		Timeout:               Timeout{true},
		TimeoutInMilliseconds: 1000,
		MaxConcurrentRequests: 4000,
	}
	DefaultCircuit = CircuitBreakPropertyStruct{
		Enabled:                   true,
		ForceOpen:                 false,
		ForceClose:                false,
		SleepWindowInMilliseconds: 5000,
		RequestVolumeThreshold:    20,
		ErrorThresholdPercentage:  50,
	}
	DefaultFallback = FallbackPropertyStruct{
		Enabled:               true,
		MaxConcurrentRequests: 4000,
	}
)

variables of isolation, circuit, fallback

Functions

This section is empty.

Types

type Abort

type Abort struct {
	Percent    int `yaml:"percent"`
	HTTPStatus int `yaml:"httpStatus"`
}

Abort abort struct

type BackoffStrategy

type BackoffStrategy struct {
	Kind  string `yaml:"kind"`
	MinMs uint   `yaml:"minMs"`
	MaxMs uint   `yaml:"maxMs"`
}

BackoffStrategy back off strategy

type ChainStruct

type ChainStruct struct {
	Consumer map[string]string `yaml:"Consumer"`
	Provider map[string]string `yaml:"Provider"`
}

ChainStruct 调用链信息

type CircuitBreakPropertyStruct

type CircuitBreakPropertyStruct struct {
	Enabled                   bool `yaml:"enabled"`
	ForceOpen                 bool `yaml:"forceOpen"`
	ForceClose                bool `yaml:"forceClose"`
	SleepWindowInMilliseconds int  `yaml:"sleepWindowInMilliseconds"`
	RequestVolumeThreshold    int  `yaml:"requestVolumeThreshold"`
	ErrorThresholdPercentage  int  `yaml:"errorThresholdPercentage"`
}

CircuitBreakPropertyStruct circuitBreaker 属性集合

type CircuitBreakerSpec

type CircuitBreakerSpec struct {
	Enabled                   bool                                  `yaml:"enabled"`
	ForceOpen                 bool                                  `yaml:"forceOpen"`
	ForceClose                bool                                  `yaml:"forceClose"`
	SleepWindowInMilliseconds int                                   `yaml:"sleepWindowInMilliseconds"`
	RequestVolumeThreshold    int                                   `yaml:"requestVolumeThreshold"`
	ErrorThresholdPercentage  int                                   `yaml:"errorThresholdPercentage"`
	AnyService                map[string]CircuitBreakPropertyStruct `yaml:",inline"`
}

CircuitBreakerSpec circuit breaker specifications

type CircuitWrapper

type CircuitWrapper struct {
	Consumer *CircuitBreakerSpec `yaml:"Consumer"`
	Provider *CircuitBreakerSpec `yaml:"Provider"`
}

CircuitWrapper circuit wrapper structure

type ClientStruct

type ClientStruct struct {
	ServerURI       string                 `yaml:"serverUri"`
	TenantName      string                 `yaml:"tenantName"`
	RefreshMode     int                    `yaml:"refreshMode"`
	RefreshInterval int                    `yaml:"refreshInterval"`
	RefreshPort     string                 `yaml:"refreshPort"`
	Autodiscovery   bool                   `yaml:"autodiscovery"`
	APIVersion      ConfigAPIVersionStruct `yaml:"api"`
}

ClientStruct client structure

type ConfigAPIVersionStruct

type ConfigAPIVersionStruct struct {
	Version string `yaml:"version"`
}

ConfigAPIVersionStruct is the structure for configuration API version

type ConfigStruct

type ConfigStruct struct {
	Client ClientStruct `yaml:"client"`
}

ConfigStruct configuration structure

type CredentialStruct

type CredentialStruct struct {
	AccessKey        string `yaml:"accessKey"`
	SecretKey        string `yaml:"secretKey"`
	AkskCustomCipher string `yaml:"akskCustomCipher"`
	Project          string `yaml:"project"`
}

CredentialStruct aksk信息

type CseStruct

type CseStruct struct {
	Loadbalance LoadBalanceStruct           `yaml:"loadbalance"`
	Config      ConfigStruct                `yaml:"config"`
	Service     ServiceStruct               `yaml:"service"`
	Protocols   map[string]Protocol         `yaml:"protocols"`
	Handler     HandlerStruct               `yaml:"handler"`
	References  map[string]ReferencesStruct `yaml:"references"`
	FlowControl ServiceTypes                `yaml:"flowcontrol"`
	Monitor     MonitorStruct               `yaml:"monitor"`
	Metrics     MetricsStruct               `yaml:"metrics"`
	Credentials CredentialStruct            `yaml:"credentials"`
}

CseStruct 设置注册中心SC的地址,要开哪些传输协议, 调用链信息等

type DataCenterInfo

type DataCenterInfo struct {
	Name          string `yaml:"name"`
	Region        string `yaml:"region"`
	AvailableZone string `yaml:"availableZone"`
}

DataCenterInfo gives data center information

type Delay

type Delay struct {
	Percent    int           `yaml:"percent"`
	FixedDelay time.Duration `yaml:"fixedDelay"`
}

Delay delay struct

type FallbackPolicyPropertyStruct

type FallbackPolicyPropertyStruct struct {
	Policy string `yaml:"policy"`
}

FallbackPolicyPropertyStruct fallback policy property structure

type FallbackPolicySpec

type FallbackPolicySpec struct {
	Policy     string                                  `yaml:"policy"`
	AnyService map[string]FallbackPolicyPropertyStruct `yaml:",inline"`
}

FallbackPolicySpec fallback policy specifications

type FallbackPolicyWrapper

type FallbackPolicyWrapper struct {
	Consumer *FallbackPolicySpec `yaml:"Consumer"`
	Provider *FallbackPolicySpec `yaml:"Provider"`
}

FallbackPolicyWrapper fallback policy wrapper

type FallbackPropertyStruct

type FallbackPropertyStruct struct {
	Enabled               bool `yaml:"enabled"`
	MaxConcurrentRequests int  `yaml:"maxConcurrentRequests"`
}

FallbackPropertyStruct fallback property structure

type FallbackSpec

type FallbackSpec struct {
	Enabled               bool                              `yaml:"enabled"`
	MaxConcurrentRequests int                               `yaml:"maxConcurrentRequests"`
	AnyService            map[string]FallbackPropertyStruct `yaml:",inline"`
}

FallbackSpec fallback specifications

type FallbackWrapper

type FallbackWrapper struct {
	Consumer *FallbackSpec `yaml:"Consumer"`
	Provider *FallbackSpec `yaml:"Provider"`
}

FallbackWrapper fallback wrapper structure

type Fault

type Fault struct {
	Abort Abort `yaml:"abort"`
	Delay Delay `yaml:"delay"`
}

Fault fault struct

type FaultProtocolStruct

type FaultProtocolStruct struct {
	Fault map[string]Fault `yaml:"protocols"`
}

FaultProtocolStruct fault protocol struct

type GlobalCfg

type GlobalCfg struct {
	AppID      string            `yaml:"APPLICATION_ID"`
	Cse        CseStruct         `yaml:"cse"`
	Ssl        map[string]string `yaml:"ssl"`
	Tracing    TracingStruct     `yaml:"tracing"`
	DataCenter *DataCenterInfo   `yaml:"region"`
}

GlobalCfg chassis.yaml 配置项

type HandlerStruct

type HandlerStruct struct {
	Chain ChainStruct `yaml:"chain"`
}

HandlerStruct 调用链信息

type HystrixConfig

type HystrixConfig struct {
	IsolationProperties      *IsolationWrapper      `yaml:"isolation"`
	CircuitBreakerProperties *CircuitWrapper        `yaml:"circuitBreaker"`
	FallbackProperties       *FallbackWrapper       `yaml:"fallback"`
	FallbackPolicyProperties *FallbackPolicyWrapper `yaml:"fallbackpolicy"`
}

HystrixConfig is hystrix configuration structure

type HystrixConfigWrapper

type HystrixConfigWrapper struct {
	HystrixConfig *HystrixConfig `yaml:"cse"`
}

HystrixConfigWrapper hystrix configuration wrapper structure

func (*HystrixConfigWrapper) String

func (hc *HystrixConfigWrapper) String() ([]byte, error)

String returns marshalling data of hystrix config wrapper

type InstanceDesc

type InstanceDesc struct {
	Env string `yaml:"environment"`
}

InstanceDesc is the struct for instance description

type IsolationPropertyStruct

type IsolationPropertyStruct struct {
	Timeout               Timeout `yaml:"timeout"`
	TimeoutInMilliseconds int     `yaml:"timeoutInMilliseconds"`
	MaxConcurrentRequests int     `yaml:"maxConcurrentRequests"`
}

IsolationPropertyStruct isolation 属性集合

type IsolationSpec

type IsolationSpec struct {
	TimeoutEnable         Timeout                  `yaml:"timeout"`
	TimeoutInMilliseconds int                      `yaml:"timeoutInMilliseconds"`
	MaxConcurrentRequests int                      `yaml:"maxConcurrentRequests"`
	AnyService            map[string]IsolationSpec `yaml:",inline"`
}

IsolationSpec isolation speciafications

type IsolationWrapper

type IsolationWrapper struct {
	Consumer *IsolationSpec `yaml:"Consumer"`
	Provider *IsolationSpec `yaml:"Provider"`
}

IsolationWrapper isolation wrapper structure

type LoadBalanceStruct

type LoadBalanceStruct struct {
	Strategy     map[string]string `yaml:"strategy"`
	RetryEnabled bool              `yaml:"retryEnabled"`
	RetryOnNext  int               `yaml:"retryOnNext"`
	RetryOnSame  int               `yaml:"retryOnSame"`
	Backoff      BackoffStrategy   `yaml:"backoff"`
}

LoadBalanceStruct loadbalancing structure

type MetricsStruct

type MetricsStruct struct {
	APIPath                string `yaml:"apiPath"`
	Enable                 bool   `yaml:"enable"`
	EnableGoRuntimeMetrics bool   `yaml:"enableGoRuntimeMetrics"`
}

MetricsStruct metrics struct

type MicCseStruct

type MicCseStruct struct {
	RPC     map[string]string `yaml:"rpc"`
	TCP     map[string]string `yaml:"tcp"`
	Rest    map[string]string `yaml:"rest"`
	HighWay map[string]string `yaml:"highway"`
	Handler HandlerStruct     `yaml:"handler"`
}

MicCseStruct 设置注册中心SC的地址,要开哪些传输协议, 调用链信息等

type MicServiceStruct

type MicServiceStruct struct {
	Name               string            `yaml:"name"`
	Version            string            `yaml:"version"`
	Level              string            `yaml:"level"`
	Properties         map[string]string `yaml:"properties"`
	InstanceProperties map[string]string `yaml:"instance_properties"`
}

MicServiceStruct ServiceStruct 设置微服务的私有属性

type MicroserviceCfg

type MicroserviceCfg struct {
	AppID               string           `yaml:"APPLICATION_ID"`
	Provider            string           `yaml:"Provider"`
	ServiceDescription  MicServiceStruct `yaml:"service_description"`
	InstanceDescription MicServiceStruct `yaml:"instance_description"`
	Cse                 MicCseStruct     `yaml:"cse"`
}

MicroserviceCfg microservice.yaml 配置项

type MonitorAPIVersionStruct

type MonitorAPIVersionStruct struct {
	Version string `yaml:"version"`
}

MonitorAPIVersionStruct monitor API version struct

type MonitorClientStruct

type MonitorClientStruct struct {
	ServerURI  string                  `yaml:"serverUri"`
	Enable     bool                    `yaml:"enable"`
	UserName   string                  `yaml:"userName"`
	DomainName string                  `yaml:"domainName"`
	APIVersion MonitorAPIVersionStruct `yaml:"api"`
}

MonitorClientStruct monitor client struct

type MonitorStruct

type MonitorStruct struct {
	Client MonitorClientStruct `yaml:"client"`
}

MonitorStruct is the struct for monitoring parameters

type PassLagerCfg

type PassLagerCfg struct {
	Writers        string `yaml:"writers"`
	LoggerLevel    string `yaml:"logger_level"`
	LoggerFile     string `yaml:"logger_file"`
	LogFormatText  bool   `yaml:"log_format_text"`
	RollingPolicy  string `yaml:"rollingPolicy"`
	LogRotateDate  int    `yaml:"log_rotate_date"`
	LogRotateSize  int    `yaml:"log_rotate_size"`
	LogBackupCount int    `yaml:"log_backup_count"`
}

PassLagerCfg is the struct for lager information(passlager.yaml)

type Protocol

type Protocol struct {
	Listen       string `yaml:"listenAddress"`
	Advertise    string `yaml:"advertiseAddress"`
	WorkerNumber int    `yaml:"workerNumber"`
	Transport    string `yaml:"transport"`
	Failure      string `yaml:"failure"`
}

Protocol protocol structure

type QPSStruct

type QPSStruct struct {
	Enabled bool              `yaml:"enabled"`
	Global  map[string]int    `yaml:"global"`
	Limit   map[string]string `yaml:"limit"`
}

QPSStruct QPS struct

type ReferencesStruct

type ReferencesStruct struct {
	Version   string `yaml:"version"`
	Transport string `yaml:"transport"`
}

ReferencesStruct references structure

type RegistryAPIVersionStruct

type RegistryAPIVersionStruct struct {
	Version string `yaml:"version"`
}

RegistryAPIVersionStruct registry api version structure

type RegistryStruct

type RegistryStruct struct {
	Disable         bool                     `yaml:"disabled"`
	Type            string                   `yaml:"type"`
	Scope           string                   `yaml:"scope"`
	AutoDiscovery   bool                     `yaml:"autodiscovery"`
	AutoIPIndex     bool                     `yaml:"autoIPIndex"`
	Address         string                   `yaml:"address"`
	RefreshInterval string                   `yaml:"refeshInterval"`
	Watch           bool                     `yaml:"watch"`
	Tenant          string                   `yaml:"tenant"`
	AutoRegister    string                   `yaml:"register"`
	APIVersion      RegistryAPIVersionStruct `yaml:"api"`
}

RegistryStruct SC注册中心地址信息

type ServiceStruct

type ServiceStruct struct {
	Registry RegistryStruct `yaml:"registry"`
}

ServiceStruct SC注册中心地址信息结构体

type ServiceTypes

type ServiceTypes struct {
	Consumer TypesStruct `yaml:"Consumer"`
	Provider TypesStruct `yaml:"Provider"`
}

ServiceTypes gives the information of service types

type Timeout

type Timeout struct {
	Enabled bool `yaml:"enabled"`
}

Timeout time out

type TracingStruct

type TracingStruct struct {
	SamplingRate  float64 `yaml:"samplingRate"`
	CollectorType string  `yaml:"collectorType"` // http|log
	// if collectorType is http, the target is zipkin server
	// if collectorType is log, the target is log file
	CollectorTarget string `yaml:"collectorTarget"`
}

TracingStruct tracing structure

type TypesStruct

type TypesStruct struct {
	QPS QPSStruct `yaml:"qps"`
}

TypesStruct is the struct for QPS

Jump to

Keyboard shortcuts

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