host

package
v0.59.0 Latest Latest
Warning

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

Go to latest
Published: Mar 27, 2022 License: Apache-2.0 Imports: 4 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Config added in v0.55.0

type Config struct {
	Domain string `fig:"domain"`
	TLS    struct {
		CertFile       string `fig:"cert_file"`
		PrivateKeyFile string `fig:"privkey_file"`
	} `fig:"tls"`
}

Config contains host configuration parameters.

type Configs added in v0.55.0

type Configs []Config

Configs contains a set of host configurations.

type Hosts

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

Hosts type represents all local domains set.

func NewHosts added in v0.55.0

func NewHosts(cfg Configs) (*Hosts, error)

NewHosts creates and initializes a Hosts instance.

func (*Hosts) Certificates

func (hs *Hosts) Certificates() []tls.Certificate

Certificates returns all registered domain certificates.

func (*Hosts) DefaultHostName

func (hs *Hosts) DefaultHostName() string

DefaultHostName returns default host name value.

func (*Hosts) HostNames

func (hs *Hosts) HostNames() []string

HostNames returns the list of all registered local hosts.

func (*Hosts) IsLocalHost

func (hs *Hosts) IsLocalHost(h string) bool

IsLocalHost tells whether or not d value corresponds to local host.

func (*Hosts) RegisterDefaultHost

func (hs *Hosts) RegisterDefaultHost(h string, cer tls.Certificate)

RegisterDefaultHost registers default host value along with its certificate.

func (*Hosts) RegisterHost

func (hs *Hosts) RegisterHost(h string, cer tls.Certificate)

RegisterHost registers a host value along with its certificate.

Jump to

Keyboard shortcuts

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