http_server_unit

package
v0.0.0-...-9102f00 Latest Latest
Warning

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

Go to latest
Published: Sep 11, 2023 License: MIT Imports: 12 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 {
	Host                 string `yaml:"host" json:"host" toml:"host"`
	Port                 string `yaml:"port" json:"port" toml:"port"`
	ShutdownPeriodMillis int64  `yaml:"shutdown_period_millis" json:"shutdown_period_millis" toml:"shutdown_period_millis"`
}

Config defines the configuration for the HttpServerUnit.

func ParseYamlConfig

func ParseYamlConfig(data []byte) (*Config, error)

func (*Config) ValidateConfig

func (c *Config) ValidateConfig() (*validatedConfig, error)

type HttpServerUnit

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

HttpServerUnit implements app.IUnit

func AddNew

func AddNew(unitName string, c *Config, rootHandler http.Handler) (*HttpServerUnit, error)

AddNew creates HttpServerUnit with specified configuration and adds it to the igulib/app.M

func New

func New(unitName string, c *Config, rootHandler http.Handler) (*HttpServerUnit, error)

func (*HttpServerUnit) UnitAvailability

func (u *HttpServerUnit) UnitAvailability() app.UnitAvailability

UnitAvailability implements app.IUnit.

func (*HttpServerUnit) UnitPause

func (u *HttpServerUnit) UnitPause() app.UnitOperationResult

UnitPause implements app.IUnit.

func (*HttpServerUnit) UnitQuit

func (u *HttpServerUnit) UnitQuit() app.UnitOperationResult

UnitQuit implements app.IUnit.

func (*HttpServerUnit) UnitRunner

func (u *HttpServerUnit) UnitRunner() *app.UnitLifecycleRunner

UnitRunner implements app.IUnit.

func (*HttpServerUnit) UnitStart

func (u *HttpServerUnit) UnitStart() app.UnitOperationResult

UnitStart implements app.IUnit.

Jump to

Keyboard shortcuts

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