mirror of
https://github.com/mariocandela/beelzebub.git
synced 2025-07-01 18:47:26 -04:00
refactor: Improve Go docs (#74)
* add go docs, package: parser * add go docs, package: protocols * add go docs, package: tracer
This commit is contained in:
@ -1,3 +1,4 @@
|
||||
// Package protocols is responsible for managing the different protocols
|
||||
package protocols
|
||||
|
||||
import (
|
||||
@ -5,6 +6,7 @@ import (
|
||||
"github.com/mariocandela/beelzebub/v3/tracer"
|
||||
)
|
||||
|
||||
// ServiceStrategy is the common interface that each protocol honeypot implements
|
||||
type ServiceStrategy interface {
|
||||
Init(beelzebubServiceConfiguration parser.BeelzebubServiceConfiguration, tracer tracer.Tracer) error
|
||||
}
|
||||
@ -14,10 +16,11 @@ type ProtocolManager struct {
|
||||
tracer tracer.Tracer
|
||||
}
|
||||
|
||||
func InitProtocolManager(tracerStrategy tracer.Strategy, strategy ServiceStrategy) *ProtocolManager {
|
||||
// InitProtocolManager is the method that initializes the protocol manager, receving the concrete tracer and the concrete service
|
||||
func InitProtocolManager(tracerStrategy tracer.Strategy, serviceStrategy ServiceStrategy) *ProtocolManager {
|
||||
return &ProtocolManager{
|
||||
tracer: tracer.GetInstance(tracerStrategy),
|
||||
strategy: strategy,
|
||||
strategy: serviceStrategy,
|
||||
}
|
||||
}
|
||||
|
||||
@ -25,6 +28,7 @@ func (pm *ProtocolManager) SetProtocolStrategy(strategy ServiceStrategy) {
|
||||
pm.strategy = strategy
|
||||
}
|
||||
|
||||
// InitService is the method that initializes the honeypot
|
||||
func (pm *ProtocolManager) InitService(beelzebubServiceConfiguration parser.BeelzebubServiceConfiguration) error {
|
||||
return pm.strategy.Init(beelzebubServiceConfiguration, pm.tracer)
|
||||
}
|
||||
|
Reference in New Issue
Block a user