shttp

package
v0.0.0-...-9811130 Latest Latest
Warning

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

Go to latest
Published: Apr 27, 2024 License: Apache-2.0 Imports: 24 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config

type Config struct {
	// Servicename for the certificate
	Servicename string `yaml:"servicename"`
	// port of the http server
	Port int `yaml:"port"`
	// port of the https server
	Sslport int `yaml:"sslport"`
	// this is the url how to connect to this service from outside
	ServiceURL string `yaml:"serviceURL"`
	// other dns names (used for certificate)
	DNSNames []string `yaml:"dnss"`
	// other ips (used for certificate)
	IPAddresses []string `yaml:"ips"`
	// path and name to the certificate
	Certificate string `yaml:"certificate"`
	// path and name to the private key
	Key string `yaml:"key"`
}

Config configuration of the http service

type SHttp

type SHttp struct {
	Started bool
	// contains filtered or unexported fields
}

SHttp a service encapsulating http and https server

func NewSHttp

func NewSHttp(cfn Config, cfgCa caservice.Config) (*SHttp, error)

NewSHttp creates a new shttp service

func (*SHttp) GetTLSConfig

func (s *SHttp) GetTLSConfig() (*tls.Config, error)

GetTLSConfig generates the tls config, getting certificate from ca service

func (*SHttp) ShutdownServers

func (s *SHttp) ShutdownServers()

ShutdownServers shutting all servers down

func (*SHttp) StartServers

func (s *SHttp) StartServers(router, healthRouter *chi.Mux)

StartServers starting all needed http servers

func (*SHttp) TLSFromFiles

func (s *SHttp) TLSFromFiles() (*tls.Config, error)

Jump to

Keyboard shortcuts

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