host

package
v0.0.0-...-aeec266 Latest Latest
Warning

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

Go to latest
Published: Jan 5, 2021 License: BSD-3-Clause Imports: 3 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 {
	Name        string
	Certificate tls.Certificate
}

Config represents a host configuration.

func (*Config) UnmarshalYAML

func (c *Config) UnmarshalYAML(unmarshal func(interface{}) error) error

UnmarshalYAML satisfies Unmarshaler interface.

type Hosts

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

Hosts represents hosts configuation map.

func New

func New(hostsConfig []Config) (*Hosts, error)

New initializes configured hosts type and returns associated hosts.

func (*Hosts) Certificates

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

Certificates returns a list of TLS certificat.

func (*Hosts) DefaultHostName

func (h *Hosts) DefaultHostName() string

DefaultHostName returns the default hostname.

func (*Hosts) HostName

func (h *Hosts) HostName() []string

HostName returns a sorted list of hostname.

func (*Hosts) IsLocalHost

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

IsLocalHost returns whether a domain is hosted.

type TLSConfig

type TLSConfig struct {
	CertFile       string `yaml:"cert_path"`
	PrivateKeyFile string `yaml:"privkey_path"`
}

TLSConfig represents a TLS certification configuration.

Jump to

Keyboard shortcuts

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