Added a new Endpoint struct at the top level host package level to capture host, set, and address chosen. Temporarily add a host_plugin_host table to capture the hosts returned by the plugins. This ensures the datawarehouse is able to query the table to decide what host was chosen. The view used to update the datawarehouse dimension table provides rows with host set ids and hosts which are not in that host set. This is ok since the function which updates the dimension table provides the host set and host id chosen so that relationship doesn't need to be captured in the view itself. Co-authored-by: Jeff Mitchell <jeffrey.mitchell@gmail.com>
27 lines
896 B
Go
27 lines
896 B
Go
package host
|
|
|
|
import (
|
|
"github.com/hashicorp/boundary/internal/types/subtypes"
|
|
)
|
|
|
|
var registry = subtypes.NewRegistry()
|
|
|
|
// SubtypeFromType returns the Subtype from the provided string or if
|
|
// no Subtype was registered with that string Unknown is returned.
|
|
func SubtypeFromType(t string) subtypes.Subtype {
|
|
return registry.SubtypeFromType(t)
|
|
}
|
|
|
|
// SubtypeFromId returns the Subtype from the provided id if the id's prefix
|
|
// was registered with a Subtype. Otherwise Unknown is returned.
|
|
func SubtypeFromId(id string) subtypes.Subtype {
|
|
return registry.SubtypeFromId(id)
|
|
}
|
|
|
|
// Register registers all the prefixes for a provided Subtype. Register returns
|
|
// an error if the subtype has already been registered or if any of the
|
|
// prefixes are associated with another subtype.
|
|
func Register(subtype subtypes.Subtype, prefixes ...string) error {
|
|
return registry.Register(subtype, prefixes...)
|
|
}
|