Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Analyzer ¶
type Analyzer interface { // Analyze analyzes message from collectors. Analyze(message *string) error // Hash returns a hash value of the input message string. Hash(cloudid, ip string) (string, error) // Mock returns mock message that could be analyzed by the Analyzer. Mock() string }
Analyzer is common collection analyzer interface.
type Hash ¶
type Hash struct {
// contains filtered or unexported fields
}
Hash is data hash that updates target nodes in dynamic mode, and calculates node base on hash key of data.
type Porter ¶
type Porter interface { // Name returns name of the Porter. Name() string // Run runs the Porter. Run() error // Mock supports mock service in Porter. Mock() error }
Porter is common porter interface. It handles message from collectors base on Analyzer.
type PorterManager ¶
type PorterManager struct {
// contains filtered or unexported fields
}
PorterManager manages the collection porters.
func NewPorterManager ¶
func NewPorterManager() *PorterManager
NewPorterManager creates a new PorterManager object.
func (*PorterManager) AddPorter ¶
func (mgr *PorterManager) AddPorter(p Porter) error
AddPorter adds and runs a new porter.
type SimplePorter ¶
type SimplePorter struct {
// contains filtered or unexported fields
}
SimplePorter is simple porter handles message from collectors. You can impls your own Porter base on Porter and Analyzer interfaces.
func NewSimplePorter ¶
func NewSimplePorter(name string, engine *backbone.Engine, hash *Hash, analyzer Analyzer, redisCli *redis.Client, topics []string, registry prometheus.Registerer) *SimplePorter
NewSimplePorter creates a new SimplePorter object.
func (*SimplePorter) AddMessage ¶
func (p *SimplePorter) AddMessage(message *string) error
Mock handles a mock message.
Click to show internal directories.
Click to hide internal directories.