http

package
v0.4.2 Latest Latest
Warning

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

Go to latest
Published: Dec 18, 2025 License: EUPL-1.2 Imports: 12 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Component

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

func New

func New(config Config, publicMux *http.ServeMux, internalMux *http.ServeMux) *Component

New creates an instance of the HTTP component, which handles the HTTP interfaces for the application.

func (*Component) Internal added in v0.4.0

func (c *Component) Internal() InterfaceConfig

func (*Component) Public added in v0.4.0

func (c *Component) Public() InterfaceConfig

func (*Component) RegisterHttpHandlers

func (c *Component) RegisterHttpHandlers(_ *http.ServeMux, _ *http.ServeMux)

func (*Component) Start

func (c *Component) Start() error

func (*Component) Stop

func (c *Component) Stop(ctx context.Context) error

type Config added in v0.4.0

type Config struct {
	InternalInterface InterfaceConfig `koanf:"internal"`
	PublicInterface   InterfaceConfig `koanf:"public"`
}

func DefaultConfig added in v0.4.0

func DefaultConfig() Config

func TestConfig added in v0.4.0

func TestConfig() Config

type InterfaceConfig added in v0.4.0

type InterfaceConfig struct {
	Address string `koanf:"address"`
	BaseURL string `koanf:"url"`
}

func (InterfaceConfig) URL added in v0.4.0

func (c InterfaceConfig) URL() *url.URL

type InterfaceInfo added in v0.4.0

type InterfaceInfo interface {
	Public() InterfaceConfig
	Internal() InterfaceConfig
}

Jump to

Keyboard shortcuts

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