entity

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Aug 3, 2021 License: MIT Imports: 5 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Address

type Address struct {
	IsIpv6 bool
	Host   string
	Port   string
}

Address represents virtual host address

func CreateVhostAddressFromString

func CreateVhostAddressFromString(addrStr string) Address

CreateVhostAddressFromString parses address string and returns Address structure

func (*Address) GetAddressWithNewPort

func (a *Address) GetAddressWithNewPort(port string) *Address

GetAddressWithNewPort returns new a Address instance with changed port

func (*Address) GetHash

func (a *Address) GetHash() string

GetHash returns addr hash based on host an port

func (*Address) GetNormalizedHost

func (a *Address) GetNormalizedHost() string

GetNormalizedHost returns normalized host. Normalization occurres only for ipv6 address. Ipv4 returns as is. For example: [fd00:dead:beaf::1] -> fd00:dead:beaf:0:0:0:0:1

func (*Address) GetNormalizedIpv6

func (a *Address) GetNormalizedIpv6() string

GetNormalizedIpv6 returns normalized IPv6 For example: [fd00:dead:beaf::1] -> fd00:dead:beaf:0:0:0:0:1

func (*Address) IsEqual

func (a *Address) IsEqual(b *Address) bool

IsEqual check if addresses as equal

func (*Address) IsWildcardPort

func (a *Address) IsWildcardPort() bool

IsWildcardPort checks if port is wildcard

func (*Address) ToString

func (a *Address) ToString() string

ToString returns address as string

type VirtualHost

type VirtualHost struct {
	FilePath,
	ServerName,
	DocRoot,
	AugPath string
	Addresses map[string]Address
	Aliases   []string
	Ssl,
	Enabled,
	ModMacro bool
	Ancestor *VirtualHost
}

VirtualHost represents Apache virtual host data

func (*VirtualHost) GetAddressesString

func (vh *VirtualHost) GetAddressesString(hostsOnly bool) string

GetAddressesString return address as a string: "172.10.52.2:80 172.10.52.3:8080"

func (*VirtualHost) GetConfigName

func (vh *VirtualHost) GetConfigName() string

GetConfigName returns config name of a virtual hosr

func (*VirtualHost) GetNames

func (vh *VirtualHost) GetNames() ([]string, error)

GetNames returns all names (servername + aliases) of a virtual host

Jump to

Keyboard shortcuts

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