web

package
v0.0.4 Latest Latest
Warning

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

Go to latest
Published: Jul 17, 2023 License: MIT Imports: 17 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type HealthData added in v0.0.2

type HealthData struct {
	Message     string    `json:"message,omitempty"`
	LastChecked time.Time `json:"lastChecked"`
}

type TLSCertificateGenerationParams

type TLSCertificateGenerationParams struct {
	Organization string        `default:"acme.com" yaml:"organization"`
	Host         string        `default:"localhost" yaml:"host"`
	ValidForDays time.Duration `default:"3650" yaml:"validfor"` // Value in days
}

type WebServer

type WebServer struct {
	HealthCheck func() (bool, string)
	// contains filtered or unexported fields
}

func NewWebServer added in v0.0.2

func NewWebServer(config *WebServerConfiguration) (*WebServer, error)

func (*WebServer) DebugRoutes

func (server *WebServer) DebugRoutes(routerName string, router *chi.Mux)

func (*WebServer) Join

func (server *WebServer) Join()

func (*WebServer) Mount

func (server *WebServer) Mount(pattern string, handler http.Handler)

func (*WebServer) Start

func (server *WebServer) Start() error

func (*WebServer) Stop

func (server *WebServer) Stop()

type WebServerConfiguration

type WebServerConfiguration struct {
	Host                        string                         `yaml:"host"`
	Port                        int                            `default:"7080" yaml:"port"`
	SslPort                     int                            `yaml:"sslport"`
	SslCert                     string                         `yaml:"sslcert"`
	SslKey                      string                         `yaml:"sslkey"`
	HealthCheckPeriod           int                            `default:"30" yaml:"healthcheckperiod"`
	CertificateGenerationParams TLSCertificateGenerationParams `yaml:"tlsgenerationparams"`
}

func (*WebServerConfiguration) BuildHostAddress

func (c *WebServerConfiguration) BuildHostAddress(ssl bool) string

BuildHostAddress Builds a host address from configuration

func (*WebServerConfiguration) GetBindings

func (c *WebServerConfiguration) GetBindings() string

Jump to

Keyboard shortcuts

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