Documentation ¶
Index ¶
- Constants
- func KeyProcessorConf(dispatcherID string) string
- func KeyProducerConf(appID, topicID string) string
- type ConfConnector
- type ConfConnectorConfig
- type ConfigType
- type EtcdConf
- type EtcdConfig
- type FlowControlStrategy
- type ProcessorConf
- func (s *ProcessorConf) GetAllConfInfo() ([]*ProcessorConfInfo, error)
- func (s *ProcessorConf) GetConfInfo(dispatcherID string) (*ProcessorConfInfo, error)
- func (s *ProcessorConf) SetConfInfo(dispatcherID string, confInfo *ProcessorConfInfo) error
- func (s *ProcessorConf) SetWatch(watch func(c *ProcessorConfInfo, eventType int32) error) error
- type ProcessorConfConnector
- type ProcessorConfInfo
- type ProducerConf
- func (s *ProducerConf) GetAllConfInfo() ([]*ProducerConfInfo, error)
- func (s *ProducerConf) GetConfInfo(appID, topicID string) (*ProducerConfInfo, error)
- func (s *ProducerConf) SetConfInfo(appID, topicID string, confInfo *ProducerConfInfo) error
- func (s *ProducerConf) SetWatch(watch func(c *ProducerConfInfo, eventType int32) error) error
- type ProducerConfConnector
- type ProducerConfInfo
- type RetryStrategy
Constants ¶
const ( EventTypeNone = int32(0) EventTypeUpdate = int32(1) EventTypeAdd = int32(2) EventTypeDelete = int32(3) EventTypeAll = int32(4) )
const (
ConfigProcessorGroupName = "/evhub/processor/"
)
const (
ConfigProducerGroupName = "/evhub/producer/"
)
Variables ¶
This section is empty.
Functions ¶
func KeyProcessorConf ¶
KeyProcessorConf returns the key of the processor group
func KeyProducerConf ¶
KeyProducerConf returns the key of producer group
Types ¶
type ConfConnector ¶
type ConfConnector interface { GetAllConfInfo() ([]interface{}, error) SetWatch(func(c interface{}, eventType int32) error) error SetConfInfo(key string, confInfo interface{}) error GetConfInfo(key string) ([]byte, error) }
ConfConnector is the interface for connecting configuration platform
func NewConfConnector ¶
func NewConfConnector(c ConfConnectorConfig, configGroupName string) (ConfConnector, error)
NewConfConnector creates a new connector configuration
type ConfConnectorConfig ¶
type ConfConnectorConfig struct { ConfType ConfigType EtcdConfig EtcdConfig }
ConfConnectorConfig is connector configuration
type ConfigType ¶
type ConfigType string
ConfigType is the type of the configuration
const (
ConfigTypeEtcd ConfigType = "etcd"
)
type EtcdConf ¶
type EtcdConf struct {
// contains filtered or unexported fields
}
EtcdConf is type of configuration
func NewEtcd ¶
func NewEtcd(c EtcdConfig, configGroupName string) (*EtcdConf, error)
NewEtcd creates a new Etcd configuration
func (*EtcdConf) GetAllConfInfo ¶
GetAllConfInfo returns all configuration information
func (*EtcdConf) GetConfInfo ¶
GetConfInfo is used to get the configuration information
func (*EtcdConf) SetConfInfo ¶
SetConfInfo is used to set the configuration information
type EtcdConfig ¶
EtcdConfig is etcd configuration
type FlowControlStrategy ¶
FlowControlStrategy is the strategy of flow control
type ProcessorConf ¶
type ProcessorConf struct {
ConfConnector ConfConnector
}
ProcessorConf is processor configuration
func (*ProcessorConf) GetAllConfInfo ¶
func (s *ProcessorConf) GetAllConfInfo() ([]*ProcessorConfInfo, error)
GetAllConfInfo returns all configuration information for all topics
func (*ProcessorConf) GetConfInfo ¶
func (s *ProcessorConf) GetConfInfo(dispatcherID string) (*ProcessorConfInfo, error)
GetConfInfo is used to get the configuration information for a given dispatcherID
func (*ProcessorConf) SetConfInfo ¶
func (s *ProcessorConf) SetConfInfo(dispatcherID string, confInfo *ProcessorConfInfo) error
SetConfInfo is used to set the configuration information for a given processor
func (*ProcessorConf) SetWatch ¶
func (s *ProcessorConf) SetWatch(watch func(c *ProcessorConfInfo, eventType int32) error) error
SetWatch is used to watch the configuration
type ProcessorConfConnector ¶
type ProcessorConfConnector interface { GetAllConfInfo() ([]*ProcessorConfInfo, error) SetWatch(func(c *ProcessorConfInfo, eventType int32) error) error SetConfInfo(dispatcherID string, confInfo *ProcessorConfInfo) error GetConfInfo(dispatcherID string) (*ProcessorConfInfo, error) }
ProcessorConfConnector is the interface for a connector of processor configuration
func NewProcessorConfConnector ¶
func NewProcessorConfConnector(c ConfConnectorConfig) (ProcessorConfConnector, error)
NewProcessorConfConnector creates a new processor configuration connector
type ProcessorConfInfo ¶
type ProcessorConfInfo struct { AppID string `json:"app_id"` TopicID string `json:"topic_id"` ProtocolType string `json:"protocol_type"` Addr string `json:"addr"` DispatcherID string `json:"dispatcher_id"` IsFlowControl bool `json:"is_flow_control"` FlowControlStrategy FlowControlStrategy `json:"flow_control_strategy"` IsRetry bool `json:"is_retry"` RetryStrategy RetryStrategy `json:"retry_strategy"` Timeout int64 `json:"timeout"` IsStop bool `json:"is_stop"` FilterTag map[string]bool `json:"filter_tag"` DelayProcessKey string `json:"delay_process_key"` }
ProcessorConfInfo is the configuration information for a processor
type ProducerConf ¶
type ProducerConf struct { // ConfConnector is the connector of producer configuration ConfConnector ConfConnector }
ProducerConf is producer configuration
func (*ProducerConf) GetAllConfInfo ¶
func (s *ProducerConf) GetAllConfInfo() ([]*ProducerConfInfo, error)
GetAllConfInfo returns all configuration information for all topics
func (*ProducerConf) GetConfInfo ¶
func (s *ProducerConf) GetConfInfo(appID, topicID string) (*ProducerConfInfo, error)
GetConfInfo is used to get the configuration information for a given appID, topicID
func (*ProducerConf) SetConfInfo ¶
func (s *ProducerConf) SetConfInfo(appID, topicID string, confInfo *ProducerConfInfo) error
SetConfInfo is used to set the configuration information for a given producer
func (*ProducerConf) SetWatch ¶
func (s *ProducerConf) SetWatch(watch func(c *ProducerConfInfo, eventType int32) error) error
SetWatch is used to watch the configuration
type ProducerConfConnector ¶
type ProducerConfConnector interface { GetAllConfInfo() ([]*ProducerConfInfo, error) SetWatch(func(c *ProducerConfInfo, eventType int32) error) error SetConfInfo(appID, topicID string, confInfo *ProducerConfInfo) error GetConfInfo(appID, topicID string) (*ProducerConfInfo, error) }
ProducerConfConnector is the interface for a connector of producer configuration
func NewProducerConfConnector ¶
func NewProducerConfConnector(c ConfConnectorConfig) (ProducerConfConnector, error)
NewProducerConfConnector creates a new producer configuration connector
type ProducerConfInfo ¶
type ProducerConfInfo struct { AppID string `json:"app_id"` TopicID string `json:"topic_id"` QPS int64 `json:"qps"` MsgSize int64 `json:"msg_size"` TotalMsg int64 `json:"total_msg"` StoragePeriod int64 `json:"storage_period"` TxProtocolType int `json:"tx_protocol_type"` TxAddress string `json:"tx_address"` TxTimeout int64 `json:"tx_timeout"` TxCallbackInterval int64 `json:"tx_callback_interval"` }
ProducerConfInfo is the configuration information for a producer
type RetryStrategy ¶
type RetryStrategy struct { StrategyType string `json:"strategy_type"` RetryInterval int64 `json:"retry_interval"` RetryCount int `json:"retry_count"` }
RetryStrategy is the strategy of retry