factory

package
v2.8.1 Latest Latest
Warning

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

Go to latest
Published: Oct 14, 2026 License: Apache-2.0 Imports: 3 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CreateProbe

func CreateProbe(probeType ProbeType) (domain.Probe, error)

CreateProbe creates a probe using the global factory.

func RegisterProbe

func RegisterProbe(probeType ProbeType, constructor ProbeConstructor) error

RegisterProbe registers a probe constructor with the global factory.

Types

type ProbeConstructor

type ProbeConstructor func() (domain.Probe, error)

ProbeConstructor is a function that creates a new probe instance.

type ProbeFactory

type ProbeFactory interface {
	// CreateProbe creates a new probe instance of the specified type.
	CreateProbe(probeType ProbeType) (domain.Probe, error)

	// RegisterProbeConstructor registers a constructor for a probe type.
	RegisterProbeConstructor(probeType ProbeType, constructor ProbeConstructor) error

	// GetSupportedProbes returns a list of all supported probe types.
	GetSupportedProbes() []ProbeType
}

ProbeFactory defines the interface for creating probes.

func NewProbeFactory

func NewProbeFactory() ProbeFactory

NewProbeFactory creates a new probe factory.

type ProbeType

type ProbeType string

ProbeType defines the types of probes available.

const (
	ProbeTypeBash     ProbeType = "Bash"
	ProbeTypeZsh      ProbeType = "Zsh"
	ProbeTypeMySQL    ProbeType = "MySQL"
	ProbeTypePostgres ProbeType = "postgres"
	ProbeTypeOpenSSL  ProbeType = "OpenSSL"
	ProbeTypeGnuTLS   ProbeType = "GnuTLS"
	ProbeTypeNSPR     ProbeType = "NSPR"
	ProbeTypeGoTLS    ProbeType = "GoTLS"
)

func GetSupportedProbes

func GetSupportedProbes() []ProbeType

GetSupportedProbes returns supported probes from the global factory.

Jump to

Keyboard shortcuts

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