Documentation ¶
Index ¶
- Variables
- func EnsureOutFolder(outFolder string) error
- func GetFreePort() (port int, err error)
- func GetOutboundIP() (net.IP, error)
- func IsDockerContainer() bool
- func IsFreePort(port int) bool
- type Bus
- type Core
- type EventHandler
- type Middleware
- type Option
- type WebServer
- func (w *WebServer) AddMiddleware(m Middleware)
- func (w *WebServer) BasePath() string
- func (w *WebServer) Handle(pattern string, handler http.Handler)
- func (w *WebServer) HandleFunc(pattern string, handler http.HandlerFunc)
- func (w *WebServer) Start()
- func (w *WebServer) Stop()
- func (w *WebServer) URL() string
Constants ¶
This section is empty.
Variables ¶
var (
// Keystore stores the keys
Keystore = &keyStore{}
)
Functions ¶
func EnsureOutFolder ¶
EnsureOutFolder creates a folder if it does not exist
func GetFreePort ¶
GetFreePort asks the kernel for a free open port that is ready to use.
func GetOutboundIP ¶
GetOutboundIP returns the IP visible to others
func IsDockerContainer ¶
func IsDockerContainer() bool
IsDockerContainer checks if running in a docker env
Types ¶
type Bus ¶
type Bus struct { Szenario *eventHandler[msg.SzenarioEvtMsg] Alert *eventHandler[msg.AlertMsg] Incident *eventHandler[msg.IncidentMsg] // contains filtered or unexported fields }
Bus is the event bus
func (Bus) EndpointURL ¶
EndpointURL returns the URL the bus endpoint listens on
func (*Bus) WaitMsgProcessed ¶
func (e *Bus) WaitMsgProcessed()
WaitMsgProcessed waits until the managed cannels have their messages sent
type Core ¶
type Core struct {
// contains filtered or unexported fields
}
Core is the central structure
func (*Core) HCL ¶
func (c *Core) HCL() hcl.Logger
HCL returns the logger or panics if Core not Initialised with New
func (*Core) SzenaioConfig ¶
SzenaioConfig returns the szenario config
type Option ¶
type Option func(*Core)
Option configures the core
type WebServer ¶
type WebServer struct {
// contains filtered or unexported fields
}
WebServer is a wrapper for a webserver
func (*WebServer) AddMiddleware ¶
func (w *WebServer) AddMiddleware(m Middleware)
AddMiddleware adds middleware
func (*WebServer) Handle ¶
Handle registers the handler for the given pattern. If a handler already exists for pattern, Handle panics.
func (*WebServer) HandleFunc ¶
func (w *WebServer) HandleFunc(pattern string, handler http.HandlerFunc)
HandleFunc registers the handler function for the given pattern.