Documentation
¶
Overview ¶
Package hostname provides a parse method to extract the components of a virtual hostname. Currently only intended for use by the SSH proxy feature, hostnames can reference machines, units, and pods.
Index ¶
Constants ¶
const ( // ErrNoMatch indicates that the hostname could not be parsed. ErrNoMatch = errors.ConstError("could not parse hostname") )
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type HostnameTarget ¶
type HostnameTarget int
HostnameTarget defines what kind of infrastructure the user is targeting.
const ( // MachineTarget defines a machine as the target. MachineTarget HostnameTarget = iota // UnitTarget defines a unit (K8s or machine) // as the target. UnitTarget // ContainerTarget defines a container within a // unit as the target. ContainerTarget )
type Info ¶
type Info struct {
// contains filtered or unexported fields
}
Info returns a breakdown of a virtual hostname into its constituent parts. The target field indicates what kind of hostname was parsed which will indicate that some fields are empty.
func Parse ¶
Parse parses a virtual Juju hostname that references entities like machines, units and containers.
func (Info) Container ¶
Container returns the container name and a bool to indicate if a container is valid for the target type.
func (Info) Target ¶
func (i Info) Target() HostnameTarget
HostnameTarget returns an enum value indicating the target of the hostname e.g. container, machine, etc.