web

package
v0.0.0-...-433870c Latest Latest
Warning

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

Go to latest
Published: Sep 1, 2024 License: GPL-2.0 Imports: 14 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	Domain        string `env:"DOMAIN"`
	Port          string `env:"PORT"`
	ViewDirectory string `env:"VIEW_DIR"`
}

Configuration of the webservice

type FiberWebserver

type FiberWebserver struct {
	// contains filtered or unexported fields
}

FiberWebserver represents the fiber webinterface for this application

func (*FiberWebserver) AlertTriggerURL

func (w *FiberWebserver) AlertTriggerURL(alert models.Alert, message string) string

AlertTriggerURL creates an URL to trigger the given alert

func (*FiberWebserver) InitializeWebserver

func (w *FiberWebserver) InitializeWebserver() error

InitializeWebserver initializes the webserver

func (*FiberWebserver) Quit

func (w *FiberWebserver) Quit() error

Quit shuts down the webserver

func (*FiberWebserver) RegisterEndpoint

func (w *FiberWebserver) RegisterEndpoint(name string, endpoint endpoints.Endpoint)

RegisterEndpoint registers an endpoint to the webserver

func (*FiberWebserver) Run

func (w *FiberWebserver) Run(wg *sync.WaitGroup) error

Run runs the webserver

type Webserver

type Webserver interface {
	InitializeWebserver() error
	Run(wg *sync.WaitGroup) error
	Quit() error
	AlertTriggerURL(alert models.Alert, message string) string
	RegisterEndpoint(name string, endpoint endpoints.Endpoint)
}

Webserver interface

func NewWebserver

func NewWebserver(config *Configuration, log *logrus.Logger) Webserver

NewWebserver creates a new Webserver

Jump to

Keyboard shortcuts

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